From 0fe249c9f5466ed803448a61b9a6830d4fea08aa Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 22:05:45 +0100 Subject: [PATCH 1/8] PSO writer: edits in .oiv packages install and uninstall (#137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rage-formats: XML → PSO (`Pso::from_xml`), using the original file as the template: its schema and other sections stay, the data and block map are rebuilt with the game's layout (one type per block, original block order, depth-first items, 0x70 padding, GTA V and RDR2 block maps and pointers). Structures, pointers, arrays (inline and external), strings, hashes, enums, flags, maps, vectors and matrices. CHKS is dropped when the data changes. - Reader fixes found by the round trip: RDR2 enum values are 16 bytes (flag and enum names were wrong), unknown enum values print as numbers, string arrays were escaped twice. - names::parse_value: the hash behind a printed name. - openrage verify --meta --rebuild and rpf8 --meta --rebuild: every PSO file to XML and back. GTA V Enhanced: 4,943 files, 3,973 byte-identical, all read back to the same XML. RDR2: 69,246 files, 52,656 identical, all others the same XML (2 not fully readable, skipped). - oiv: parses its XML commands and is applied like on the file's XML, then written back; preview shows the lines changed, journal and undo as for other edits. Names compared in XPaths are registered so hashes match them. - Docs: modding (supported kinds, what is still refused), cli, index table. Co-authored-by: Claude Opus 5.5 --- Cargo.lock | 1 + crates/openrage-app/src/oiv/install.rs | 102 ++- crates/openrage-app/src/oiv/package.rs | 78 ++- crates/openrage-app/tests/oiv.rs | 45 +- crates/openrage-cli/src/cli.rs | 6 + crates/openrage-cli/src/cmd/rdr2.rs | 46 +- crates/openrage-cli/src/cmd/verify.rs | 97 +++ crates/openrage-cli/src/main.rs | 18 +- crates/rage-formats/Cargo.toml | 1 + crates/rage-formats/src/names.rs | 35 ++ crates/rage-formats/src/pso.rs | 37 +- crates/rage-formats/src/pso/write.rs | 831 +++++++++++++++++++++++++ site/content/_index.md | 2 +- site/content/cli.md | 2 + site/content/modding.md | 12 +- 15 files changed, 1254 insertions(+), 59 deletions(-) create mode 100644 crates/rage-formats/src/pso/write.rs diff --git a/Cargo.lock b/Cargo.lock index 296e4c5..0e7dc6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4550,6 +4550,7 @@ dependencies = [ "png", "rage-core", "rage-resource", + "roxmltree", "symphonia", "texpresso", "texture2ddecoder", diff --git a/crates/openrage-app/src/oiv/install.rs b/crates/openrage-app/src/oiv/install.rs index d8611e1..5d156b5 100644 --- a/crates/openrage-app/src/oiv/install.rs +++ b/crates/openrage-app/src/oiv/install.rs @@ -3,20 +3,20 @@ //! The same walk over the package script runs in two modes: a dry run that //! reads everything and reports what would happen (and what cannot work), and //! the real installation. Archive changes are batched per top-level archive -//! and written with the in-place editor; text and XML edits read the current -//! file (including earlier changes of the same package). All journal entries +//! and written with the in-place editor; text, XML and PSO edits read the +//! current file (including earlier changes of the same package). All journal entries //! carry the package's group, so the package can be uninstalled as a whole. use std::collections::{HashMap, HashSet}; use std::path::Path; use std::sync::Arc; -use anyhow::{Result, bail}; +use anyhow::{Context, Result, bail}; use rage_crypto::GtaVKeys; use rage_rpf::ArchiveWriter; use rage_rpf::vfs::{self, Node}; -use super::package::{Command, Package}; +use super::package::{Command, Package, XmlCmd}; use super::{text, xml}; use crate::install::{self, Op}; use crate::journal::{Entry, Journal}; @@ -55,8 +55,11 @@ fn norm(p: &str) -> String { fn escaping_path(cmd: &Command) -> Option<&str> { let raw = match cmd { Command::Add { target, .. } | Command::Delete { target } => target, - Command::Archive { path, .. } | Command::Text { path, .. } | Command::Xml { path, .. } => path, - Command::Pso { .. } | Command::Defragment { .. } => return None, + Command::Archive { path, .. } + | Command::Text { path, .. } + | Command::Xml { path, .. } + | Command::Pso { path, .. } => path, + Command::Defragment { .. } => return None, }; let n = norm(raw); (!n.is_empty() && vfs::safe_relative_path(&n).is_none()).then_some(raw.as_str()) @@ -70,6 +73,16 @@ fn join(a: &str, b: &str) -> String { } } +#[cfg(test)] +mod tests { + #[test] + fn xpath_literals() { + assert_eq!(super::quoted("/A/Item[Name = 'adder']/B[@x=\"1\"]"), ["adder", "1"]); + assert!(super::quoted("/A/B").is_empty()); + assert_eq!(super::changed_lines("a\n b\nc", "a\nb\nd\ne"), (2, 1)); + } +} + #[derive(Clone, Copy)] enum Encoding { Utf8, @@ -348,10 +361,19 @@ impl Run<'_> { self.step("Edit", &vpath, format!("{} XML command(s)", commands.len())); self.write_edited(scope, path, encode(&doc, enc))?; } - Command::Pso { path } => { - self.report - .blockers - .push(format!("{}: PSO/META edits are not supported yet", Self::vpath(scope, path))); + Command::Pso { path, commands } => { + let vpath = Self::vpath(scope, path); + let Some(bytes) = self.read(&vpath) else { + self.report.blockers.push(format!("PSO file {vpath} does not exist")); + continue; + }; + match edit_pso(&bytes, commands) { + Ok((data, detail)) => { + self.step("Edit", &vpath, detail); + self.write_edited(scope, path, data)?; + } + Err(e) => self.report.blockers.push(format!("{vpath}: {e:#}")), + } } Command::Defragment { archive } => { self.report.warnings.push(format!("defragmentation of {archive} skipped (only saves disk space)")); @@ -362,6 +384,66 @@ impl Run<'_> { } } +/// Applies XML edits to a PSO file: converts it to XML, edits that, and +/// writes it back with the file's own schema. Returns the new file and a +/// summary of the change for the preview. +fn edit_pso(bytes: &[u8], commands: &[XmlCmd]) -> Result<(Vec, String)> { + use rage_formats::pso; + if !pso::is_pso(bytes) { + bail!("not a PSO file (only PSO metadata can be edited with ; resource metadata cannot yet)"); + } + // Hashes print as names only when the name is known: names the XPaths + // compare with (`Item[Name = 'adder']`) are made known first, so they + // select what the author meant. + rage_formats::names::register(commands.iter().flat_map(|c| { + let xpath = match c { + XmlCmd::Add { xpath, .. } | XmlCmd::Replace { xpath, .. } | XmlCmd::Remove { xpath } => xpath, + }; + quoted(xpath) + })); + let file = pso::parse(bytes)?; + let (before, problems) = file.to_xml_with_limit(1 << 30); + if let Some(p) = problems.first() { + bail!("parts of the file cannot be read ({p}), so it cannot be written back safely"); + } + let mut doc = before.clone(); + for c in commands { + doc = xml::apply(&doc, c)?; + } + let data = file.from_xml(&doc).context("the edited XML does not fit the file's structure")?; + let (added, removed) = changed_lines(&before, &doc); + let detail = format!("{} XML command(s) on the PSO data: {added} line(s) added, {removed} removed", commands.len()); + Ok((data, detail)) +} + +/// The quoted literals of an XPath (`'…'` or `"…"`). +fn quoted(xpath: &str) -> Vec { + let mut out = Vec::new(); + let mut rest = xpath; + while let Some(start) = rest.find(['\'', '"']) { + let q = &rest[start..start + 1]; + let Some(len) = rest[start + 1..].find(q) else { break }; + out.push(rest[start + 1..start + 1 + len].to_owned()); + rest = &rest[start + 2 + len..]; + } + out +} + +/// Lines only in `after` and lines only in `before` (counted with repeats). +fn changed_lines(before: &str, after: &str) -> (usize, usize) { + let mut count: HashMap<&str, isize> = HashMap::new(); + // Trimmed, so that re-indented lines do not count as changed. + for l in before.lines() { + *count.entry(l.trim()).or_default() -= 1; + } + for l in after.lines() { + *count.entry(l.trim()).or_default() += 1; + } + let added = count.values().filter(|n| **n > 0).map(|n| *n as usize).sum(); + let removed = count.values().filter(|n| **n < 0).map(|n| n.unsigned_abs()).sum(); + (added, removed) +} + fn run(game_dir: &Path, keys: Option>, pkg: &Package, dry: bool) -> Result { let mut r = Run { game_dir, diff --git a/crates/openrage-app/src/oiv/package.rs b/crates/openrage-app/src/oiv/package.rs index 834110d..6fd1933 100644 --- a/crates/openrage-app/src/oiv/package.rs +++ b/crates/openrage-app/src/oiv/package.rs @@ -98,9 +98,11 @@ pub enum Command { path: String, commands: Vec, }, - /// PSO/META edits (``); need a PSO converter, not supported yet. + /// Edits of a binary PSO metadata file (``): converted to XML, edited + /// with the same commands as ``, and written back as PSO. Pso { path: String, + commands: Vec, }, /// Archive rebuild to reclaim space; optional, skipped. Defragment { @@ -275,33 +277,14 @@ fn parse_commands(source: &str, node: roxmltree::Node<'_, '_>) -> Result { - let mut commands = Vec::new(); - for x in c.children().filter(|x| x.is_element()) { - let xpath = attr(x, "xpath").context("XML command without xpath")?; - commands.push(match x.tag_name().name().to_ascii_lowercase().as_str() { - "add" => XmlCmd::Add { - append: match attr(x, "append") - .unwrap_or_else(|| "Last".into()) - .to_ascii_lowercase() - .as_str() - { - "first" => Append::First, - "before" => Append::Before, - "after" => Append::After, - _ => Append::Last, - }, - content: inner_xml(source, x), - xpath, - }, - "replace" => XmlCmd::Replace { content: inner_xml(source, x), xpath }, - "remove" => XmlCmd::Remove { xpath }, - other => bail!("unknown XML command <{other}>"), - }); - } - Command::Xml { path: attr(c, "path").context(" without path")?, commands } - } - "pso" => Command::Pso { path: attr(c, "path").unwrap_or_default() }, + "xml" => Command::Xml { + path: attr(c, "path").context(" without path")?, + commands: xml_commands(source, c)?, + }, + "pso" => Command::Pso { + path: attr(c, "path").context(" without path")?, + commands: xml_commands(source, c)?, + }, "defragmentation" => Command::Defragment { archive: attr(c, "archive").unwrap_or_default() }, other => bail!("unknown package command <{other}>"), }; @@ -310,6 +293,30 @@ fn parse_commands(source: &str, node: roxmltree::Node<'_, '_>) -> Result` or `` command. +fn xml_commands(source: &str, c: roxmltree::Node<'_, '_>) -> Result> { + let mut commands = Vec::new(); + for x in c.children().filter(|x| x.is_element()) { + let xpath = attr(x, "xpath").context("XML command without xpath")?; + commands.push(match x.tag_name().name().to_ascii_lowercase().as_str() { + "add" => XmlCmd::Add { + append: match attr(x, "append").unwrap_or_else(|| "Last".into()).to_ascii_lowercase().as_str() { + "first" => Append::First, + "before" => Append::Before, + "after" => Append::After, + _ => Append::Last, + }, + content: inner_xml(source, x), + xpath, + }, + "replace" => XmlCmd::Replace { content: inner_xml(source, x), xpath }, + "remove" => XmlCmd::Remove { xpath }, + other => bail!("unknown XML command <{other}>"), + }); + } + Ok(commands) +} + fn parse_assembly(text: &str) -> Result { let doc = roxmltree::Document::parse(text).context("assembly.xml is not valid XML")?; let root = doc.root_element(); @@ -414,6 +421,21 @@ mod tests { assert_eq!(text[1], TextCmd::Delete { line: "#*".into(), condition: Condition::Mask }); } + #[test] + fn parses_pso_edits() { + let pso = ASSEMBLY.replace( + "", + r#""#, + ); + let p = parse_assembly(&pso).unwrap(); + let Command::Pso { path, commands } = &p.commands[2] else { panic!("{:?}", p.commands[2]) }; + assert_eq!(path, "x64\\data\\carcols.ymt"); + assert_eq!(commands, &[XmlCmd::Remove { xpath: "/CVehicleModColors/kits/Item[1]".into() }]); + assert!( + parse_assembly(&ASSEMBLY.replace("", "")).is_err() + ); + } + #[test] fn rejects_other_games() { let other = ASSEMBLY.replace("target=\"Five\"", "target=\"IV\""); diff --git a/crates/openrage-app/tests/oiv.rs b/crates/openrage-app/tests/oiv.rs index 50e71ce..4a69ba9 100644 --- a/crates/openrage-app/tests/oiv.rs +++ b/crates/openrage-app/tests/oiv.rs @@ -18,11 +18,35 @@ fn fake_game(name: &str) -> PathBuf { w.add_file("common/data/dlclist.xml", DLCLIST.as_bytes().to_vec()).unwrap(); w.add_file("common/data/settings.txt", b"a=1\nb=2\n".to_vec()).unwrap(); w.add_file("common/data/old.dat", b"old".to_vec()).unwrap(); + w.add_file("common/data/peds.ymt", tiny_pso()).unwrap(); std::fs::write(root.join("update/update.rpf"), w.build().unwrap()).unwrap(); std::fs::write(root.join("GTA5.exe"), b"").unwrap(); root } +/// A PSO file like the game's: a list of two items (a hash and a float each), +/// the items in block 1 and the root structure in block 2. +fn tiny_pso() -> Vec { + use rage_core::hash::{jenkins_bytes, joaat}; + let h = |name: &str| jenkins_bytes(name.as_bytes()); + let (root, item) = (h("CPedModelInfo__InitDataList"), h("CPedModelInfo__InitData")); + let be = |values: &[u32]| values.iter().flat_map(|v| v.to_be_bytes()).collect::>(); + let mut psin = b"PSIN\0\0\0\0pppppppp".to_vec(); + psin.extend(be(&[joaat("adder"), 1.5f32.to_bits(), joaat("banshee"), 2f32.to_bits()])); + psin.extend(be(&[1, 0, 0x0002_0002, 0])); // pointer to block 1, count and capacity 2 + psin[4..8].copy_from_slice(&48u32.to_be_bytes()); + let mut pmap = b"PMAP".to_vec(); + pmap.extend(be(&[48, 2, 0x0002_7070, item, 16, 0, 16, root, 32, 0, 16])); + // Structure infos: entry count, length, 0, then (name, type << 24 | subtype << 16 | offset, key). + let root_info = be(&[2, 16, 0, 0x100, 0x0c00_0000, item, h("InitDatas"), 0x0d00_0000, 0]); + let item_info = be(&[2, 8, 0, h("Name"), 0x0b07_0000, 0, h("Radius"), 0x0700_0004, 0]); + let mut psch = b"PSCH".to_vec(); + psch.extend(be(&[28 + 36 + 36, 2, root, 28, item, 28 + 36])); + psch.extend(root_info); + psch.extend(item_info); + [psin, pmap, psch].concat() +} + fn package(assembly: &str, files: &[(&str, &[u8])]) -> Package { let mut buf = std::io::Cursor::new(Vec::new()); { @@ -65,6 +89,17 @@ const ASSEMBLY: &str = r#" b=42 c=3 + + + + + + + zentorno + + + + dlcpacks:/testmod/ @@ -92,6 +127,8 @@ fn installs_and_uninstalls() { assert!(actions.contains(&"Add plugin.asi".to_owned()), "{actions:?}"); assert!(actions.contains(&"Delete update/update.rpf/common/data/old.dat".to_owned())); assert!(actions.contains(&"Create update/x64/dlcpacks/testmod/dlc.rpf".to_owned())); + let pso_step = plan.steps.iter().find(|s| s.target.ends_with("peds.ymt")).expect("PSO edit planned"); + assert_eq!(pso_step.detail, "2 XML command(s) on the PSO data: 5 line(s) added, 1 removed"); // The dry run changed nothing. assert!(!game.join("mods").exists() && !game.join("plugin.asi").exists()); @@ -107,6 +144,11 @@ fn installs_and_uninstalls() { "{dlclist}" ); assert_eq!(read(&game, "update/x64/dlcpacks/testmod/dlc.rpf/setup2.xml").unwrap(), b""); + let peds = read(&game, "update/update.rpf/common/data/peds.ymt").unwrap(); + let (xml, errors) = rage_formats::pso::to_xml(&peds).unwrap(); + assert!(errors.is_empty(), "{errors:?}"); + assert!(xml.contains("") && xml.contains(""), "{xml}"); + assert_eq!(xml.matches("").count(), 3, "{xml}"); assert_eq!(std::fs::read(game.join("update/update.rpf")).unwrap(), original, "game archive untouched"); let undone = uninstall(&game, "Test Mod 1.0").unwrap(); @@ -115,6 +157,7 @@ fn installs_and_uninstalls() { assert!(!game.join("mods/update/x64/dlcpacks/testmod/dlc.rpf").exists()); assert!(!game.join("mods/update/update.rpf").exists()); assert_eq!(read(&game, "update/update.rpf/common/data/old.dat").unwrap(), b"old"); + assert_eq!(read(&game, "update/update.rpf/common/data/peds.ymt").unwrap(), tiny_pso()); } #[test] @@ -124,7 +167,7 @@ fn reports_blockers() { r#"createIfNotExist="False" type="RPF7"> "#, r#"createIfNotExist="False" type="RPF7"> - + "#, ); let pkg = package(&bad, &[("plugin.asi", b"ASI")]); diff --git a/crates/openrage-cli/src/cli.rs b/crates/openrage-cli/src/cli.rs index 2eac94e..08146a8 100644 --- a/crates/openrage-cli/src/cli.rs +++ b/crates/openrage-cli/src/cli.rs @@ -96,6 +96,8 @@ pub(crate) enum Command { /// With --textures: also rebuild every dictionary and check that it reads back identically. /// With --models: write every GTA V Enhanced drawable (.ydr) anew with its own meshes and /// check that it reads back identically. + /// With --meta: convert every PSO file (.ymt, .ymf, .pso, …) to XML and back, and check + /// that it comes out byte for byte the same or at least reads back to the same XML. /// GTA IV without --textures: rebuild the table of every .rpf package in memory and /// check that it matches the stored one byte for byte (nothing is written). #[arg(long)] @@ -208,6 +210,10 @@ pub(crate) enum Command { /// Instead of only reading files, convert all metadata (.ymap, .ytyp, .ymt, .ymf) to XML. #[arg(long, conflicts_with_all = ["textures", "models", "text"])] meta: bool, + /// With --meta: convert every PSO file to XML and back, and check that it comes out the + /// same bytes or at least reads back to the same XML. + #[arg(long, requires = "meta")] + rebuild: bool, /// Instead of only reading files, decode every sound of every audio container. #[arg(long, conflicts_with_all = ["textures", "models", "text", "meta"])] audio: bool, diff --git a/crates/openrage-cli/src/cmd/rdr2.rs b/crates/openrage-cli/src/cmd/rdr2.rs index 2aa2ed8..55de401 100644 --- a/crates/openrage-cli/src/cmd/rdr2.rs +++ b/crates/openrage-cli/src/cmd/rdr2.rs @@ -9,12 +9,14 @@ pub(crate) struct Checks { pub(crate) models: bool, pub(crate) texts: bool, pub(crate) meta: bool, + /// With `meta`: convert every PSO file to XML and back instead. + pub(crate) rebuild: bool, pub(crate) audio: bool, pub(crate) anims: bool, } pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { - let Checks { textures, models, texts: text, meta, audio, anims } = checks; + let Checks { textures, models, texts: text, meta, rebuild, audio, anims } = checks; use rage_rpf::rpf8::{Compression, Rpf8}; let keys = openrage_app::rdr2::load_keys()?; let start = if path.is_dir() { path } else { path.parent().unwrap_or(path) }; @@ -49,6 +51,9 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { textures: usize, /// Triangles of the models, or strings of the text tables. triangles: usize, + /// PSO files rebuilt byte for byte, and ones not fully readable. + identical: usize, + unreadable: usize, lines: Vec, } /// Parses a texture dictionary and decodes all its textures; returns how many. @@ -129,7 +134,7 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { Ok(Some((awc.sounds.len(), secs))) } fn walk(rpf: &Rpf8, depth: usize, list: bool, checks: Checks, t: &mut Tally) { - let Checks { textures, models, texts, meta, audio, anims } = checks; + let Checks { textures, models, texts, meta, rebuild, audio, anims } = checks; let h = rpf.header(); let Some(entries) = rpf.entries() else { return }; t.readable += 1; @@ -198,6 +203,32 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { } } } + } else if meta && rebuild { + if matches!(e.ext_id, 1 | 11 | 73 | 74) && !e.is_resource { + let result = rpf.read(e).map_err(|err| err.to_string()).and_then(|d| { + if rage_formats::pso::is_pso(&d) { + super::verify::pso_round_trip(&d, true).map(Some) + } else { + Ok(None) + } + }); + use super::verify::PsoRoundTrip; + match result { + Ok(None) => {} + Ok(Some(r)) => { + t.textures += 1; + match r { + PsoRoundTrip::Identical => t.identical += 1, + PsoRoundTrip::SameXml => {} + PsoRoundTrip::Unreadable => t.unreadable += 1, + } + } + Err(err) => { + t.failed += 1; + t.lines.push(format!("{indent}{name}: {err}")); + } + } + } } else if meta { // .ymap 73, .ytyp 74, .ymt 11, .ymf 1 if matches!(e.ext_id, 1 | 11 | 73 | 74) { @@ -307,6 +338,7 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { let (mut ok, mut nested, mut plain, mut entries_total, mut failed, mut empty) = (0, 0, 0, 0usize, 0, 0); let mut textures_total = 0; let mut triangles_total = 0; + let (mut identical, mut unreadable) = (0, 0); for (_, t) in &tallies { for l in &t.lines { outln!("{l}"); @@ -321,6 +353,8 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { failed += t.failed; textures_total += t.textures; triangles_total += t.triangles; + identical += t.identical; + unreadable += t.unreadable; } if textures { outln!("\n{textures_total} textures decoded"); @@ -331,7 +365,13 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { if text { outln!("\n{textures_total} text tables read ({triangles_total} strings)"); } - if meta { + if meta && rebuild { + outln!( + "\n{textures_total} PSO files converted to XML and back: {identical} identical, {} with other bytes but \ + the same XML, {unreadable} not fully readable (skipped)", + textures_total - identical - unreadable + ); + } else if meta { outln!("\n{textures_total} metadata files converted ({triangles_total} parts not read)"); } if audio { diff --git a/crates/openrage-cli/src/cmd/verify.rs b/crates/openrage-cli/src/cmd/verify.rs index 093fc23..8a7bd45 100644 --- a/crates/openrage-cli/src/cmd/verify.rs +++ b/crates/openrage-cli/src/cmd/verify.rs @@ -817,6 +817,103 @@ pub(crate) fn cmd_verify_meta(game_dir: &Path, within: &str, keys: Option Result { + use rage_formats::pso; + let parse = |d: &[u8]| if rdr2 { pso::parse_rdr2(d) } else { pso::parse(d) }; + let original = parse(data).map_err(|e| e.to_string())?; + let (xml, problems) = original.to_xml_with_limit(1 << 30); + if !problems.is_empty() { + return Ok(PsoRoundTrip::Unreadable); + } + let written = original.from_xml(&xml).map_err(|e| format!("writing: {e}"))?; + if written == data { + return Ok(PsoRoundTrip::Identical); + } + let (again, problems) = parse(&written).map_err(|e| format!("reading back: {e}"))?.to_xml_with_limit(1 << 30); + if let Some(p) = problems.first() { + return Err(format!("reading back: {p}")); + } + if again != xml { + let line = xml.lines().zip(again.lines()).position(|(a, b)| a != b).unwrap_or(0); + let show = |t: &str| t.lines().nth(line).unwrap_or("(end)").trim().chars().take(120).collect::(); + return Err(format!("XML differs at line {}: {} → {}", line + 1, show(&xml), show(&again))); + } + Ok(PsoRoundTrip::SameXml) +} + +pub(crate) fn cmd_verify_pso_rebuild(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { + let starts = archive_roots(game_dir, within, keys)?; + let started = Instant::now(); + // Per archive: identical, same XML, unreadable, errors. + let all: Vec<(usize, usize, usize, Vec)> = starts + .par_iter() + .map(|(prefix, rpf, dir)| { + let (mut same, mut xml, mut unreadable, mut errors) = (0, 0, 0, Vec::new()); + let mut nested = Vec::new(); + vfs::walk( + rpf, + *dir, + prefix, + true, + &mut |a, id, p| { + let e = a.entry(id); + if e.is_dir() || e.is_archive() || e.resource_version().is_some() { + return; + } + if !openrage_app::metadata::is_metadata(&e.name) { + return; + } + let data = match a.read(id) { + Ok(d) => d, + Err(err) => return errors.push(format!("{p}: {err}")), + }; + if !rage_formats::pso::is_pso(&data) { + return; + } + match pso_round_trip(&data, false) { + Ok(PsoRoundTrip::Identical) => same += 1, + Ok(PsoRoundTrip::SameXml) => xml += 1, + Ok(PsoRoundTrip::Unreadable) => unreadable += 1, + Err(err) => errors.push(format!("{p}: {err}")), + } + }, + &mut |e| nested.push(e.to_string()), + ); + errors.extend(nested); + (same, xml, unreadable, errors) + }) + .collect(); + let same: usize = all.iter().map(|x| x.0).sum(); + let xml: usize = all.iter().map(|x| x.1).sum(); + let unreadable: usize = all.iter().map(|x| x.2).sum(); + let errors: Vec<&String> = all.iter().flat_map(|x| &x.3).collect(); + for e in errors.iter().take(40) { + outln!("FAIL {e}"); + } + outln!( + "{} PSO files: {same} identical, {xml} with other bytes but the same XML, {unreadable} not fully readable \ + (skipped), {} errors ({:.1}s)", + same + xml + unreadable + errors.len(), + errors.len(), + started.elapsed().as_secs_f32() + ); + if !errors.is_empty() { + bail!("{} PSO files do not convert back", errors.len()); + } + Ok(()) +} + pub(crate) fn hex(b: &[u8]) -> String { b.iter().map(|x| format!("{x:02x}")).collect::>().join(" ") } diff --git a/crates/openrage-cli/src/main.rs b/crates/openrage-cli/src/main.rs index e6a5d17..31fbe31 100644 --- a/crates/openrage-cli/src/main.rs +++ b/crates/openrage-cli/src/main.rs @@ -107,12 +107,17 @@ fn run() -> Result<()> { return Ok(()); } - if let Command::Rpf8 { path, list, textures, models, text, meta, audio, anims } = &cli.command { - return cmd_rpf8( - path, - *list, - Checks { textures: *textures, models: *models, texts: *text, meta: *meta, audio: *audio, anims: *anims }, - ); + if let Command::Rpf8 { path, list, textures, models, text, meta, rebuild, audio, anims } = &cli.command { + let checks = Checks { + textures: *textures, + models: *models, + texts: *text, + meta: *meta, + rebuild: *rebuild, + audio: *audio, + anims: *anims, + }; + return cmd_rpf8(path, *list, checks); } // Managing plugins needs no game; previews and actions use it when there is one. if let Command::Plugin(cmd) = &cli.command @@ -179,6 +184,7 @@ fn run() -> Result<()> { Command::Verify { path, particles: true, .. } => cmd_verify_particles(&game_dir, &path, keys), Command::Verify { path, text: true, .. } if gta4 => cmd_verify_gta4_text(&game_dir, &path), Command::Verify { path, text: true, .. } => cmd_verify_text(&game_dir, &path, keys), + Command::Verify { path, meta: true, rebuild: true, .. } => cmd_verify_pso_rebuild(&game_dir, &path, keys), Command::Verify { path, meta: true, .. } => cmd_verify_meta(&game_dir, &path, keys), Command::Verify { path, cutscenes: true, .. } if gta4 => cmd_verify_gta4_cutscenes(&game_dir, &path), Command::Verify { cutscenes: true, .. } => bail!("--cutscenes checks GTA IV cutscenes; this is not GTA IV"), diff --git a/crates/rage-formats/Cargo.toml b/crates/rage-formats/Cargo.toml index a70ff48..63b1c54 100644 --- a/crates/rage-formats/Cargo.toml +++ b/crates/rage-formats/Cargo.toml @@ -13,5 +13,6 @@ texture2ddecoder = "0.1" symphonia = { version = "0.6", default-features = false, features = ["mp3"] } lewton = { version = "0.10", default-features = false } thiserror.workspace = true +roxmltree.workspace = true flate2.workspace = true texpresso = { version = "2.0.2", features = ["rayon"] } diff --git a/crates/rage-formats/src/names.rs b/crates/rage-formats/src/names.rs index 54003f4..3718e55 100644 --- a/crates/rage-formats/src/names.rs +++ b/crates/rage-formats/src/names.rs @@ -82,6 +82,37 @@ pub fn value(hash: u32) -> String { lookup(hash, false).unwrap_or_else(|| format!("hash_{hash:08X}")) } +/// Built-in names to their hashes (a name listed under several hashes keeps the first). +fn builtin_reverse() -> &'static HashMap<&'static str, u32> { + static TABLE: OnceLock> = OnceLock::new(); + TABLE.get_or_init(|| { + let mut by_hash: Vec<(u32, &str)> = builtin().iter().map(|(h, n)| (*h, *n)).collect(); + by_hash.sort_unstable(); + let mut map = HashMap::new(); + for (h, n) in by_hash { + map.entry(n).or_insert(h); + } + map + }) +} + +/// The hash behind text written by [`value`]: `hash_XXXXXXXX`, a registered +/// or built-in name, or else the lowercase joaat of the text (how the games +/// hash asset names), so a new name typed into the XML gets its usual hash. +pub fn parse_value(text: &str) -> u32 { + if let Some(h) = text.strip_prefix("hash_").and_then(|h| u32::from_str_radix(h, 16).ok()) { + return h; + } + if text.is_empty() { + return 0; + } + let lower = joaat(text); + if extra().read().ok().is_some_and(|m| m.get(&lower).is_some_and(|n| n == text)) { + return lower; + } + builtin_reverse().get(text).copied().unwrap_or(lower) +} + /// The hash a name in the XML stands for (`hash_XXXXXXXX` or a name). pub fn parse(text: &str) -> u32 { match text.strip_prefix("hash_").and_then(|h| u32::from_str_radix(h, 16).ok()) { @@ -108,6 +139,10 @@ mod tests { assert_eq!(parse("hash_00000001"), 1); assert_eq!(parse("AABB"), jenkins_bytes(b"AABB")); assert_eq!(parse("adder"), 0xB779_A091); + for h in [jenkins_bytes(b"CMapData"), jenkins_bytes(b"aabb"), 0x1234_5678, 0] { + assert_eq!(parse_value(&value(h)), h); + } + assert_eq!(parse_value("adder"), 0xB779_A091); } #[test] diff --git a/crates/rage-formats/src/pso.rs b/crates/rage-formats/src/pso.rs index 91e0091..a17623f 100644 --- a/crates/rage-formats/src/pso.rs +++ b/crates/rage-formats/src/pso.rs @@ -7,8 +7,10 @@ //! (structure name, offset, unused, length). //! * `PSCH`: schema: count, (name, offset) index, then structure infos //! (`type<<24 | count`, length, unused, 12-byte entries: name, type, subtype, -//! offset u16, reference key) and enum infos (`type<<24 | count`, (name, value)). -//! * `STRF`, `STRS`, `STRE`, `PSIG`, `CHKS`: strings and checksums (not needed). +//! offset u16, reference key) and enum infos (`type<<24 | count`, (name, value); +//! RDR2 has 8 zero bytes between name and value). +//! * `STRF`, `STRS`, `STRE`, `PSIG`, `CHKS`: strings and checksums (not needed +//! to read; kept as they are when the file is written back, see [`Pso::from_xml`]). //! //! Pointers are 8 bytes; the first big-endian u32 holds the 1-based block //! (bits 0–11) and the offset (bits 12–31). @@ -20,6 +22,8 @@ use std::collections::HashMap; use crate::names; use crate::xml::{self, Writer}; +mod write; + pub const MAGIC: &[u8; 4] = b"PSIN"; const ARRAYINFO: u32 = 0x100; @@ -99,6 +103,11 @@ pub struct Pso { enums: HashMap>, /// Bit where the offset of a pointer starts: 12 (GTA V) or 20 (RDR2). offset_shift: u32, + /// Every section of the file as it was (ident and whole section), in order. + sections: Vec<([u8; 4], Vec)>, + /// Structures that describe the key/item pairs of maps (GTA V), with + /// their names; one per map type, all usually named `0x100`. + pairs: Vec<(u32, StructInfo)>, } pub fn is_pso(data: &[u8]) -> bool { @@ -170,6 +179,7 @@ fn parse_with(file: &[u8], offset_shift: u32) -> Result { let mut data = None; let mut map = None; let mut schema = None; + let mut sections = Vec::new(); let mut pos = 0; while pos + 8 <= file.len() { let ident: [u8; 4] = file[pos..pos + 4].try_into().unwrap_or_default(); @@ -178,6 +188,7 @@ fn parse_with(file: &[u8], offset_shift: u32) -> Result { return Err(err(format!("section {} has bad length {len}", String::from_utf8_lossy(&ident)))); } let section = &file[pos..pos + len]; + sections.push((ident, section.to_vec())); match &ident { b"PSIN" => data = Some(section), b"PMAP" => map = Some(section), @@ -209,6 +220,8 @@ fn parse_with(file: &[u8], offset_shift: u32) -> Result { let mut structs = HashMap::new(); let mut enums = HashMap::new(); + let mut pairs = Vec::new(); + let (key_name, item_name) = (names::parse("Key"), names::parse("Item")); let n = u32_at(schema, 8).map_err(err)? as usize; for i in 0..n.min(0x10000) { let name = u32_at(schema, 12 + i * 8).map_err(err)?; @@ -228,20 +241,26 @@ fn parse_with(file: &[u8], offset_shift: u32) -> Result { key: u32_at(schema, p + 8).map_err(err)?, }); } - structs.entry(name).or_insert(StructInfo { length, entries }); + let info = StructInfo { length, entries }; + if info.find(key_name).is_some() && info.find(item_name).is_some() { + pairs.push((name, info.clone())); + } + structs.entry(name).or_insert(info); } 1 => { + // GTA V: (name, value) pairs; RDR2: name, 8 zero bytes, value. + let (size, value_at) = if offset_shift == 20 { (16, 12) } else { (8, 4) }; let mut values = Vec::new(); for e in 0..(x & 0xFF_FFFF) as usize { - let p = off + 4 + e * 8; - values.push((u32_at(schema, p).map_err(err)?, u32_at(schema, p + 4).map_err(err)? as i32)); + let p = off + 4 + e * size; + values.push((u32_at(schema, p).map_err(err)?, u32_at(schema, p + value_at).map_err(err)? as i32)); } enums.entry(name).or_insert(values); } t => return Err(err(format!("unknown schema element type {t}"))), } } - Ok(Pso { data: data.to_vec(), root_block, blocks, structs, enums, offset_shift }) + Ok(Pso { data: data.to_vec(), root_block, blocks, structs, enums, offset_shift, sections, pairs }) } /// Parses a PSO file and writes it as XML (see [`Pso::to_xml`]). @@ -291,12 +310,12 @@ impl Pso { w.finish() } + /// The name of an enum value; a value the enum does not list as its number. fn enum_name(&self, key: u32, value: i32) -> String { self.enums .get(&key) .and_then(|v| v.iter().find(|(_, x)| *x == value)) - .map(|(n, _)| names::field(*n)) - .unwrap_or_default() + .map_or_else(|| value.to_string(), |(n, _)| names::field(*n)) } #[allow(clippy::too_many_arguments)] @@ -641,7 +660,7 @@ impl Pso { .map(|b| { let (id, off) = self.unpack(ptr_at(b, 0).unwrap_or(0)); let len = (item.sub == 3).then(|| u16::from_be_bytes([b[8], b[9]]) as usize); - xml::escape(&self.string_at(id, off, len).unwrap_or_default()) + self.string_at(id, off, len).unwrap_or_default() }) .collect(); w.item_array(level, ename, &v); diff --git a/crates/rage-formats/src/pso/write.rs b/crates/rage-formats/src/pso/write.rs new file mode 100644 index 0000000..e2fab34 --- /dev/null +++ b/crates/rage-formats/src/pso/write.rs @@ -0,0 +1,831 @@ +//! XML → PSO: builds the data of a PSO file from the XML [`Pso::to_xml`] +//! writes, using the structure and enum infos of the file it came from. +//! +//! The XML does not describe the layout, so the original file is the +//! template: its schema (`PSCH`) and the other sections are written back +//! unchanged, and only the data (`PSIN`) and its block map (`PMAP`) are +//! rebuilt. Like the game's own files, every block holds one type (a +//! structure, or characters, hashes, pointers, …); blocks keep the order the +//! original had, and inside a block the items follow in the order they are +//! met walking the XML depth first. A file read back unchanged therefore +//! comes out byte for byte the same in most cases. +//! +//! The checksum section (`CHKS`) covers the data by an unknown method; it is +//! kept when the data comes out unchanged and left out otherwise, as +//! CodeWalker does for the PSO files it writes. + +use std::collections::HashMap; + +use roxmltree::{Document, Node}; + +use super::{ARRAYINFO, Entry, Pso, PsoError, StructInfo, ty}; +use crate::names; + +type R = Result; + +/// Blocks of characters (strings), named after the data type, as the game's files do. +const CHARS: u32 = ty::SBYTE as u32; +/// Blocks of 8-byte structure pointers. +const POINTERS: u32 = ty::STRUCTURE as u32; +/// Blocks of 32-bit hashes and integers. +const UINTS: u32 = ty::UINT as u32; + +/// Blocks of counted string pointers (16 bytes each); the name is what the game's files use. +const COUNTED_STRINGS: u32 = 0xC8; + +/// Pointer offsets have 20 bits in GTA V's layout. +const MAX_OFFSET: usize = 1 << 20; + +struct Buf { + name: u32, + data: Vec, +} + +/// A pointer to patch once the blocks have their final numbers. +struct Fix { + block: usize, + at: usize, + target: usize, + offset: usize, +} + +struct Builder<'a> { + pso: &'a Pso, + /// Structure names as the XML writes them. + struct_names: HashMap, + /// Enum value names per enum. + enum_values: HashMap>, + blocks: Vec, + by_name: HashMap, + fixes: Vec, +} + +fn element_children<'a, 'i>(node: Node<'a, 'i>) -> impl Iterator> { + node.children().filter(Node::is_element) +} + +fn text(node: Node<'_, '_>) -> String { + node.children().filter(Node::is_text).filter_map(|t| t.text()).collect() +} + +fn attr<'a>(node: Node<'a, '_>, name: &str) -> R<&'a str> { + node.attribute(name).ok_or_else(|| format!("<{}> has no {name}", node.tag_name().name())) +} + +fn value<'a>(node: Node<'a, '_>) -> R<&'a str> { + attr(node, "value") +} + +/// An integer as the XML writes them: decimal (maybe negative) or `0x` hex. +fn int(s: &str) -> R { + let t = s.trim(); + let parsed = match t.strip_prefix("0x").or_else(|| t.strip_prefix("0X")) { + Some(hex) => i128::from_str_radix(hex, 16), + None => t.parse::(), + }; + parsed.map_err(|_| format!("\"{s}\" is not a number")) +} + +fn float(s: &str) -> R { + s.trim().parse::().map_err(|_| format!("\"{s}\" is not a number")) +} + +/// The numbers of a raw array (`1 2 3`, or vectors `1, 2, 3` one to a line). +fn tokens(node: Node<'_, '_>) -> Vec { + text(node).split(|c: char| c.is_whitespace() || c == ',').filter(|t| !t.is_empty()).map(str::to_owned).collect() +} + +fn vector(node: Node<'_, '_>, n: usize) -> R> { + ["x", "y", "z", "w"][..n].iter().map(|a| float(attr(node, a)?)).collect() +} + +/// Largest alignment an item of `size` bytes needs (at most 16). +fn align_of(size: usize) -> usize { + if size == 0 { 1 } else { (1 << size.trailing_zeros()).min(16) } +} + +impl<'a> Builder<'a> { + fn new(pso: &'a Pso) -> Self { + Builder { + pso, + struct_names: pso.structs.keys().map(|h| (names::field(*h), *h)).collect(), + enum_values: HashMap::new(), + blocks: Vec::new(), + by_name: HashMap::new(), + fixes: Vec::new(), + } + } + + fn is_rdr2(&self) -> bool { + self.pso.offset_shift == 20 + } + + /// Reserves `size` zero bytes in the block for `name`; returns (block, offset). + fn alloc(&mut self, name: u32, size: usize, align: usize) -> (usize, usize) { + let bi = *self.by_name.entry(name).or_insert_with(|| { + self.blocks.push(Buf { name, data: Vec::new() }); + self.blocks.len() - 1 + }); + let data = &mut self.blocks[bi].data; + let off = data.len().next_multiple_of(align.max(1)); + data.resize(off + size, 0); + (bi, off) + } + + fn put(&mut self, bi: usize, at: usize, bytes: &[u8]) -> R<()> { + let data = &mut self.blocks[bi].data; + let dst = data.get_mut(at..at + bytes.len()).ok_or_else(|| format!("write at {at:#x} beyond its block"))?; + dst.copy_from_slice(bytes); + Ok(()) + } + + fn pointer(&mut self, block: usize, at: usize, target: usize, offset: usize) { + self.fixes.push(Fix { block, at, target, offset }); + } + + fn struct_info(&self, hash: u32) -> R<&'a StructInfo> { + self.pso.structs.get(&hash).ok_or_else(|| format!("structure info {} not found", names::field(hash))) + } + + fn struct_named(&self, name: &str) -> R { + self.struct_names.get(name).copied().ok_or_else(|| format!("unknown structure type \"{name}\"")) + } + + fn enum_value(&mut self, key: u32, name: &str) -> R { + let pso = self.pso; + let values = self.enum_values.entry(key).or_insert_with(|| { + pso.enums.get(&key).map(|v| v.iter().map(|(n, x)| (names::field(*n), *x)).collect()).unwrap_or_default() + }); + match values.get(name.trim()) { + Some(v) => Ok(*v), + None if name.trim().is_empty() => Ok(0), + None => int(name).map(|v| v as i32).map_err(|_| format!("\"{name}\" is not a value of the enum")), + } + } + + /// A string's characters in the character block; returns (block, offset). + fn chars(&mut self, s: &str) -> (usize, usize) { + let (bi, off) = self.alloc(CHARS, s.len() + 1, 1); + self.blocks[bi].data[off..off + s.len()].copy_from_slice(s.as_bytes()); + (bi, off) + } + + /// A structure of type `hash` at `off` in block `bi`, its fields from `node`'s children. + fn structure(&mut self, bi: usize, off: usize, hash: u32, node: Node<'_, '_>, depth: usize) -> R<()> { + if depth > 64 { + return Err("structures nested too deeply".into()); + } + let info = self.struct_info(hash)?; + let mut fields: Vec<(String, Node<'_, '_>)> = + element_children(node).map(|c| (c.tag_name().name().to_owned(), c)).collect(); + if let Some((_, e)) = fields.iter().find(|(n, _)| n == "error") { + return Err(format!("the XML holds an error from reading the original: {}", text(*e))); + } + for entry in &info.entries { + if entry.name == ARRAYINFO { + continue; + } + let name = names::field(entry.name); + let Some(i) = fields.iter().position(|(n, _)| *n == name) else { continue }; + let (_, child) = fields.remove(i); + self.entry(bi, off, entry, info, child, depth).map_err(|e| format!("{name}: {e}"))?; + } + match fields.first() { + Some((n, _)) => Err(format!("{} has no field {n}", names::field(hash))), + None => Ok(()), + } + } + + /// One field of a structure at `base` in block `bi`. + fn entry( + &mut self, + bi: usize, + base: usize, + e: &Entry, + info: &StructInfo, + node: Node<'_, '_>, + depth: usize, + ) -> R<()> { + let at = base + e.offset; + match e.kind { + ty::ARRAY => self.array(bi, base, e, info, node, depth)?, + ty::BOOL => { + let v = match value(node)? { + "true" | "True" | "1" => 1u8, + "false" | "False" | "0" => 0, + other => return Err(format!("\"{other}\" is not true or false")), + }; + self.put(bi, at, &[v])?; + } + ty::SBYTE | ty::UBYTE => self.put(bi, at, &[int(value(node)?)? as u8])?, + ty::SSHORT | ty::USHORT | ty::HFLOAT => self.put(bi, at, &(int(value(node)?)? as u16).to_be_bytes())?, + ty::SINT | ty::UINT => self.put(bi, at, &(int(value(node)?)? as u32).to_be_bytes())?, + ty::LONG | ty::ULONG => self.put(bi, at, &(int(value(node)?)? as u64).to_be_bytes())?, + ty::ENUM => { + let sub = if self.is_rdr2() { e.sub.saturating_sub(1) } else { e.sub }; + let v = self.enum_value(e.key, &text(node))?; + match sub { + 0 => self.put(bi, at, &(v as u32).to_be_bytes())?, + 1 => self.put(bi, at, &(v as u16).to_be_bytes())?, + 2 => self.put(bi, at, &[v as u8])?, + s => return Err(format!("unexpected enum subtype {s}")), + } + } + ty::FLAGS => self.flags(bi, at, e, info, node)?, + ty::FLOAT => self.put(bi, at, &float(value(node)?)?.to_be_bytes())?, + ty::FLOAT2 => self.floats(bi, at, &vector(node, 2)?)?, + ty::FLOAT3 | ty::FLOAT3A | ty::FLOAT4A => self.floats(bi, at, &vector(node, 3)?)?, + ty::FLOAT4 | ty::VEC4V => self.floats(bi, at, &vector(node, 4)?)?, + ty::MATRIX44 => { + let v: Vec = tokens(node).iter().map(|t| float(t)).collect::>()?; + if v.len() != 16 { + return Err(format!("a matrix needs 16 numbers, not {}", v.len())); + } + self.floats(bi, at, &v)?; + } + ty::STRING => self.string(bi, at, e, &text(node))?, + ty::STRUCTURE => match e.sub { + 0 => self.structure(bi, at, e.key, node, depth + 1)?, + 3 | 4 => { + if let Some(t) = node.attribute("type") { + let actual = self.struct_named(t)?; + let len = self.struct_info(actual)?.length; + let (pb, poff) = self.alloc(actual, len, align_of(len)); + self.pointer(bi, at, pb, poff); + self.structure(pb, poff, actual, node, depth + 1)?; + } + } + s => return Err(format!("unexpected structure subtype {s}")), + }, + ty::OPAQUE16 => { + let hex = value(node)?; + let bytes: Vec = (0..16) + .map(|i| hex.get(i * 2..i * 2 + 2).and_then(|b| u8::from_str_radix(b, 16).ok())) + .collect::>() + .ok_or_else(|| format!("\"{hex}\" is not 16 bytes of hex"))?; + self.put(bi, at, &bytes)?; + } + ty::MAP => self.map(bi, at, e, info, node, depth)?, + other => return Err(format!("unexpected data type {other:#04x}")), + } + Ok(()) + } + + /// A map, mirroring [`Pso::map_node`]: a header (`0x01000000`, pointer + /// to the pairs, count, capacity) and the key/item pairs in a block. + fn map(&mut self, bi: usize, at: usize, e: &Entry, info: &StructInfo, node: Node<'_, '_>, depth: usize) -> R<()> { + if e.sub != 1 { + return Err(format!("unexpected map subtype {}", e.sub)); + } + let key_info = *info.entries.get((e.key >> 16) as usize & 0xFFF).ok_or("map Key entry missing")?; + let item_info = *info.entries.get(e.key as usize & 0xFFF).ok_or("map Item entry missing")?; + self.put(bi, at, &[1])?; + let items: Vec<_> = element_children(node).collect(); + let count = + u16::try_from(items.len()).map_err(|_| format!("{} pairs are more than a map holds", items.len()))?; + self.put(bi, at + 16, &count.to_be_bytes())?; + self.put(bi, at + 18, &count.to_be_bytes())?; + if items.is_empty() { + return Ok(()); + } + // GTA V: the pairs are a structure with Key and Item fields, named + // after the block that holds them. RDR2: key at 0 (padded to 8), item at 8. + let same = |a: &Entry, b: &Entry| a.kind == b.kind && a.sub == b.sub && a.key == b.key; + let (key_name, item_name) = (names::parse("Key"), names::parse("Item")); + let pair = self.pso.pairs.iter().find(|(_, st)| { + st.find(key_name).is_some_and(|k| same(k, &key_info)) + && st.find(item_name).is_some_and(|i| same(i, &item_info)) + }); + let (block_name, key_entry, item_entry, pair_len) = match pair { + Some((name, st)) => { + (*name, *st.find(key_name).expect("found"), *st.find(item_name).expect("found"), st.length) + } + None if self.is_rdr2() => { + let item_size = match (item_info.kind, item_info.sub) { + (ty::STRUCTURE, 0) => self.struct_info(item_info.key)?.length, + (ty::STRING, 7 | 8) | (ty::UINT | ty::SINT | ty::ENUM | ty::FLOAT, _) => 4, + _ => 8, + }; + ( + ARRAYINFO, + Entry { offset: 0, ..key_info }, + Entry { offset: 8, ..item_info }, + (8 + item_size).next_multiple_of(8), + ) + } + None => return Err("no structure describes the pairs of this map".into()), + }; + let (pb, poff) = self.alloc(block_name, items.len() * pair_len, align_of(pair_len)); + self.pointer(bi, at + 8, pb, poff); + for (i, child) in items.into_iter().enumerate() { + let base = poff + i * pair_len; + let key = attr(child, "key")?; + let key_at = base + key_entry.offset; + match key_entry.kind { + ty::STRING => self.string(pb, key_at, &key_entry, key)?, + ty::ENUM | ty::UINT | ty::SINT => self.put(pb, key_at, &names::parse_value(key).to_be_bytes())?, + _ => self.put(pb, key_at, &(int(key)? as u32).to_be_bytes())?, + } + match item_entry.kind { + ty::STRING => self.string(pb, base + item_entry.offset, &item_entry, &text(child))?, + ty::STRUCTURE if item_entry.key != 0 && item_entry.sub != 3 => { + self.structure(pb, base + item_entry.offset, item_entry.key, child, depth + 1)?; + } + ty::STRUCTURE => { + let actual = self.struct_named(attr(child, "type")?)?; + let len = self.struct_info(actual)?.length; + let (sb, soff) = self.alloc(actual, len, align_of(len)); + self.pointer(pb, base + item_entry.offset, sb, soff); + self.structure(sb, soff, actual, child, depth + 1)?; + } + _ => { + let v = element_children(child) + .find(|c| c.tag_name().name() == "Value") + .ok_or("map item without Value")?; + self.entry(pb, base, &item_entry, info, v, depth + 1)?; + } + } + } + Ok(()) + } + + fn floats(&mut self, bi: usize, at: usize, v: &[f32]) -> R<()> { + let bytes: Vec = v.iter().flat_map(|f| f.to_be_bytes()).collect(); + self.put(bi, at, &bytes) + } + + fn flags(&mut self, bi: usize, at: usize, e: &Entry, info: &StructInfo, node: Node<'_, '_>) -> R<()> { + let index = (e.key & 0xFFF) as usize; + let flags = (index != 0xFFF) + .then(|| info.entries.get(index)) + .flatten() + .filter(|x| x.name == ARRAYINFO) + .and_then(|x| self.pso.enums.get(&x.key)); + let n_words = match e.sub { + 0..=2 => 1, + 4 => ((e.key >> 16).clamp(1, 4096) as usize).div_ceil(32), + s => return Err(format!("unexpected flags subtype {s}")), + }; + let mut words = vec![0u32; n_words]; + let content = node.attribute("value").map(str::to_owned).unwrap_or_else(|| text(node)); + match flags { + Some(values) => { + // The reader joins the names of the set bits in the enum's + // order with single spaces (unnamed values give empty names): + // matched in that order, whatever it wrote comes back exactly. + // Other text (edited by hand) is taken name by name. + let bit_of = |bit: i32| usize::try_from(bit).ok().filter(|b| b / 32 < n_words); + let mut tokens = content.split(' ').peekable(); + for (n, bit) in values { + if let Some(b) = bit_of(*bit) + && tokens.peek().is_some_and(|t| *t == names::field(*n)) + { + words[b / 32] |= 1 << (b % 32); + tokens.next(); + } + } + if tokens.next().is_some() || content.is_empty() { + words.iter_mut().for_each(|w| *w = 0); + for name in content.split_whitespace() { + let b = values + .iter() + .find(|(n, _)| names::field(*n) == name) + .and_then(|(_, bit)| bit_of(*bit)) + .ok_or_else(|| format!("\"{name}\" is not a flag of this field"))?; + words[b / 32] |= 1 << (b % 32); + } + } + } + None if content.trim().is_empty() => {} + None if n_words == 1 => words[0] = int(&content)? as u32, + None => { + for (w, hex) in words.iter_mut().zip(content.split_whitespace()) { + *w = u32::from_str_radix(hex, 16).map_err(|_| format!("\"{hex}\" is not hex"))?; + } + } + } + match e.sub { + 0 => self.put(bi, at, &words[0].to_be_bytes()), + 1 => self.put(bi, at, &(words[0] as u16).to_be_bytes()), + 2 => self.put(bi, at, &[words[0] as u8]), + _ => { + let bytes: Vec = words.iter().flat_map(|w| w.to_be_bytes()).collect(); + self.put(bi, at, &bytes) + } + } + } + + fn string(&mut self, bi: usize, at: usize, e: &Entry, s: &str) -> R<()> { + match e.sub { + 0 => { + let n = (e.key >> 16) as usize; + if s.len() > n { + return Err(format!("\"{s}\" is longer than the {n} bytes the field holds")); + } + self.put(bi, at, s.as_bytes()) + } + 1 => { + if !s.is_empty() { + let (cb, coff) = self.chars(s); + self.pointer(bi, at, cb, coff); + } + Ok(()) + } + 2 => { + { + // Empty strings point at a terminator, as in the game's files. + let (cb, coff) = self.chars(s); + self.pointer(bi, at, cb, coff); + } + Ok(()) + } + 3 => self.counted_string(bi, at, s), + 7..=15 => self.put(bi, at, &names::parse_value(s.trim()).to_be_bytes()), + s => Err(format!("unexpected string subtype {s}")), + } + } + + /// A string pointer followed by its length and size with the terminator (16 bytes). + fn counted_string(&mut self, bi: usize, at: usize, s: &str) -> R<()> { + if s.is_empty() { + return Ok(()); + } + let n = u16::try_from(s.len()).map_err(|_| "string too long".to_owned())?; + let (cb, coff) = self.chars(s); + self.pointer(bi, at, cb, coff); + // GTA V mostly writes the size first, RDR2 the length. + let (first, second) = if self.is_rdr2() { (n, n + 1) } else { (n + 1, n) }; + self.put(bi, at + 8, &first.to_be_bytes())?; + self.put(bi, at + 10, &second.to_be_bytes()) + } + + /// An array field, mirroring how [`Pso::array_node`] reads it. + fn array( + &mut self, + bi: usize, + base: usize, + e: &Entry, + info: &StructInfo, + node: Node<'_, '_>, + depth: usize, + ) -> R<()> { + let at = base + e.offset; + let mut index = (e.key & 0xFFFF) as usize; + if index >= info.entries.len() { + index = (e.key & 0xFFF) as usize; + } + let item = *info.entries.get(index).ok_or("ARRAYINFO not found")?; + let external = + matches!(e.sub, 0 | 5) || (e.sub == 4 && item.sub == 3) || matches!(item.kind, ty::STRING | ty::ENUM); + if !external && !matches!(e.sub, 1 | 2 | 4 | 129) { + return Err(format!("unsupported array subtype {}", e.sub)); + } + if item.kind == ty::ARRAY { + let n = (e.key >> 16) as usize; + let items: Vec<_> = element_children(node).collect(); + if items.len() > n { + return Err(format!("{} arrays where the structure holds {n}", items.len())); + } + for (i, child) in items.into_iter().enumerate() { + let inner = Entry { offset: 0, ..item }; + self.array(bi, at + i * 16, &inner, info, child, depth + 1)?; + } + return Ok(()); + } + let count = match item.kind { + ty::STRUCTURE | ty::STRING | ty::ENUM => element_children(node).count(), + ty::FLOAT2 => tokens(node).len().div_ceil(2), + ty::FLOAT3 | ty::FLOAT3A => tokens(node).len().div_ceil(3), + ty::FLOAT4 | ty::FLOAT4A | ty::VEC4V => tokens(node).len().div_ceil(4), + _ => tokens(node).len(), + }; + if count == 0 { + // Empty: no storage, and the item type may not even be in the schema. + if external { + self.put(bi, at + 8, &[0; 4])?; + } + return Ok(()); + } + // Item size and the block name of external storage. + let (size, block_name) = match (item.kind, item.sub) { + (ty::STRUCTURE, 3 | 4) => (8, POINTERS), + (ty::STRUCTURE, _) => (self.struct_info(item.key)?.length, item.key), + (ty::STRING, 7..=15) => (4, UINTS), + (ty::STRING, 2) => (8, POINTERS), + (ty::STRING, 3) => (16, COUNTED_STRINGS), + (ty::STRING, s) => return Err(format!("unexpected string array subtype {s}")), + (ty::FLOAT2, _) => (8, ty::FLOAT2 as u32), + (ty::FLOAT3 | ty::FLOAT3A | ty::FLOAT4 | ty::FLOAT4A | ty::VEC4V, _) => (16, item.kind as u32), + (ty::LONG | ty::ULONG, _) => (8, item.kind as u32), + (ty::SBYTE | ty::UBYTE | ty::BOOL, _) => (1, item.kind as u32), + (ty::USHORT, _) => (2, item.kind as u32), + (ty::FLOAT | ty::UINT | ty::SINT, _) => (4, item.kind as u32), + (ty::ENUM, _) => (4, UINTS), + (other, _) => return Err(format!("unsupported array item type {other:#04x}")), + }; + // Where the items go: (block, offset). + let (ab, aoff) = if external { + let n = u16::try_from(count).map_err(|_| format!("{count} items are more than an array holds"))?; + self.put(bi, at + 8, &n.to_be_bytes())?; + self.put(bi, at + 10, &n.to_be_bytes())?; + let (ab, aoff) = self.alloc(block_name, count * size, align_of(size)); + self.pointer(bi, at, ab, aoff); + (ab, aoff) + } else { + let n = (e.key >> 16) as usize; + if count > n { + return Err(format!("{count} items where the structure holds {n}")); + } + (bi, at) + }; + match item.kind { + ty::STRUCTURE if matches!(item.sub, 3 | 4) => { + for (i, child) in element_children(node).enumerate() { + if let Some(t) = child.attribute("type") { + let actual = self.struct_named(t)?; + let len = self.struct_info(actual)?.length; + let (pb, poff) = self.alloc(actual, len, align_of(len)); + self.pointer(ab, aoff + i * 8, pb, poff); + self.structure(pb, poff, actual, child, depth + 1)?; + } + } + } + ty::STRUCTURE => { + for (i, child) in element_children(node).enumerate() { + self.structure(ab, aoff + i * size, item.key, child, depth + 1)?; + } + } + ty::STRING => { + for (i, child) in element_children(node).enumerate() { + let s = text(child); + let p = aoff + i * size; + if item.sub >= 7 { + self.put(ab, p, &names::parse_value(s.trim()).to_be_bytes())?; + } else if item.sub == 3 { + self.counted_string(ab, p, &s)?; + } else if !s.is_empty() { + let (cb, coff) = self.chars(&s); + self.pointer(ab, p, cb, coff); + } + } + } + ty::ENUM => { + for (i, child) in element_children(node).enumerate() { + let v = self.enum_value(item.key, &text(child))?; + self.put(ab, aoff + i * 4, &(v as u32).to_be_bytes())?; + } + } + ty::FLOAT2 | ty::FLOAT3 | ty::FLOAT3A | ty::FLOAT4 | ty::FLOAT4A | ty::VEC4V | ty::FLOAT => { + let per = match item.kind { + ty::FLOAT => 1, + ty::FLOAT2 => 2, + ty::FLOAT3 | ty::FLOAT3A => 3, + _ => 4, + }; + for (i, t) in tokens(node).iter().enumerate() { + let p = aoff + (i / per) * size + (i % per) * 4; + self.put(ab, p, &float(t)?.to_be_bytes())?; + } + } + _ => { + for (i, t) in tokens(node).iter().enumerate() { + let v = int(t)?; + let p = aoff + i * size; + match size { + 1 => self.put(ab, p, &[v as u8])?, + 2 => self.put(ab, p, &(v as u16).to_be_bytes())?, + 4 => self.put(ab, p, &(v as u32).to_be_bytes())?, + _ => self.put(ab, p, &(v as u64).to_be_bytes())?, + } + } + } + } + Ok(()) + } + + fn encode_pointer(&self, id: usize, offset: usize) -> R<[u8; 8]> { + if id > 0xFFF { + return Err(format!("{id} blocks are more than pointers can address")); + } + let mut out = [0u8; 8]; + if self.is_rdr2() { + if offset >= 1 << 28 { + return Err(format!("offset {offset:#x} is beyond what pointers can address")); + } + let word = id as u32 | ((offset as u32 & 0xFFF) << 20); + out[..4].copy_from_slice(&word.to_be_bytes()); + out[4..6].copy_from_slice(&((offset >> 12) as u16).to_le_bytes()); + } else { + if offset >= MAX_OFFSET { + return Err(format!("a block of over {} MB cannot be addressed", MAX_OFFSET >> 20)); + } + out[..4].copy_from_slice(&(id as u32 | (offset as u32) << 12).to_be_bytes()); + } + Ok(out) + } + + /// Puts the blocks in order, resolves pointers and assembles the file. + fn finish(mut self, root: usize) -> R> { + let pso = self.pso; + // Blocks keep the original's order; new types follow. + let rank = |name: u32| pso.blocks.iter().position(|b| b.name == name).unwrap_or(usize::MAX); + let mut order: Vec = (0..self.blocks.len()).collect(); + order.sort_by_key(|&i| (rank(self.blocks[i].name), i)); + let mut id = vec![0usize; self.blocks.len()]; + for (n, &i) in order.iter().enumerate() { + id[i] = n + 1; + } + for f in std::mem::take(&mut self.fixes) { + let p = self.encode_pointer(id[f.target], f.offset)?; + self.put(f.block, f.at, &p)?; + } + if order.len() > 0x7FFF { + return Err(format!("{} blocks are more than a block map holds", order.len())); + } + let mut psin = b"PSIN\0\0\0\0pppppppp".to_vec(); + let mut map = Vec::with_capacity(16 * order.len()); + for &i in &order { + let b = &self.blocks[i]; + psin.resize(psin.len().next_multiple_of(16), b'p'); + map.extend_from_slice(&b.name.to_be_bytes()); + map.extend_from_slice(&(psin.len() as u32).to_be_bytes()); + map.extend_from_slice(&0u32.to_be_bytes()); + map.extend_from_slice(&(b.data.len() as u32).to_be_bytes()); + psin.extend_from_slice(&b.data); + } + let len = u32::try_from(psin.len()).map_err(|_| "the data is over 4 GB".to_owned())?; + psin[4..8].copy_from_slice(&len.to_be_bytes()); + let mut pmap = b"PMAP".to_vec(); + let header = if self.is_rdr2() { 24 } else { 16 }; + pmap.extend_from_slice(&((header + map.len()) as u32).to_be_bytes()); + pmap.extend_from_slice(&(id[root] as u32).to_be_bytes()); + let count = (order.len() as u16).to_be_bytes(); + if self.is_rdr2() { + // RDR2: no count at 12, the count at 16 and the blocks from 24. + pmap.extend_from_slice(&[0; 4]); + pmap.extend_from_slice(&count); + pmap.extend_from_slice(b"pppppp"); + } else { + pmap.extend_from_slice(&count); + pmap.extend_from_slice(b"pp"); + } + pmap.extend_from_slice(&map); + + let same = pso.sections.iter().all(|(ident, s)| match ident { + b"PSIN" => *s == psin, + b"PMAP" => *s == pmap, + _ => true, + }); + let mut out = Vec::with_capacity(psin.len() + pmap.len() + 4096); + for (ident, s) in &pso.sections { + match ident { + b"PSIN" => out.extend_from_slice(&psin), + b"PMAP" => out.extend_from_slice(&pmap), + b"CHKS" if !same => {} + _ => out.extend_from_slice(s), + } + } + Ok(out) + } +} + +/// Builds a PSO file from XML in the form [`Pso::to_xml`] writes, with the +/// schema and the other sections of `template` (the file the XML came from). +pub(super) fn from_xml(template: &Pso, xml: &str) -> Result, PsoError> { + let err = PsoError::Invalid; + let doc = Document::parse(xml).map_err(|e| err(format!("the XML cannot be read: {e}")))?; + let root = doc.root_element(); + let root_block = template.block(template.root_block).ok_or_else(|| err("the original has no root block".into()))?; + let root_name = names::field(root_block.name); + if root.tag_name().name() != root_name { + return Err(err(format!("the root element is <{}>, the file needs <{root_name}>", root.tag_name().name()))); + } + let mut b = Builder::new(template); + let len = b.struct_info(root_block.name).map_err(err)?.length; + let (bi, off) = b.alloc(root_block.name, len, align_of(len)); + b.structure(bi, off, root_block.name, root, 0).map_err(err)?; + b.finish(bi).map_err(err) +} + +impl Pso { + /// Builds a PSO file from XML as [`Pso::to_xml`] writes it, keeping this + /// file's schema: the way to write back an edited copy of this file. + pub fn from_xml(&self, xml: &str) -> Result, PsoError> { + from_xml(self, xml) + } +} + +#[cfg(test)] +mod tests { + use rage_core::hash::{jenkins_bytes, joaat}; + + use super::super::{parse, parse_rdr2}; + + fn h(name: &str) -> u32 { + jenkins_bytes(name.as_bytes()) + } + + /// A PSO file with a list of two items (a hash and a float each), laid + /// out like the game's: items in block 1, the root in block 2. + fn tiny() -> Vec { + let (root, item) = (h("CPedModelInfo__InitDataList"), h("CPedModelInfo__InitData")); + let mut items = Vec::new(); + for (name, radius) in [("adder", 1.5f32), ("banshee", -2.0)] { + items.extend(joaat(name).to_be_bytes()); + items.extend(radius.to_be_bytes()); + } + let mut root_data = 1u32.to_be_bytes().to_vec(); // block 1, offset 0 + root_data.extend([0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0]); + let mut psin = b"PSIN\0\0\0\0pppppppp".to_vec(); + psin.extend(&items); + psin.extend(&root_data); + let len = psin.len() as u32; + psin[4..8].copy_from_slice(&len.to_be_bytes()); + let mut pmap = b"PMAP".to_vec(); + pmap.extend(48u32.to_be_bytes()); + pmap.extend(2u32.to_be_bytes()); + pmap.extend([0, 2, b'p', b'p']); + for (name, off, len) in [(item, 16u32, 16u32), (root, 32, 16)] { + for v in [name, off, 0, len] { + pmap.extend(v.to_be_bytes()); + } + } + let entry = |name: u32, kind: u8, sub: u8, offset: u16, key: u32| { + let mut e = name.to_be_bytes().to_vec(); + e.extend([kind, sub]); + e.extend(offset.to_be_bytes()); + e.extend(key.to_be_bytes()); + e + }; + let structure = |length: u32, entries: Vec>| { + let mut s = (entries.len() as u32).to_be_bytes().to_vec(); + s.extend(length.to_be_bytes()); + s.extend(0u32.to_be_bytes()); + s.extend(entries.concat()); + s + }; + let root_info = structure(16, vec![entry(0x100, 0x0c, 0, 0, item), entry(h("InitDatas"), 0x0d, 0, 0, 0)]); + let item_info = structure(8, vec![entry(h("Name"), 0x0b, 7, 0, 0), entry(h("Radius"), 0x07, 0, 4, 0)]); + let index_len = 12 + 2 * 8; + let mut psch = b"PSCH".to_vec(); + psch.extend(((index_len + root_info.len() + item_info.len()) as u32).to_be_bytes()); + psch.extend(2u32.to_be_bytes()); + psch.extend(root.to_be_bytes()); + psch.extend((index_len as u32).to_be_bytes()); + psch.extend(item.to_be_bytes()); + psch.extend(((index_len + root_info.len()) as u32).to_be_bytes()); + psch.extend(root_info); + psch.extend(item_info); + [psin, pmap, psch].concat() + } + + #[test] + fn writes_back_the_same_bytes() { + let file = tiny(); + let pso = parse(&file).unwrap(); + let (xml, errors) = pso.to_xml(); + assert!(errors.is_empty(), "{errors:?}"); + assert!(xml.contains("adder") || xml.contains("hash_"), "{xml}"); + assert!(xml.contains(""), "{xml}"); + assert_eq!(pso.from_xml(&xml).unwrap(), file); + } + + #[test] + fn writes_edits() { + let pso = parse(&tiny()).unwrap(); + let (xml, _) = pso.to_xml(); + let edited = xml.replace("", "").replace( + " ", + " \n zentorno\n \n \n ", + ); + assert_ne!(edited, xml); + let written = pso.from_xml(&edited).unwrap(); + let (again, errors) = parse(&written).unwrap().to_xml(); + assert!(errors.is_empty(), "{errors:?}"); + assert_eq!(again, edited.replace("zentorno", &crate::names::value(joaat("zentorno")))); + assert!(again.contains("")); + } + + #[test] + fn refuses_what_does_not_fit() { + let pso = parse(&tiny()).unwrap(); + let (xml, _) = pso.to_xml(); + let unknown = xml.replace("", "\n "); + assert!(pso.from_xml(&unknown).unwrap_err().to_string().contains("no field Speed")); + assert!(pso.from_xml(&xml.replace("value=\"1.5\"", "value=\"fast\"")).is_err()); + assert!(pso.from_xml("").is_err()); + assert!(pso.from_xml("not xml").is_err()); + } + + #[test] + fn rdr2_layout() { + // The same file read as RDR2's reads the same; written back it uses RDR2's block map. + let pso = parse_rdr2(&tiny()).unwrap(); + let (xml, _) = pso.to_xml(); + let written = pso.from_xml(&xml).unwrap(); + let again = parse_rdr2(&written).unwrap(); + assert_eq!(again.to_xml().0, xml); + let pmap = written.windows(4).position(|w| w == b"PMAP").unwrap(); + assert_eq!(&written[pmap + 12..pmap + 18], &[0, 0, 0, 0, 0, 2]); + } +} diff --git a/site/content/_index.md b/site/content/_index.md index 26b4991..99e6500 100644 --- a/site/content/_index.md +++ b/site/content/_index.md @@ -305,7 +305,7 @@ Every format is verified against the complete game (GTA V Enhanced): | Models (`.ydr`, `.yft`, `.ydd`) | 168,779 models | all load (583 million triangles) | | Audio (`.awc`) | 7,758 containers, 252,742 sounds | all decode (279.8 hours) | | Animations (`.ycd`) | 25,961 dictionaries, 332,771 clips | all evaluate | -| Metadata (`.ymap`, `.ytyp`, `.ymt`, `.ymf`, `.cut`, `.pso`) | 30,280 files | all convert to XML | +| Metadata (`.ymap`, `.ytyp`, `.ymt`, `.ymf`, `.cut`, `.pso`) | 30,280 files | all convert to XML; all 4,943 PSO files convert back (3,973 byte-identical, the rest to the same XML) | | Text tables (`.gxt2`, `.nametable`) | 19,858 files, 9.16 million strings | text → binary is byte-identical | | Particles (`.ypt`) | 1,544 dictionaries, 12,987 effects | all read, incl. 1,694 textures and 1,223 models | | Collisions (`.ybn`) | 14,692 files, 70,454 bounds | all read (101 million triangles, 4.7 million shapes) | diff --git a/site/content/cli.md b/site/content/cli.md index 9f61019..32742b3 100644 --- a/site/content/cli.md +++ b/site/content/cli.md @@ -94,6 +94,7 @@ openrage rdr2-names # find RDR2 file names in the gam openrage rpf8 --list /common_0.rpf # RDR2 archive contents openrage rpf8 --text # read every RDR2 text table (.yldb) openrage rpf8 --meta # convert all RDR2 metadata (.ymap, .ytyp, .ymt, .ymf) to XML +openrage rpf8 --meta --rebuild # every RDR2 PSO file → XML → PSO, compared openrage rpf8 --audio /x64/audio # decode every RDR2 sound openrage rpf8 --anims /anim_0.rpf # read every RDR2 clip dictionary openrage --game rdr2-ped # list the RDR2 peds (people and animals) with their base skeletons @@ -175,6 +176,7 @@ openrage verify --models --rebuild # write every Enhanced .ydr anew openrage verify --audio # decode every sound of the game openrage verify --animations # parse every clip dictionary, evaluate all frames openrage verify --meta # convert every metadata file of the game +openrage verify --meta --rebuild # every PSO file → XML → PSO, same bytes or at least the same XML openrage verify --text # every .gxt2/.nametable → text → back, identical openrage verify --particles # parse every particle dictionary openrage verify --collisions # build the meshes of every collision file diff --git a/site/content/modding.md b/site/content/modding.md index 3ee6882..db8357f 100644 --- a/site/content/modding.md +++ b/site/content/modding.md @@ -145,6 +145,15 @@ Packages of format 2.x: | Archives | new archives and DLC packs (`createIfNotExist`) | | Text edits | `add`, `insert`, `replace`, `delete` with Equal, StartWith or Mask | | XML edits | by XPath: `add` (First, Last, Before, After), `replace`, `remove`, keeping the formatting | +| PSO edits | ``: binary metadata (`.ymt`, `.ymf`, `.ytyp`, … in PSO form) is converted to XML, edited with the same commands as ``, and written back as PSO | + +PSO edits work on the XML OpenRAGE shows for the file (**View as XML**, `openrage xml`), the same as CodeWalker's: +hashes appear as their names where the name is known, otherwise as `hash_XXXXXXXX`; names that an XPath compares with +(`Item[modelName = 'adder']`) are always recognised. The file keeps its own structure definitions, so the edit can +change values and add or remove items, but not invent fields the file's structures do not have; the preview says so +before anything is written. Written back unchanged, 80% of GTA V's PSO files come out byte for byte the same and every +one reads back to the same XML (`openrage verify --meta --rebuild`); the rest differ only in bytes the XML does not +carry, such as the unused fourth number of a 3D vector. ### Uninstalling @@ -152,7 +161,8 @@ Every installed package can be **uninstalled** from **History** (or `openrage oi ### Not supported yet -`` edits: such packages are refused with an explanation. `` is skipped, as it only saves disk space. +`` edits of metadata in resource form (`RSC7` `.ymt` files such as ped variations) are refused with an +explanation; only PSO files can be edited that way. `` is skipped, as it only saves disk space. ## ASI mods (GTA V) From dda1f9f5d56e745b7f13f9cb181e326ec9f86ae7 Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 22:06:10 +0100 Subject: [PATCH 2/8] RDR2 editing: RPF8 writer, changes into LML's lml/replace folder (#140) * RDR2 editing: RPF8 writer, changes into LML's lml/replace folder Red Dead Redemption 2 becomes editable the way GTA V is, never touching the game's archives: - rage-rpf: Rpf8Editor edits an RPF8 archive in place (append data, rewrite the header and a plain-text entry table, relocate entries a grown table covers, keep untouched entries' stored bytes and the signature block), with a Backup for exact undo. Entries keep bits OpenRAGE does not interpret. Resources go in and out as RSC8 files. - rage-mods: RDR2's overlay is Lenny's Mod Loader's lml/replace folder, where / replaces inside .rpf; resolve, scan and the change list map between the two. - openrage-app: changes to files in a game archive become loose files in lml/replace; changes inside nested archives copy that archive there once and edit it with the RPF8 writer. Journal, undo, names of new entries (lml/replace/.openrage/names.txt), x64/ name forms, RDR2 textures replaced in place (same shape), Extract saves resources as RSC8. - GUI: edit mode (Import/Replace/Rename/Delete, texture Replace) in RDR2 archives, overlay marks for lml/replace. - CLI: put/rm/mv/undo work on RDR2; `verify --rebuild` edits a copy of every archive, reads it back, undoes and checks the bytes. - Docs: rdr2.md "Changing files", modding.md, README status. Co-Authored-By: Claude Opus 5.5 * RDR2 docs: numbers from a full verify --rebuild Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- README.md | 4 +- crates/openrage-app/src/extract.rs | 5 +- crates/openrage-app/src/install.rs | 12 +- crates/openrage-app/src/lib.rs | 1 + crates/openrage-app/src/rdr2.rs | 17 +- crates/openrage-app/src/rdr2_install.rs | 349 ++++++++++++++++ crates/openrage-app/src/textures.rs | 29 ++ crates/openrage-cli/src/cli.rs | 3 + crates/openrage-cli/src/cmd/edit.rs | 8 +- crates/openrage-cli/src/cmd/mod.rs | 2 + crates/openrage-cli/src/cmd/verify_rdr2.rs | 320 +++++++++++++++ crates/openrage-cli/src/main.rs | 8 +- crates/openrage-gui/src/archive_ops.rs | 4 +- crates/openrage-gui/src/browser.rs | 52 ++- crates/openrage-gui/src/navigate.rs | 19 +- crates/rage-formats/src/ytd.rs | 30 +- crates/rage-formats/src/ytd_write.rs | 50 +++ crates/rage-mods/src/compare.rs | 7 + crates/rage-mods/src/lib.rs | 2 +- crates/rage-mods/src/overlay.rs | 123 +++++- crates/rage-rpf/src/lib.rs | 2 + crates/rage-rpf/src/rpf8.rs | 145 ++++++- crates/rage-rpf/src/rpf8_editor.rs | 453 +++++++++++++++++++++ crates/rage-rpf/src/rpf8_editor/tests.rs | 212 ++++++++++ crates/rage-rpf/src/rpf8_names.rs | 61 ++- site/content/modding.md | 7 +- site/content/rdr2.md | 70 +++- 27 files changed, 1944 insertions(+), 51 deletions(-) create mode 100644 crates/openrage-app/src/rdr2_install.rs create mode 100644 crates/openrage-cli/src/cmd/verify_rdr2.rs create mode 100644 crates/rage-rpf/src/rpf8_editor.rs create mode 100644 crates/rage-rpf/src/rpf8_editor/tests.rs diff --git a/README.md b/README.md index ca1f5ea..ef31597 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # OpenRAGE -**The open-source successor to OpenIV — mod GTA V and explore Red Dead Redemption 2 on Linux and Windows.** +**The open-source successor to OpenIV — mod GTA V and Red Dead Redemption 2 on Linux and Windows.** Browse and search every archive, preview textures, models, sounds and animations, read metadata as XML,
edit game text and install `.oiv` packages — compatible with OpenIV's `mods` folder, with undo. @@ -61,7 +61,7 @@ More screenshots and all features: **[two-play.github.io/openrage](https://two-p | Game | Archives | Formats | |---|---|---| | **GTA V** (Legacy & Enhanced) | ✅ read and edit (mods folder, with undo) | ✅ textures (also inside models) · models · audio · animations · metadata · text · collisions · paths · cutscenes · scripts · ASI mods (manager, Proton fix on Linux) · ◐ model import from OBJ with compressed textures and detail levels (Enhanced `.ydr` and vehicle bodies `.yft`, preview; explorer via the OBJ tools plugin) | -| **Red Dead Redemption 2** | ✅ read, with keys from your own game | ◐ textures · models · texts · metadata · audio · animations · ped outfits (read-only) | +| **Red Dead Redemption 2** | ✅ read, with keys from your own game · ◐ edit (Lenny's Mod Loader `lml/replace` folder, with undo; nested archives rewritten; not yet tried in the game) | ◐ textures (replace same-shape) · models · texts · metadata · audio · animations · ped outfits (read-only) | | **GTA VI** | 🔜 next: as fast as possible once it comes to PC | – | | **GTA IV** (Complete Edition) | ✅ read (IMG3, RPF2, RPF3), key from your own `GTAIV.exe` | ◐ textures · models · collisions · animations · text · scripts · maps in 3D · cutscenes (played with their cast, camera, subtitles and particle effects) · particle effect lists (`.wpfl`) · editing `.img`, `.rpf`, placement files, loose files and textures (`.wtd`, inside `.wdr`) (update folder, or the game files with originals kept) | diff --git a/crates/openrage-app/src/extract.rs b/crates/openrage-app/src/extract.rs index 1299686..463e754 100644 --- a/crates/openrage-app/src/extract.rs +++ b/crates/openrage-app/src/extract.rs @@ -42,7 +42,10 @@ pub fn extract_rpf8( if let Some(parent) = target.parent() { fs::create_dir_all(parent)?; } - match rpf.read(&rpf.entries().expect("entries")[i]) { + let entry = &rpf.entries().expect("entries")[i]; + // Resources as RSC8 files (header and pages), so they can be put back. + let data = if entry.is_resource { rpf.resource_file(entry) } else { rpf.read(entry) }; + match data { Ok(data) => { fs::write(&target, &data)?; s.files += 1; diff --git a/crates/openrage-app/src/install.rs b/crates/openrage-app/src/install.rs index 6be3459..65d9354 100644 --- a/crates/openrage-app/src/install.rs +++ b/crates/openrage-app/src/install.rs @@ -1,4 +1,5 @@ -//! Writing changes into the OpenIV `mods` folder. +//! Writing changes into the OpenIV `mods` folder (RDR2: LML's `lml/replace`, +//! see [`crate::rdr2_install`]). //! //! A change to a file inside a game archive is written the OpenIV way: the //! top-level archive is copied once to `mods/` (or the copy already @@ -221,6 +222,9 @@ pub fn apply_grouped( ) -> Result { let mods = mods_dir_or_create(game_dir)?; let journal = Journal::new(&mods).grouped(group); + if rage_mods::overlay::is_rdr2(game_dir) { + return crate::rdr2_install::apply(game_dir, &mods, archive, ops, description, &journal); + } if archive.to_ascii_lowercase().ends_with(".img") { return apply_img(game_dir, &mods, archive, ops, description, &journal); } @@ -521,6 +525,9 @@ pub fn apply_at( /// (`mods`, GTA IV: `update`) at the same path, so the game loads it instead /// of its own; recorded for undo. Returns the written file. pub fn put_loose(game_dir: &Path, vpath: &str, data: &[u8], description: &str) -> Result { + if rage_mods::overlay::is_rdr2(game_dir) { + bail!("{vpath}: for RDR2 only files inside the game's archives can be replaced (through lml/replace)"); + } let mods = mods_dir_or_create(game_dir)?; let folder = rage_mods::overlay::folder_name(game_dir); let rel = vpath.trim_start_matches('/'); @@ -556,6 +563,9 @@ pub fn remove_loose(game_dir: &Path, vpath: &str, description: &str) -> Result<( /// Creates a new, empty top-level archive in the mods folder (e.g. a new DLC pack). pub fn create_archive(game_dir: &Path, archive: &str, description: &str, group: Option<&str>) -> Result { + if rage_mods::overlay::is_rdr2(game_dir) { + bail!("{archive}: new top-level archives are not loaded for RDR2"); + } let mods = mods_dir_or_create(game_dir)?; let safe = vfs::safe_relative_path(archive).with_context(|| format!("{archive}: not a valid path"))?; let dest = mods.join(safe); diff --git a/crates/openrage-app/src/lib.rs b/crates/openrage-app/src/lib.rs index 6af0cd4..cfb480f 100644 --- a/crates/openrage-app/src/lib.rs +++ b/crates/openrage-app/src/lib.rs @@ -28,6 +28,7 @@ pub mod paths; pub mod plugins; pub mod progress; pub mod rdr2; +pub mod rdr2_install; pub mod render; pub mod repack; pub mod setup; diff --git a/crates/openrage-app/src/rdr2.rs b/crates/openrage-app/src/rdr2.rs index bf0d773..5aee547 100644 --- a/crates/openrage-app/src/rdr2.rs +++ b/crates/openrage-app/src/rdr2.rs @@ -250,7 +250,22 @@ pub fn load_keys() -> anyhow::Result>> { /// The cached file names of the game's archives, if they were collected. pub fn load_names(game_dir: &Path) -> Option> { use rage_rpf::rpf8_names::NameIndex; - crate::paths::rdr2_names(game_dir).and_then(|p| NameIndex::load(&p).ok().flatten()).map(Arc::new) + let found = crate::paths::rdr2_names(game_dir).and_then(|p| NameIndex::load(&p).ok().flatten()).map(|mut n| { + n.add_x64_forms(); + n + }); + // Names OpenRAGE gave entries it created or renamed (in lml/replace). + let own = rage_mods::mods_dir(game_dir) + .and_then(|m| std::fs::read_to_string(crate::rdr2_install::names_file(&m)).ok()) + .unwrap_or_default(); + if own.trim().is_empty() { + return found.map(Arc::new); + } + let mut index = found.unwrap_or_default(); + for name in own.lines().map(str::trim).filter(|n| !n.is_empty()) { + index.add_path(name, 'y'); + } + Some(Arc::new(index)) } /// Prepares archives of a game folder to be opened through the virtual file diff --git a/crates/openrage-app/src/rdr2_install.rs b/crates/openrage-app/src/rdr2_install.rs new file mode 100644 index 0000000..cfaf559 --- /dev/null +++ b/crates/openrage-app/src/rdr2_install.rs @@ -0,0 +1,349 @@ +//! Writing Red Dead Redemption 2 changes into the `lml/replace` folder. +//! +//! RDR2's archives are never changed. Lenny's Mod Loader (LML) loads +//! `lml/replace//` in place of the file at `` inside +//! the game's `.rpf`, so: +//! +//! - a file directly inside a game archive is written there as a loose file +//! (`update_4.rpf/x64/data/foo.ymt` → `lml/replace/update_4/x64/data/foo.ymt`); +//! - a change inside a nested archive (`update_4.rpf/x64/data/ui/startup_data.rpf/…`) +//! copies that nested archive there once +//! (`lml/replace/update_4/x64/data/ui/startup_data.rpf`) and edits the copy +//! in place with the RPF8 writer; archives nested deeper are rebuilt inside it. +//! +//! LML cannot hide or rename a file of the game's archives, so removing and +//! renaming work only inside a nested archive (or on files OpenRAGE put into +//! `lml/replace` itself). Every step is recorded in the journal +//! (`lml/replace/.openrage/journal`) and can be undone. + +use std::collections::BTreeMap; +use std::fs; +use std::path::{Path, PathBuf}; +use std::sync::Arc; +use std::sync::atomic::{AtomicU64, Ordering}; + +use anyhow::{Context, Result, bail}; +use rage_mods::overlay::{rdr2_rel, rdr2_split}; +use rage_rpf::rpf8::{Rdr2Keys, Rpf8}; +use rage_rpf::rpf8_editor::Rpf8Editor; +use rage_rpf::rpf8_names::NameIndex; +use rage_rpf::{CommitStats, vfs}; + +use crate::install::{Applied, Op}; +use crate::journal::Journal; + +static TEMP_COUNTER: AtomicU64 = AtomicU64::new(0); + +/// The nested archive `inner` passes through in `rpf`, as (its path, the +/// rest of `inner`): the shortest prefix that is an archive entry. +fn nested_split(rpf: &Rpf8, inner: &str) -> Option<(String, String)> { + let segs: Vec<&str> = inner.split('/').filter(|s| !s.is_empty()).collect(); + for n in 1..segs.len() { + let prefix = segs[..n].join("/"); + if let Some(i) = rpf.find(&prefix) + && rpf.entries()?[i].ext_id == 0 + { + return Some((rpf.entry_name(i), segs[n..].join("/"))); + } + } + None +} + +/// Groups ops by the nested archive they reach into; ops on the archive's +/// own entries come back under `None`. +#[allow(clippy::type_complexity)] +fn group(rpf: &Rpf8, ops: &[(String, Op)]) -> Result<(Vec<(String, Op)>, BTreeMap>)> { + let mut local = Vec::new(); + let mut nested: BTreeMap> = BTreeMap::new(); + for (path, op) in ops { + let path = path.trim_matches('/'); + match nested_split(rpf, path) { + Some((archive, rest)) => { + let op = match op { + Op::Rename(to) => { + let to = to.trim_matches('/'); + let rest_to = to + .get(archive.len() + 1..) + .filter(|_| to.len() > archive.len() && to[..archive.len()].eq_ignore_ascii_case(&archive)) + .with_context(|| format!("cannot move {path} out of {archive}"))?; + Op::Rename(rest_to.to_owned()) + } + other => other.clone(), + }; + nested.entry(archive).or_default().push((rest, op)); + } + None => local.push((path.to_owned(), op.clone())), + } + } + Ok((local, nested)) +} + +/// Applies ops to an archive opened for editing; deeper nested archives are +/// rebuilt through temporary files. +fn edit( + editor: &mut Rpf8Editor, + ops: &[(String, Op)], + keys: &Option>, + names: &Option>, + temp_root: &Path, + added: &mut Vec, +) -> Result<()> { + let (local, nested) = group(editor.archive(), ops)?; + for (archive, sub_ops) in nested { + let rpf = editor.archive(); + let entry = &rpf.entries().context("entry table")?[rpf.find(&archive).context("nested archive")?]; + let bytes = rpf.read(entry)?; + let dir = temp_root.join(format!("{}-{}", std::process::id(), TEMP_COUNTER.fetch_add(1, Ordering::Relaxed))); + fs::create_dir_all(&dir)?; + let tmp = dir.join("nested.rpf"); + fs::write(&tmp, bytes)?; + let result = (|| -> Result> { + let mut sub = Rpf8Editor::open(&tmp, keys.clone(), names.clone())?; + edit(&mut sub, &sub_ops, keys, names, temp_root, added)?; + added.extend(sub.added_names().iter().cloned()); + sub.commit(&mut |_| Ok(()))?; + Ok(fs::read(&tmp)?) + })(); + let _ = fs::remove_dir_all(&dir); + editor.set(&archive, result.with_context(|| format!("editing {archive}"))?)?; + } + for (path, op) in local { + match op { + Op::Set(data) => editor.set(&path, data)?, + Op::SetRaw(_) => bail!("{path}: stored GTA V entries cannot go into an RDR2 archive"), + Op::Remove => { + if editor.remove(&path) == 0 { + bail!("{path}: no such entry"); + } + } + Op::Rename(to) => editor.rename(&path, &to)?, + Op::CreateDir => bail!("{path}: RDR2 archives have no folders of their own; import a file there instead"), + } + } + added.extend(editor.added_names().iter().cloned()); + Ok(()) +} + +/// Applies `ops` (paths inside the game archive `archive`) for RDR2. +pub(crate) fn apply( + game_dir: &Path, + mods: &Path, + archive: &str, + ops: &[(String, Op)], + description: &str, + journal: &Journal, +) -> Result { + let Some((archive, _)) = rdr2_split(game_dir, archive) else { + bail!("{archive} is not one of the game's archives (RDR2 changes go into lml/replace, beside the game's own)") + }; + let keys = rage_rpf::rpf8::default_keys(); + let names = rage_rpf::rpf8::default_names(); + let top = Rpf8::open_default(&game_dir.join(&archive))?; + if top.entries().is_none() { + bail!("{archive}: the archive keys are not loaded (run `openrage rdr2-keys` first)"); + } + let (local, nested) = group(&top, ops)?; + let mut last: Option = None; + let mut added = Vec::new(); + + for (path, op) in local { + check_named(&archive, &path)?; + let rel = rdr2_rel(&archive, &path); + let target = mods.join(vfs::safe_relative_path(&rel).with_context(|| format!("{rel}: not a valid path"))?); + match op { + Op::Set(data) => { + check_kind(&top, &path, &data)?; + let written = journal.write_file(false, &rel, &data, description)?; + last = Some(Applied { path: written, created: false, stats: changed() }); + } + Op::Remove if vfs::find_case_insensitive(mods, &rel).is_some_and(|p| p.is_file()) => { + journal.delete_file(&rel, description)?; + last = Some(Applied { path: target, created: false, stats: changed() }); + } + Op::Remove => bail!( + "{path}: Lenny's Mod Loader cannot remove a file from the game's archives; only files in \ + lml/replace (and entries of nested archives) can be removed" + ), + Op::Rename(_) => bail!( + "{path}: Lenny's Mod Loader cannot rename a file of the game's archives; only entries of \ + nested archives can be renamed" + ), + Op::CreateDir => bail!("{path}: RDR2 archives have no folders of their own; import a file there instead"), + Op::SetRaw(_) => bail!("{path}: stored GTA V entries cannot go into an RDR2 archive"), + } + } + + let temp_root = mods.join(rage_mods::overlay::OPENRAGE_FOLDER).join("tmp"); + for (nested_path, sub_ops) in nested { + check_named(&archive, &nested_path)?; + let rel = rdr2_rel(&archive, &nested_path); + let (path, created) = ensure_copied(&top, &nested_path, mods, &rel, journal)?; + let mut editor = Rpf8Editor::open(&path, keys.clone(), names.clone())?; + edit(&mut editor, &sub_ops, &keys, &names, &temp_root, &mut added)?; + let stats = editor.commit(&mut |backup| { + journal + .record_edit(&rel, description, backup) + .map(|_| ()) + .map_err(|e| rage_rpf::RpfError::Io(std::io::Error::other(e.to_string()))) + })?; + last = Some(Applied { path, created, stats }); + } + remember_names(mods, top.platform(), &added)?; + last.context("nothing to do") +} + +/// LML finds a replacement by the file's real path: refuse paths that are +/// only a hash (`hash/…`) or carry a mount prefix (`pack:/…`). +fn check_named(archive: &str, path: &str) -> Result<()> { + if path.split('/').next().is_some_and(|s| s.eq_ignore_ascii_case("hash")) || path.contains(':') { + bail!( + "{archive}/{path}: the real path of this file is not known, and Lenny's Mod Loader finds replacements \ + by path. Run `openrage rdr2-names ` (or import a list of names) so the file gets its name" + ); + } + Ok(()) +} + +fn changed() -> CommitStats { + CommitStats { changed: true, ..Default::default() } +} + +/// Refuses to put a plain file where the game has a resource (or the other +/// way round): LML would hand the game data it cannot read. +fn check_kind(top: &Rpf8, path: &str, data: &[u8]) -> Result<()> { + let Some(i) = top.find(path) else { return Ok(()) }; + let entry = &top.entries().context("entry table")?[i]; + let is_resource = rage_rpf::rpf8::resource_file_flags(data).is_some(); + if entry.is_resource && !is_resource { + bail!("{path} is a resource: replace it with an RSC8 file (as Extract saves it)"); + } + if !entry.is_resource && is_resource { + bail!("{path} is a plain file in the game, the new data is a resource (RSC8 file)"); + } + Ok(()) +} + +/// Copies a nested archive out of the game archive into `lml/replace` once. +fn ensure_copied(top: &Rpf8, nested_path: &str, mods: &Path, rel: &str, journal: &Journal) -> Result<(PathBuf, bool)> { + if let Some(p) = vfs::find_case_insensitive(mods, rel).filter(|p| p.is_file()) { + return Ok((p, false)); + } + let i = top.find(nested_path).with_context(|| format!("{nested_path} not found"))?; + let bytes = top.read(&top.entries().context("entry table")?[i])?; + let dest = mods.join(vfs::safe_relative_path(rel).with_context(|| format!("{rel}: not a valid path"))?); + if let Some(dir) = dest.parent() { + fs::create_dir_all(dir)?; + } + let tmp = dest.with_extension("rpf.openrage-tmp"); + fs::write(&tmp, bytes).with_context(|| format!("writing {}", tmp.display()))?; + fs::rename(&tmp, &dest)?; + journal.record_created(rel, &format!("Copied {nested_path} into lml/replace"))?; + Ok((dest, true)) +} + +/// The names OpenRAGE gave new or renamed entries, kept beside the journal +/// (`lml/replace/.openrage/names.txt`): RPF8 stores only hashes, and the +/// game's own name tables cannot be written. +pub(crate) fn names_file(mods: &Path) -> PathBuf { + mods.join(rage_mods::overlay::OPENRAGE_FOLDER).join("names.txt") +} + +fn remember_names(mods: &Path, platform: char, added: &[String]) -> Result<()> { + if added.is_empty() { + return Ok(()); + } + let file = names_file(mods); + let mut text = fs::read_to_string(&file).unwrap_or_default(); + for n in added { + if !text.lines().any(|l| l.eq_ignore_ascii_case(n)) { + text.push_str(n); + text.push('\n'); + } + } + if let Some(dir) = file.parent() { + fs::create_dir_all(dir)?; + } + fs::write(&file, &text).with_context(|| format!("writing {}", file.display()))?; + // Known from now on in this process, too. + let mut index = rage_rpf::rpf8::default_names().map(|n| (*n).clone()).unwrap_or_default(); + for n in added { + index.add_path(n, platform); + } + rage_rpf::rpf8::set_defaults(rage_rpf::rpf8::default_keys(), Some(Arc::new(index))); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::install; + + fn archive(at: &Path, files: &[(&str, Vec)]) { + fs::write(at, rage_rpf::rpf8_editor::empty_archive()).unwrap(); + let mut ed = Rpf8Editor::open(at, None, None).unwrap(); + for (p, d) in files { + ed.set(p, d.clone()).unwrap(); + } + ed.commit(&mut |_| Ok(())).unwrap(); + } + + fn read(game: &Path, vpath: &str) -> Vec { + match rage_mods::resolve(game, vpath, None).unwrap().0 { + vfs::Node::Rpf8File(rpf, i) => rpf.read(&rpf.entries().unwrap()[i]).unwrap(), + vfs::Node::PlainFile(p) => fs::read(p).unwrap(), + _ => panic!("{vpath} is not a file"), + } + } + + #[test] + fn changes_go_into_lml_replace_and_undo() { + let game = std::env::temp_dir().join(format!("openrage-rdr2-install-{}", std::process::id())); + let _ = fs::remove_dir_all(&game); + fs::create_dir_all(&game).unwrap(); + fs::write(game.join("RDR2.exe"), b"").unwrap(); + let nested = game.join("nested.tmp"); + archive(&nested, &[("settings/a.ymt", b"inner a".to_vec()), ("settings/b.ymt", b"inner b".to_vec())]); + let nested_bytes = fs::read(&nested).unwrap(); + fs::remove_file(&nested).unwrap(); + archive( + &game.join("update_9.rpf"), + &[("x64/data/top.ymt", b"top".to_vec()), ("x64/data/ui/inner.rpf", nested_bytes.clone())], + ); + let before = fs::read(game.join("update_9.rpf")).unwrap(); + + // A file directly in the archive: a loose file in lml/replace. + install::apply_at(&game, None, "update_9.rpf/x64/data/top.ymt", Op::Set(b"TOP".to_vec()), "top").unwrap(); + let loose = game.join("lml/replace/update_9/x64/data/top.ymt"); + assert_eq!(fs::read(&loose).unwrap(), b"TOP"); + assert_eq!(read(&game, "update_9.rpf/x64/data/top.ymt"), b"TOP", "the overlay view sees it"); + assert!( + install::apply_at(&game, None, "update_9.rpf/x64/data/ui/inner.rpf", Op::Rename("x.rpf".into()), "mv") + .is_err(), + "LML cannot rename the game's files" + ); + + // Inside the nested archive: a copy of it in lml/replace, edited. + let inner = "update_9.rpf/x64/data/ui/inner.rpf/settings"; + let ops = [ + ("x64/data/ui/inner.rpf/settings/a.ymt".to_owned(), Op::Set(b"changed a".to_vec())), + ("x64/data/ui/inner.rpf/settings/new.ymt".to_owned(), Op::Set(b"new".to_vec())), + ("x64/data/ui/inner.rpf/settings/b.ymt".to_owned(), Op::Remove), + ]; + let applied = install::apply(&game, None, "update_9.rpf", &ops, "inner").unwrap(); + assert!(applied.created); + assert_eq!(applied.path, game.join("lml/replace/update_9/x64/data/ui/inner.rpf")); + assert_eq!(read(&game, &format!("{inner}/a.ymt")), b"changed a"); + assert_eq!(read(&game, &format!("{inner}/new.ymt")), b"new"); + assert!(rage_mods::resolve(&game, &format!("{inner}/b.ymt"), None).is_err()); + let scanned: Vec = rage_mods::scan(&game).into_iter().map(|f| f.rel).collect(); + assert_eq!(scanned, ["update_9.rpf/x64/data/top.ymt", "update_9.rpf/x64/data/ui/inner.rpf"]); + + // Undo: the copy, then the loose file, go again; the game is untouched. + while install::undo_last(&game).unwrap().is_some() {} + assert!(!loose.exists()); + assert!(!applied.path.exists()); + assert_eq!(fs::read(game.join("update_9.rpf")).unwrap(), before); + assert_eq!(read(&game, &format!("{inner}/b.ymt")), b"inner b"); + fs::remove_dir_all(&game).ok(); + } +} diff --git a/crates/openrage-app/src/textures.rs b/crates/openrage-app/src/textures.rs index bd7b3f5..656f007 100644 --- a/crates/openrage-app/src/textures.rs +++ b/crates/openrage-app/src/textures.rs @@ -21,6 +21,35 @@ pub fn edit_textures( edits: &[Edit], ) -> Result<(EditResult, PathBuf)> { let (node, _) = rage_mods::resolve(game_dir, vpath, keys.clone())?; + if let Node::Rpf8File(rpf, i) = node { + // RDR2: same-shape replacements, written into the padded layout. + let entry = rpf.entries().and_then(|e| e.get(i)).with_context(|| format!("{vpath} not found"))?.clone(); + let res = rpf.read_resource(&entry)?; + let dict = rage_formats::ytd::parse_rdr2(&res).context("reading the texture dictionary")?; + let changed = ytd_write::apply_rdr2(&res, &dict, edits)?; + let mut file = rpf.resource_file(&entry)?; + file.truncate(16); + file.extend(&changed.system); + file.extend(&changed.graphics); + drop(rpf); + let applied = apply_at(game_dir, keys, vpath, Op::Set(file.clone()), &describe(vpath, edits))?; + let replaced = edits.len(); + return Ok((EditResult { file, in_place: true, replaced, added: 0, removed: 0 }, applied.path)); + } + if let Node::PlainFile(path) = &node + && let Some(res) = std::fs::read(path).ok().as_deref().and_then(rage_rpf::rpf8::parse_resource_file) + { + // RDR2: a dictionary already replaced in lml/replace (an RSC8 file). + let dict = rage_formats::ytd::parse_rdr2(&res).context("reading the texture dictionary")?; + let changed = ytd_write::apply_rdr2(&res, &dict, edits)?; + let mut file = std::fs::read(path)?; + file.truncate(16); + file.extend(&changed.system); + file.extend(&changed.graphics); + let applied = apply_at(game_dir, keys, vpath, Op::Set(file.clone()), &describe(vpath, edits))?; + let replaced = edits.len(); + return Ok((EditResult { file, in_place: true, replaced, added: 0, removed: 0 }, applied.path)); + } if let Node::Gta4File(archive, id) = node { // GTA IV (.wtd): an RSC5 resource inside an image archive. let raw = archive.read(id)?; diff --git a/crates/openrage-cli/src/cli.rs b/crates/openrage-cli/src/cli.rs index 08146a8..d6ae54e 100644 --- a/crates/openrage-cli/src/cli.rs +++ b/crates/openrage-cli/src/cli.rs @@ -100,6 +100,9 @@ pub(crate) enum Command { /// that it comes out byte for byte the same or at least reads back to the same XML. /// GTA IV without --textures: rebuild the table of every .rpf package in memory and /// check that it matches the stored one byte for byte (nothing is written). + /// RDR2 without --textures: edit a temporary copy of every archive (top-level ones up to + /// 512 MB, and every nested one) with the RPF8 writer, check that every entry reads back + /// as it should, undo the edit and check that the copy is the original again. #[arg(long)] rebuild: bool, }, diff --git a/crates/openrage-cli/src/cmd/edit.rs b/crates/openrage-cli/src/cmd/edit.rs index 071121a..a1b1566 100644 --- a/crates/openrage-cli/src/cmd/edit.rs +++ b/crates/openrage-cli/src/cmd/edit.rs @@ -51,6 +51,12 @@ pub(crate) fn load_ytd( .with_context(|| format!("{path} has no textures of its own")) } Node::Gta4File(a, id) => Ok(rage_formats::ytd::parse_gta4(&a.read_resource(id)?)?), + // An RDR2 dictionary replaced in lml/replace (an RSC8 file). + Node::PlainFile(p) => { + let res = rage_rpf::rpf8::parse_resource_file(&std::fs::read(&p)?) + .with_context(|| format!("{path} is not a file inside an archive or an RSC8 resource"))?; + Ok(rage_formats::ytd::parse_rdr2(&res)?) + } _ => bail!("{path} is not a file inside an archive"), } } @@ -137,7 +143,7 @@ pub(crate) fn cmd_edit_textures( pub(crate) fn report(applied: &install::Applied, started: Instant) { if applied.created { - outln!("Copied the archive into the overlay folder first (mods; GTA IV: update)."); + outln!("Copied the archive into the overlay folder first (mods; GTA IV: update; RDR2: lml/replace)."); } outln!( "Written to {} ({} appended{}, {:.2}s). Undo with `openrage undo`.", diff --git a/crates/openrage-cli/src/cmd/mod.rs b/crates/openrage-cli/src/cmd/mod.rs index e6de126..fd59242 100644 --- a/crates/openrage-cli/src/cmd/mod.rs +++ b/crates/openrage-cli/src/cmd/mod.rs @@ -9,6 +9,7 @@ mod rdr2; mod search; mod verify; mod verify_gta4; +mod verify_rdr2; mod view; pub(crate) use archive::*; @@ -20,4 +21,5 @@ pub(crate) use rdr2::*; pub(crate) use search::*; pub(crate) use verify::*; pub(crate) use verify_gta4::*; +pub(crate) use verify_rdr2::*; pub(crate) use view::*; diff --git a/crates/openrage-cli/src/cmd/verify_rdr2.rs b/crates/openrage-cli/src/cmd/verify_rdr2.rs new file mode 100644 index 0000000..8dcd29d --- /dev/null +++ b/crates/openrage-cli/src/cmd/verify_rdr2.rs @@ -0,0 +1,320 @@ +//! `openrage verify --rebuild` for Red Dead Redemption 2: the RPF8 writer +//! checked against the game's own archives. + +use std::collections::hash_map::DefaultHasher; +use std::hash::{Hash, Hasher}; +use std::time::Instant; + +use rage_rpf::rpf8::Rpf8; +use rage_rpf::rpf8_editor::Rpf8Editor; + +use crate::*; + +/// Archives larger than this are not copied for the round trip (the copy +/// goes to the temporary folder); their nested archives are still checked. +const COPY_LIMIT: u64 = 512 << 20; + +fn digest(b: &[u8]) -> u64 { + let mut h = DefaultHasher::new(); + b.hash(&mut h); + h.finish() +} + +fn file_digest(path: &Path) -> Result { + use std::io::Read; + let mut f = std::fs::File::open(path)?; + let mut h = DefaultHasher::new(); + let mut buf = vec![0u8; 1 << 20]; + loop { + let n = f.read(&mut buf)?; + if n == 0 { + return Ok(h.finish()); + } + buf[..n].hash(&mut h); + } +} + +#[derive(Default)] +struct Tally { + archives: usize, + entries: usize, + /// Texture dictionaries whose textures were written in place and read back. + dictionaries: usize, + textures: usize, + skipped: Vec, + failed: Vec, + /// Compressor field of stored `RSC8` headers by the entry's compression (0xFFFF: no `RSC8` magic). + rsc8_fields: std::collections::BTreeMap<(String, u32), usize>, +} + +/// What every entry reads as: its decoded bytes' digest, or the read error. +fn contents(rpf: &Rpf8) -> Vec<(u32, u8, std::result::Result)> { + rpf.entries() + .unwrap_or_default() + .iter() + .map(|e| (e.hash, e.ext_id, rpf.read(e).map(|d| digest(&d)).map_err(|x| x.to_string()))) + .collect() +} + +/// Edits a copy of an archive (replace a file, re-store a resource from its +/// exported RSC8 file, add a file, so the table grows), checks that every +/// entry reads back as it should, then undoes the edit and checks that the +/// file is byte for byte the original again. +fn round_trip(path: &Path, label: &str, tally: &mut Tally) -> Result<()> { + let keys = rage_rpf::rpf8::default_keys(); + let before = Rpf8::open_with_keys(path, keys.clone())?; + let Some(entries) = before.entries() else { + tally.skipped.push(format!("{label}: entry table encrypted with a key that is not loaded")); + return Ok(()); + }; + for e in entries.iter().filter(|e| e.is_resource) { + if let Ok(head) = before.read_stored_head(e, 16) + && head.len() == 16 + { + let magic = u32::from_le_bytes(head[0..4].try_into().unwrap_or_default()); + let info = u32::from_le_bytes(head[4..8].try_into().unwrap_or_default()); + let field = if magic == rage_rpf::rpf8::RSC8_MAGIC { info >> 8 & 0x1F } else { 0xFFFF }; + let kind = format!("{:?}{}", e.compression, if e.is_encrypted() { " encrypted" } else { "" }); + *tally.rsc8_fields.entry((kind, field)).or_default() += 1; + } + } + textures(&before, label, tally); + let original = contents(&before); + let original_file = file_digest(path)?; + let readable = |i: usize| original[i].2.is_ok(); + + // Pick what to change: the first readable plain file, the first readable resource. + let plain = (0..entries.len()).find(|&i| readable(i) && !entries[i].is_resource && entries[i].ext_id != 0); + let resource = (0..entries.len()).find(|&i| readable(i) && entries[i].is_resource); + let mut ed = Rpf8Editor::open(path, keys.clone(), None)?; + let name = |i: usize| entries[i].display_name(before.platform()); + let new_plain = plain.map(|i| { + let mut d = before.read(&entries[i]).unwrap_or_default(); + d.extend(b"\n-- changed by openrage verify --rebuild --\n"); + d + }); + if let (Some(i), Some(d)) = (plain, &new_plain) { + ed.set(&name(i), d.clone())?; + } + if let Some(i) = resource { + ed.set(&name(i), before.resource_file(&entries[i])?)?; + } + let added = b"openrage verify --rebuild".to_vec(); + let added_name = "openrage_verify/added.txt"; + // Several new entries: the table grows over the first entries' data. + for k in 0..8 { + ed.set(&format!("{added_name}{k}"), added.clone())?; + } + let mut backup = None; + ed.commit(&mut |b| { + backup = Some(b.clone()); + Ok(()) + })?; + let backup = backup.context("no backup")?; + + let after = Rpf8::open_with_keys(path, keys)?; + let problems = (|| -> std::result::Result<(), String> { + if after.header().is_encrypted() { + return Err("the table was not written in plain text".into()); + } + let new_entries = after.entries().ok_or("table unreadable")?; + if new_entries.len() != entries.len() + 8 { + return Err(format!("{} entries, expected {}", new_entries.len(), entries.len() + 8)); + } + if !new_entries.windows(2).all(|w| w[0].hash <= w[1].hash) { + return Err("entries not sorted by hash".into()); + } + for (i, (hash, ext, want)) in original.iter().enumerate() { + let e = new_entries + .iter() + .find(|e| e.hash == *hash && e.ext_id == *ext) + .ok_or_else(|| format!("{} lost", name(i)))?; + let got = after.read(e).map(|d| digest(&d)).map_err(|x| x.to_string()); + let want = match (plain, &new_plain) { + (Some(p), Some(d)) if p == i => Ok(digest(d)), + _ => want.clone(), + }; + if got != want { + return Err(format!("{} reads differently ({got:?} vs {want:?})", name(i))); + } + if resource == Some(i) && (e.size_or_flags != entries[i].size_or_flags || !e.is_resource) { + return Err(format!("{}: resource flags changed", name(i))); + } + } + let (h, x) = rage_rpf::rpf8::path_hash(&format!("{added_name}0"), after.platform()); + let e = new_entries.iter().find(|e| e.hash == h && e.ext_id == x).ok_or("added entry missing")?; + if after.read(e).map_err(|x| x.to_string())? != added { + return Err("added entry reads differently".into()); + } + Ok(()) + })(); + backup.restore(path)?; + let restored = file_digest(path)? == original_file; + tally.archives += 1; + tally.entries += entries.len(); + match (problems, restored) { + (Ok(()), true) => {} + (Err(p), _) => tally.failed.push(format!("{label}: {p}")), + (Ok(()), false) => tally.failed.push(format!("{label}: undo did not restore the original bytes")), + } + Ok(()) +} + +/// Writes every texture of every dictionary in the archive in place (first +/// its own pixels, which must give the same resource back, then changed +/// pixels for the first texture, which must read back as written and leave +/// the others alone). +fn textures(rpf: &Rpf8, label: &str, tally: &mut Tally) { + use rage_formats::ytd_write::{Edit, apply_rdr2}; + let Some(entries) = rpf.entries() else { return }; + for (i, e) in entries.iter().enumerate() { + if !e.is_resource || rage_rpf::rpf8::extension(e.ext_id, rpf.platform()).as_deref() != Some("ytd") { + continue; + } + let Ok(res) = rpf.read_resource(e) else { continue }; + let Ok(dict) = rage_formats::ytd::parse_rdr2(&res) else { continue }; + if dict.layout != rage_formats::ytd::Layout::Rdr2 || !dict.errors.is_empty() || dict.textures.is_empty() { + continue; + } + let name = format!("{label}/{}", rpf.entry_name(i)); + let result = (|| -> std::result::Result<(), String> { + let same: Vec = dict.textures.iter().cloned().map(Edit::Set).collect(); + let back = apply_rdr2(&res, &dict, &same).map_err(|x| x.to_string())?; + if back.system != res.system || back.graphics != res.graphics { + return Err("writing the textures' own pixels changed the resource".into()); + } + let mut changed = dict.textures[0].clone(); + changed.data.iter_mut().enumerate().for_each(|(k, b)| *b = !*b ^ k as u8); + let out = apply_rdr2(&res, &dict, &[Edit::Set(changed.clone())]).map_err(|x| x.to_string())?; + let reread = rage_formats::ytd::parse_rdr2(&out).map_err(|x| x.to_string())?; + if reread.textures[0].data != changed.data { + return Err(format!("{}: changed pixels read back differently", changed.name)); + } + if reread.textures[1..].iter().zip(&dict.textures[1..]).any(|(a, b)| a.data != b.data) { + return Err(format!("changing {} changed other textures", changed.name)); + } + Ok(()) + })(); + match result { + Ok(()) => { + tally.dictionaries += 1; + tally.textures += dict.textures.len(); + } + Err(x) => tally.failed.push(format!("{name}: {x}")), + } + } +} + +/// Round-trips every nested archive below `rpf`, depth first. +fn nested(rpf: &Rpf8, prefix: &str, scratch: &Path, tally: &mut Tally) { + let Some(entries) = rpf.entries() else { return }; + for (i, e) in entries.iter().enumerate() { + if e.ext_id != 0 { + continue; + } + let label = format!("{prefix}/{}", rpf.entry_name(i)); + match rpf.open_child(e) { + Ok(child) => { + nested(&child, &label, scratch, tally); + if e.size_on_disk > COPY_LIMIT { + tally.skipped.push(format!("{label}: {} MB", e.size_on_disk >> 20)); + continue; + } + let p = scratch.join(format!("nested{}.rpf", child_depth(&label))); + let result = rpf + .read(e) + .map_err(anyhow::Error::from) + .and_then(|bytes| Ok(std::fs::write(&p, bytes)?)) + .and_then(|()| round_trip(&p, &label, tally)); + if let Err(x) = result { + tally.failed.push(format!("{label}: {x:#}")); + } + let _ = std::fs::remove_file(&p); + } + Err(x) => tally.skipped.push(format!("{label}: {x}")), + } + } +} + +/// How deep a nested archive is (its file name in the scratch folder, so a +/// parent's copy is never overwritten by its child's). +fn child_depth(label: &str) -> usize { + label.matches(".rpf/").count() +} + +pub(crate) fn cmd_verify_rdr2_rebuild(game_dir: &Path, within: &str) -> Result<()> { + let root = game_dir.join(within.trim_start_matches('/')); + let mut found = Vec::new(); + if root.is_file() { + found.push(root); + } else { + fn collect(dir: &Path, out: &mut Vec) { + let Ok(rd) = std::fs::read_dir(dir) else { return }; + for e in rd.flatten() { + let p = e.path(); + if p.is_dir() { + collect(&p, out); + } else if p.extension().is_some_and(|x| x.eq_ignore_ascii_case("rpf")) { + out.push(p); + } + } + } + collect(&root, &mut found); + } + found.sort(); + let scratch = std::env::temp_dir().join(format!("openrage-verify-rdr2-{}", std::process::id())); + std::fs::create_dir_all(&scratch)?; + let started = Instant::now(); + let mut tally = Tally::default(); + for path in found { + let rel = path.strip_prefix(game_dir).unwrap_or(&path).to_string_lossy().replace('\\', "/"); + let size = std::fs::metadata(&path).map(|m| m.len()).unwrap_or(0); + if size == 0 || !Rpf8::file_is_rpf8(&path) { + continue; + } + let rpf = match Rpf8::open_default(&path) { + Ok(r) => r, + Err(e) => { + tally.failed.push(format!("{rel}: {e}")); + continue; + } + }; + nested(&rpf, &rel, &scratch, &mut tally); + if size <= COPY_LIMIT { + let copy = scratch.join("top.rpf"); + std::fs::copy(&path, ©)?; + if let Err(e) = round_trip(©, &rel, &mut tally) { + tally.failed.push(format!("{rel}: {e:#}")); + } + let _ = std::fs::remove_file(©); + } else { + tally.skipped.push(format!("{rel}: {} MB, only its nested archives are checked", size >> 20)); + } + outln!("{rel}: {} archives so far, {} failed", tally.archives, tally.failed.len()); + } + let _ = std::fs::remove_dir_all(&scratch); + for s in &tally.skipped { + outln!("skipped {s}"); + } + for f in &tally.failed { + outln!("FAIL {f}"); + } + let fields: Vec = + tally.rsc8_fields.iter().map(|((c, f), n)| format!("{c}: compressor field {f:#x} ×{n}")).collect(); + outln!("RSC8 headers of resource entries: {}", fields.join(", ")); + outln!( + "{} archives edited and undone ({} entries), {} texture dictionaries ({} textures) written in place, \ + {} failed, {} skipped ({:.1}s)", + tally.archives, + tally.entries, + tally.dictionaries, + tally.textures, + tally.failed.len(), + tally.skipped.len(), + started.elapsed().as_secs_f32() + ); + if !tally.failed.is_empty() { + bail!("{} archives failed", tally.failed.len()); + } + Ok(()) +} diff --git a/crates/openrage-cli/src/main.rs b/crates/openrage-cli/src/main.rs index 31fbe31..340f4d3 100644 --- a/crates/openrage-cli/src/main.rs +++ b/crates/openrage-cli/src/main.rs @@ -151,7 +151,8 @@ fn run() -> Result<()> { if gta4 && let Err(e) = openrage_app::gta4::register(&game_dir) { eprintln!("warning: GTA IV archive key: {e:#}"); } - if openrage_app::detect::is_rdr2_dir(&game_dir) { + let rdr2 = openrage_app::detect::is_rdr2_dir(&game_dir); + if rdr2 { openrage_app::rdr2::register(&game_dir)?; } let keys = openrage_app::load_keys().unwrap_or_else(|e| { @@ -192,11 +193,14 @@ fn run() -> Result<()> { Command::Rdr2Ped { name, outfit, check, load } => cmd_rdr2_ped(&game_dir, name.as_deref(), outfit, check, load), Command::Verify { path, animations: true, .. } if gta4 => cmd_verify_gta4_animations(&game_dir, &path), Command::Verify { path, animations: true, .. } => cmd_verify_animations(&game_dir, &path, keys), + Command::Verify { path, textures: false, models: false, rebuild: true, .. } if rdr2 => { + cmd_verify_rdr2_rebuild(&game_dir, &path) + } Command::Verify { path, textures: false, rebuild: true, .. } if gta4 => { cmd_verify_gta4_tables(&game_dir, &path) } Command::Verify { textures: false, rebuild: true, .. } => { - bail!("--rebuild needs --textures or --models (or a GTA IV game)") + bail!("--rebuild needs --textures or --models (or a GTA IV or RDR2 game)") } Command::Verify { path, textures: false, .. } if gta4 => cmd_verify_gta4(&game_dir, &path), Command::Verify { path, textures: false, .. } => cmd_verify(&game_dir, &path, keys), diff --git a/crates/openrage-gui/src/archive_ops.rs b/crates/openrage-gui/src/archive_ops.rs index 47f6a86..872e59a 100644 --- a/crates/openrage-gui/src/archive_ops.rs +++ b/crates/openrage-gui/src/archive_ops.rs @@ -78,6 +78,8 @@ pub(crate) fn selected_entry() -> Option<(String, String)> { } // GTA IV archives: every listed entry (removed ones are shown greyed out). Location::Gta4(..) if item.mark != Some(Mark::Removed) => {} + // RDR2 archives: files and nested archives (folders are only paths). + Location::Rpf8(..) if item.kind != ItemKind::Dir => {} _ => return None, } Some((browser::join(&l.vpath, &item.name), item.name.clone())) @@ -260,7 +262,7 @@ pub(crate) fn run_archive_ops( pub(crate) fn archive_import(ui: &AppWindow, dropped: Option>) { let Some(dir) = with_app(|a| { let l = a.listing.as_ref()?; - matches!(l.location, Location::Archive(..) | Location::Gta4(..)).then(|| l.vpath.clone()) + matches!(l.location, Location::Archive(..) | Location::Gta4(..) | Location::Rpf8(..)).then(|| l.vpath.clone()) }) else { ui.set_status("Open a folder inside an archive to import files.".into()); return; diff --git a/crates/openrage-gui/src/browser.rs b/crates/openrage-gui/src/browser.rs index e33f8b2..5e090dc 100644 --- a/crates/openrage-gui/src/browser.rs +++ b/crates/openrage-gui/src/browser.rs @@ -280,7 +280,13 @@ pub fn list( Ok((listing, None)) } Node::ArchiveDir(rpf, dir) => Ok((list_archive(vpath, rpf, dir, origin), None)), - Node::Rpf8Dir(rpf, dir) => Ok((list_rpf8(vpath, rpf, dir, origin), None)), + Node::Rpf8Dir(rpf, dir) => { + let mut listing = list_rpf8(vpath, rpf, dir, origin); + if overlay { + merge_lml(game_dir, &mut listing); + } + Ok((listing, None)) + } Node::Rpf8File(rpf, i) if is_texture_dict(&rpf.entry_name(i)) => { Ok((list_rpf8_textures(vpath, rpf, i, origin)?, None)) } @@ -292,10 +298,21 @@ pub fn list( Ok((audio_listing(vpath, awc, origin), None)) } Node::Gta4Dir(a, dir) => Ok((list_gta4(vpath, a, dir, origin), None)), + // An RDR2 dictionary replaced in lml/replace: a loose RSC8 file. + Node::PlainFile(p) if is_texture_dict(&vpath) && rage_mods::overlay::is_rdr2(game_dir) => { + let res = std::fs::read(&p) + .ok() + .and_then(|b| rage_rpf::rpf8::parse_resource_file(&b)) + .ok_or_else(|| RpfError::BadResource { path: vpath.clone(), reason: "not an RSC8 resource".into() })?; + let dict = rage_formats::ytd::parse_rdr2(&res) + .map_err(|e| RpfError::BadResource { path: vpath.clone(), reason: e.to_string() })?; + let read_only = is_particles(&vpath); + Ok((texture_listing(vpath, dict, origin, read_only), None)) + } Node::Gta4File(a, i) if is_texture_dict(&a.entry(i).name) && a.entry(i).resource_type().is_some() => { let dict = rage_formats::ytd::parse_gta4(&a.read_resource(i)?) .map_err(|e| RpfError::BadResource { path: vpath.clone(), reason: e.to_string() })?; - // GTA IV dictionaries can be changed (RDR2's not yet). + // GTA IV dictionaries can be changed (RDR2's: same-shape replacements). Ok((texture_listing(vpath, dict, origin, false), None)) } // Files (and node kinds added later) list their folder, with the file selected. @@ -307,6 +324,26 @@ pub fn list( } } +/// RDR2: marks the files of a game archive's folder that `lml/replace` +/// replaces, and lists the ones it adds. +fn merge_lml(game_dir: &Path, listing: &mut Listing) { + if listing.origin != Origin::Merged { + return; + } + let Some(dir) = rage_mods::overlay_path(game_dir, &listing.vpath).filter(|p| p.is_dir()) else { return }; + let Ok(Listing { items: mod_items, .. }) = list_disk(listing.vpath.clone(), dir, Origin::Mods) else { return }; + for m in mod_items { + match listing.items.iter_mut().find(|i| i.name.eq_ignore_ascii_case(&m.name)) { + Some(existing) if m.kind == ItemKind::Dir => existing.mark = Some(Mark::ContainsMods), + Some(existing) => { + existing.size = m.size; + existing.mark = Some(Mark::Replaced); + } + None => listing.items.push(Item { mark: Some(Mark::New), ..m }), + } + } +} + /// Adds the `mods` counterpart of a disk folder to its listing and marks items. fn merge_mods(game_dir: &Path, listing: &mut Listing) { merge_mods_inner(game_dir, listing); @@ -319,6 +356,11 @@ fn merge_mods_inner(game_dir: &Path, listing: &mut Listing) { if listing.vpath.is_empty() { listing.items.retain(|i| !i.name.eq_ignore_ascii_case(rage_mods::overlay::folder_name(game_dir))); } + // RDR2's lml/replace mirrors the insides of archives, not the game + // folder: it is merged into archive listings instead (`merge_lml`). + if rage_mods::overlay::is_rdr2(game_dir) { + return; + } if listing.origin == Origin::Mods { listing.items.iter_mut().for_each(|i| i.mark = Some(Mark::New)); @@ -396,13 +438,15 @@ fn texture_listing( Listing { vpath, origin, location: Location::Textures { dict: Arc::new(dict), read_only }, items } } -/// The textures of a Red Dead Redemption 2 texture dictionary (read-only). +/// The textures of a Red Dead Redemption 2 texture dictionary (textures can be +/// replaced by ones of the same shape; particle dictionaries are read-only). fn list_rpf8_textures(vpath: String, rpf: Arc, i: usize, origin: Origin) -> Result { let entry = rpf.entries().and_then(|e| e.get(i)).ok_or_else(|| RpfError::NotFound(vpath.clone()))?; let res = rpf.read_resource(entry)?; let dict = rage_formats::ytd::parse_rdr2(&res) .map_err(|e| RpfError::BadResource { path: vpath.clone(), reason: e.to_string() })?; - Ok(texture_listing(vpath, dict, origin, true)) + let read_only = is_particles(&vpath); + Ok(texture_listing(vpath, dict, origin, read_only)) } fn list_audio( diff --git a/crates/openrage-gui/src/navigate.rs b/crates/openrage-gui/src/navigate.rs index 79e37a2..9543c16 100644 --- a/crates/openrage-gui/src/navigate.rs +++ b/crates/openrage-gui/src/navigate.rs @@ -276,12 +276,22 @@ pub(crate) fn refresh_files(ui: &AppWindow, select: Option<&str>) { ui.set_history_group(SharedString::new()); } let archive_mode = with_app(|a| { - matches!(a.listing.as_ref().map(|l| &l.location), Some(Location::Archive(..) | Location::Gta4(..))) + matches!( + a.listing.as_ref().map(|l| &l.location), + Some(Location::Archive(..) | Location::Gta4(..) | Location::Rpf8(..)) + ) }); ui.set_audio_mode_folder(with_app(|a| { matches!(a.listing.as_ref().map(|l| &l.location), Some(Location::Audio { .. })) })); - ui.set_in_mods(with_app(|a| a.listing.as_ref().is_some_and(|l| l.origin != Origin::Base))); + // RDR2: a game archive with replaced files in lml/replace is still the + // game's own; only a nested archive copied there is a copy. + ui.set_in_mods(with_app(|a| { + a.listing.as_ref().is_some_and(|l| match l.location { + Location::Rpf8(..) => l.origin == Origin::Mods, + _ => l.origin != Origin::Base, + }) + })); ui.set_archive_mode(archive_mode); ui.set_entry_selected(archive_mode && selected_row.is_some()); if let (Some(row), Some(_)) = (selected_row, select) { @@ -592,7 +602,10 @@ pub(crate) fn show_folder_info(ui: &AppWindow) { kv("Type", "Inside a Red Dead Redemption 2 archive"), kv("Archive", rpf.display_name().rsplit('/').next().unwrap_or_default()), kv("Entries", grouped(h.entry_count as usize)), - note("Read-only. Names come from `openrage rdr2-names`; unnamed files are under hash/."), + note( + "Changes go into lml/replace (Lenny's Mod Loader), never into the game's archives. \ + Names come from `openrage rdr2-names`; unnamed files are under hash/.", + ), ] } Location::Gta4(a, _) => { diff --git a/crates/rage-formats/src/ytd.rs b/crates/rage-formats/src/ytd.rs index 13dd0eb..c7de373 100644 --- a/crates/rage-formats/src/ytd.rs +++ b/crates/rage-formats/src/ytd.rs @@ -246,6 +246,24 @@ pub fn rdr2_block_count(format: Format, width: u32, height: u32, levels: u32) -> } fn read_rdr2(res: &Resource, p: u64) -> Result<(Texture, u64), ResourceError> { + let (mut tex, data_ptr, rows) = rdr2_rows(res, p)?; + let total = rows.iter().map(|&(at, len)| at + len).max().unwrap_or(0); + let src = res.bytes(data_ptr, total)?; + let mut data = Vec::with_capacity(tex.expected_size().unwrap_or(0)); + for (at, len) in rows { + data.extend_from_slice(&src[at..at + len]); + } + tex.data = data; + Ok((tex, data_ptr)) +} + +/// One tightly packed row of a stored texture: offset from the data pointer, length. +pub(crate) type Row = (usize, usize); + +/// An RDR2 texture's description (without pixel data), its data pointer, +/// and where its tightly packed rows lie in the padded stored data: the +/// offset from the data pointer and the length of each row, in order. +pub(crate) fn rdr2_rows(res: &Resource, p: u64) -> Result<(Texture, u64, Vec), ResourceError> { let name = res.string(res.u64(p + 0x28)?)?; let depth = res.u16(p + 0x1C)? as u32; let dimension = match res.u8(p + 0x1E)? { @@ -253,7 +271,7 @@ fn read_rdr2(res: &Resource, p: u64) -> Result<(Texture, u64), ResourceError> { 3 => Dimension::Texture3D, _ => Dimension::Texture2D, }; - let mut tex = Texture { + let tex = Texture { width: res.u16(p + 0x18)? as u32, height: res.u16(p + 0x1A)? as u32, depth: if dimension == Dimension::Cube { depth.max(6) } else { depth.max(1) }, @@ -300,21 +318,19 @@ fn read_rdr2(res: &Resource, p: u64) -> Result<(Texture, u64), ResourceError> { tex.levels ))); } - let src = res.bytes(data_ptr, stored_blocks * stride)?; - let mut data = Vec::with_capacity(tex.expected_size().unwrap_or(0)); + res.bytes(data_ptr, stored_blocks * stride)?; + let mut out = Vec::new(); let mut at = 0; // Slices one after another, each with its mip levels. for _ in 0..slices { for &[cols, rows, pcols, prows] in &grids { for r in 0..rows { - let start = at + r * pcols * block; - data.extend_from_slice(&src[start..start + cols * block]); + out.push((at + r * pcols * block, cols * block)); } at += pcols * prows * block; } } - tex.data = data; - Ok((tex, data_ptr)) + Ok((tex, data_ptr, out)) } /// Reads a texture dictionary located at `root` (e.g. one embedded in a drawable). diff --git a/crates/rage-formats/src/ytd_write.rs b/crates/rage-formats/src/ytd_write.rs index 2d7a06c..6301675 100644 --- a/crates/rage-formats/src/ytd_write.rs +++ b/crates/rage-formats/src/ytd_write.rs @@ -76,6 +76,56 @@ pub fn apply( apply_inner(res, system_flags, graphics_flags, dict, edits, false) } +/// Red Dead Redemption 2 (`ytd::parse_rdr2`): replaces textures in place by +/// ones of the same format, size, depth and mip count, writing their pixels +/// into the padded layout the game stores. Returns the changed resource +/// (same pages, same sizes). Adding and removing textures, and other shapes, +/// are not supported yet. +pub fn apply_rdr2(res: &Resource, dict: &TextureDictionary, edits: &[Edit]) -> Result { + if !dict.errors.is_empty() { + return Err(bad(format!("dictionary has unreadable textures ({}); refusing to rewrite it", dict.errors[0]))); + } + if dict.layout != crate::ytd::Layout::Rdr2 { + return Err(bad("not a Red Dead Redemption 2 dictionary (version 2)")); + } + let list = res.u64(Resource::ROOT + 0x30)?; + let mut out = res.clone(); + for e in edits { + let t = match e { + Edit::Set(t) => t, + Edit::Remove(n) => { + return Err(bad(format!("{n}: removing textures from RDR2 dictionaries is not supported yet"))); + } + }; + let Some(i) = dict.textures.iter().position(|x| x.name.eq_ignore_ascii_case(&t.name)) else { + return Err(bad(format!("{}: adding textures to RDR2 dictionaries is not supported yet", t.name))); + }; + let old = &dict.textures[i]; + if !same_shape(old, t) { + return Err(bad(format!( + "{}: RDR2 textures can only be replaced by one of the same format, size and mip count \ + ({} {}×{}, {} levels; the new one is {} {}×{}, {} levels)", + t.name, + old.format.name(), + old.width, + old.height, + old.levels, + t.format.name(), + t.width, + t.height, + t.levels + ))); + } + let (_, data_ptr, rows) = crate::ytd::rdr2_rows(res, res.u64(list + i as u64 * 8)?)?; + let mut from = 0; + for (at, len) in rows { + out.bytes_mut(data_ptr + at as u64, len)?.copy_from_slice(&t.data[from..from + len]); + from += len; + } + } + Ok(out) +} + /// Rebuilds a dictionary with a fresh layout and no changes (used to verify the writer). pub fn rebuild(dict: &TextureDictionary) -> Result, ResourceError> { let res = Resource { version: dict.version, system: Vec::new(), graphics: Vec::new() }; diff --git a/crates/rage-mods/src/compare.rs b/crates/rage-mods/src/compare.rs index 8659fc1..134afa5 100644 --- a/crates/rage-mods/src/compare.rs +++ b/crates/rage-mods/src/compare.rs @@ -428,6 +428,13 @@ pub fn list_changes( let mut out = Vec::new(); for (i, f) in files.iter().enumerate() { progress(i, files.len(), &f.rel); + // RDR2: every file in lml/replace stands for one file inside a game + // archive (changed nested archives are not compared entry by entry). + if crate::overlay::is_rdr2(game_dir) { + let kind = if f.kind == ModFileKind::New { ChangeKind::NewFile } else { ChangeKind::ReplacedFile }; + out.push(Change { vpath: f.rel.clone(), kind, is_dir: false, size: f.size }); + continue; + } if f.kind == ModFileKind::New { out.push(Change { vpath: f.rel.clone(), kind: ChangeKind::NewFile, is_dir: false, size: f.size }); continue; diff --git a/crates/rage-mods/src/lib.rs b/crates/rage-mods/src/lib.rs index 86e2b6e..fa266ce 100644 --- a/crates/rage-mods/src/lib.rs +++ b/crates/rage-mods/src/lib.rs @@ -20,4 +20,4 @@ pub use compare::{ Change, ChangeKind, CompareMode, FolderDiff, Mark, RemovedEntry, compare_folders, compare_gta4_folders, list_changes, list_game_changes, originals_dir, }; -pub use overlay::{ModFile, ModFileKind, Origin, mods_dir, resolve, scan}; +pub use overlay::{ModFile, ModFileKind, Origin, mods_dir, overlay_path, resolve, scan}; diff --git a/crates/rage-mods/src/overlay.rs b/crates/rage-mods/src/overlay.rs index 40b67b5..8e57618 100644 --- a/crates/rage-mods/src/overlay.rs +++ b/crates/rage-mods/src/overlay.rs @@ -15,10 +15,85 @@ pub const MODS_FOLDER: &str = "mods"; /// ASI Loader) loads files from instead of the game's own. pub const UPDATE_FOLDER: &str = "update"; +/// Red Dead Redemption 2's counterpart: the "replace" folder of Lenny's Mod +/// Loader (LML), which loads `lml/replace//` in place of the +/// file at `` inside the game's `.rpf` (see [`rdr2_rel`]). +pub const LML_REPLACE_FOLDER: &str = "lml/replace"; + +/// Whether `game_dir` holds Red Dead Redemption 2 (`RDR2.exe`). +pub fn is_rdr2(game_dir: &Path) -> bool { + game_dir.join("RDR2.exe").is_file() +} + /// The overlay folder's name for the game in `game_dir`: `update` for GTA IV -/// (the folder holding `GTAIV.exe`), `mods` otherwise. +/// (the folder holding `GTAIV.exe`), `lml/replace` for RDR2, `mods` otherwise. pub fn folder_name(game_dir: &Path) -> &'static str { - if game_dir.join("GTAIV.exe").is_file() { UPDATE_FOLDER } else { MODS_FOLDER } + if game_dir.join("GTAIV.exe").is_file() { + UPDATE_FOLDER + } else if is_rdr2(game_dir) { + LML_REPLACE_FOLDER + } else { + MODS_FOLDER + } +} + +/// RDR2: a virtual path split at its top-level archive, `(archive, inner)` +/// (`update_4.rpf`, `x64/data/foo.ymt`); the archive path as found in the +/// game folder. `None` for paths outside the game's archives. +pub fn rdr2_split(game_dir: &Path, vpath: &str) -> Option<(String, String)> { + let segs: Vec<&str> = vpath.split(['/', '\\']).filter(|s| !s.is_empty()).collect(); + for n in 1..=segs.len() { + if !segs[n - 1].to_ascii_lowercase().ends_with(".rpf") { + continue; + } + let prefix = segs[..n].join("/"); + if let Some(found) = vfs::find_case_insensitive(game_dir, &prefix).filter(|p| p.is_file()) { + let archive = found.strip_prefix(game_dir).ok()?.to_string_lossy().replace('\\', "/"); + return Some((archive, segs[n..].join("/"))); + } + return None; + } + None +} + +/// RDR2: where a file inside one of the game's archives goes in the +/// `lml/replace` folder: the archive's path without `.rpf`, then the path +/// inside it (`update_4.rpf` + `x64/data/foo.ymt` → `update_4/x64/data/foo.ymt`). +pub fn rdr2_rel(archive: &str, inner: &str) -> String { + let stem = archive + .len() + .checked_sub(4) + .filter(|&n| archive[n..].eq_ignore_ascii_case(".rpf")) + .map_or(archive, |n| &archive[..n]); + if inner.is_empty() { stem.to_owned() } else { format!("{stem}/{inner}") } +} + +/// RDR2: the virtual path a file in the `lml/replace` folder stands for +/// (`update_4/x64/data/foo.ymt` → `update_4.rpf/x64/data/foo.ymt`), if the +/// game has the archive it names. +pub fn rdr2_vpath(game_dir: &Path, rel: &str) -> Option { + let segs: Vec<&str> = rel.split('/').filter(|s| !s.is_empty()).collect(); + for n in 1..segs.len() { + let archive = format!("{}.rpf", segs[..n].join("/")); + if let Some(found) = vfs::find_case_insensitive(game_dir, &archive).filter(|p| p.is_file()) { + let archive = found.strip_prefix(game_dir).ok()?.to_string_lossy().replace('\\', "/"); + return Some(format!("{archive}/{}", segs[n..].join("/"))); + } + } + None +} + +/// Where the overlay folder keeps the counterpart of a virtual path: +/// `mods/` (GTA IV: `update/`), or for RDR2 the `lml/replace` +/// path of a file inside an archive. The path need not exist. +pub fn overlay_path(game_dir: &Path, vpath: &str) -> Option { + let mods = game_dir.join(folder_name(game_dir)); + if is_rdr2(game_dir) { + let (archive, inner) = rdr2_split(game_dir, vpath)?; + let rel = rdr2_rel(&archive, &inner); + return Some(vfs::find_case_insensitive(&mods, &rel).unwrap_or_else(|| mods.join(rel))); + } + Some(vfs::find_case_insensitive(&mods, vpath).unwrap_or_else(|| mods.join(vpath))) } /// OpenRAGE's own data inside the mods folder (journal, temporary files); never part of a mod. @@ -29,7 +104,7 @@ pub const ORIGINALS_FOLDER: &str = "originals"; /// The `mods` folder of a game installation (GTA IV: the `update` folder), if present. pub fn mods_dir(game_dir: &Path) -> Option { - vfs::match_case_insensitive(game_dir, folder_name(game_dir)).filter(|p| p.is_dir()) + vfs::find_case_insensitive(game_dir, folder_name(game_dir)).filter(|p| p.is_dir()) } #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -53,6 +128,7 @@ pub struct ModFile { /// Lists every file in the mods folder and whether it replaces a game file. pub fn scan(game_dir: &Path) -> Vec { let Some(mods) = mods_dir(game_dir) else { return Vec::new() }; + let rdr2 = is_rdr2(game_dir); let mut out = Vec::new(); let mut stack = vec![(mods, String::new())]; while let Some((dir, rel_dir)) = stack.pop() { @@ -67,7 +143,17 @@ pub fn scan(game_dir: &Path) -> Vec { } continue; } - let replaces = vfs::find_case_insensitive(game_dir, &rel).is_some_and(|p| p.is_file()); + let (rel, replaces) = if rdr2 { + // `update_4/x64/…` stands for `update_4.rpf/x64/…`; whether the + // archive really has that file is not checked here. + match rdr2_vpath(game_dir, &rel) { + Some(v) => (v, true), + None => (rel, false), + } + } else { + let replaces = vfs::find_case_insensitive(game_dir, &rel).is_some_and(|p| p.is_file()); + (rel, replaces) + }; out.push(ModFile { kind: if replaces { ModFileKind::Replaces } else { ModFileKind::New }, size: meta.len(), @@ -98,6 +184,9 @@ pub enum Origin { /// listing of the returned (game) directory with the same folder in `mods`. pub fn resolve(game_dir: &Path, vpath: &str, keys: Option>) -> Result<(Node, Origin), RpfError> { let Some(mods) = mods_dir(game_dir) else { return Ok((vfs::resolve(game_dir, vpath, keys)?, Origin::Base)) }; + if is_rdr2(game_dir) { + return resolve_rdr2(game_dir, &mods, vpath, keys); + } let segments: Vec<&str> = vpath.split(['/', '\\']).filter(|s| !s.is_empty()).collect(); let mut prefix = String::new(); for seg in &segments { @@ -125,3 +214,29 @@ pub fn resolve(game_dir: &Path, vpath: &str, keys: Option>) -> Res let merged = vfs::find_case_insensitive(&mods, vpath).is_some_and(|p| p.is_dir()) || segments.is_empty(); Ok((node, if merged { Origin::Merged } else { Origin::Base })) } + +/// [`resolve`] for RDR2: inside a game archive, the first file on the path +/// that the `lml/replace` folder has (a replaced file, or a nested archive +/// that was changed) is taken from there. +fn resolve_rdr2( + game_dir: &Path, + mods: &Path, + vpath: &str, + keys: Option>, +) -> Result<(Node, Origin), RpfError> { + let Some((archive, inner)) = rdr2_split(game_dir, vpath) else { + return Ok((vfs::resolve(game_dir, vpath, keys)?, Origin::Base)); + }; + let segs: Vec<&str> = inner.split('/').filter(|s| !s.is_empty()).collect(); + let root = vfs::find_case_insensitive(mods, &rdr2_rel(&archive, "")); + if let Some(root) = &root { + for n in 1..=segs.len() { + if vfs::find_case_insensitive(root, &segs[..n].join("/")).is_some_and(|p| p.is_file()) { + return Ok((vfs::resolve(root, &inner, keys)?, Origin::Mods)); + } + } + } + let node = vfs::resolve(game_dir, vpath, keys)?; + let merged = root.is_some_and(|r| vfs::find_case_insensitive(&r, &inner).is_some_and(|p| p.is_dir())); + Ok((node, if merged { Origin::Merged } else { Origin::Base })) +} diff --git a/crates/rage-rpf/src/lib.rs b/crates/rage-rpf/src/lib.rs index 47e7f1a..216a8e0 100644 --- a/crates/rage-rpf/src/lib.rs +++ b/crates/rage-rpf/src/lib.rs @@ -28,6 +28,8 @@ mod rpf7; #[cfg(feature = "rdr2")] pub mod rpf8; #[cfg(feature = "rdr2")] +pub mod rpf8_editor; +#[cfg(feature = "rdr2")] pub mod rpf8_exe; #[cfg(feature = "rdr2")] pub mod rpf8_keys; diff --git a/crates/rage-rpf/src/rpf8.rs b/crates/rage-rpf/src/rpf8.rs index 2e95296..b696415 100644 --- a/crates/rage-rpf/src/rpf8.rs +++ b/crates/rage-rpf/src/rpf8.rs @@ -24,10 +24,13 @@ use rage_core::hash::joaat; use crate::RpfError; -const MAGIC: u32 = 0x5250_4638; -const HEADER_LEN: u64 = 16; -const SIGNATURE_LEN: u64 = 256; -const ENTRY_LEN: usize = 24; +pub(crate) const MAGIC: u32 = 0x5250_4638; +pub(crate) const HEADER_LEN: u64 = 16; +pub(crate) const SIGNATURE_LEN: u64 = 256; +pub(crate) const ENTRY_LEN: usize = 24; +/// `RSC8`: the start of a resource as stored in an archive, and of a +/// resource saved as a file of its own. +pub const RSC8_MAGIC: u32 = 0x3843_5352; /// Decryption tag of an archive whose entry table is not encrypted. pub const PLAINTEXT: u16 = 0xFF; @@ -93,6 +96,9 @@ pub struct Entry { pub size_or_flags: u64, /// The path, when the archive's name table or a name list knows it. pub path: Option, + /// The three words as stored, so that bits OpenRAGE does not interpret + /// survive a rewrite of the table. + pub(crate) raw: [u64; 3], } /// Extensions by id; `#` stands for the platform character. @@ -181,9 +187,54 @@ impl Entry { }, size_or_flags: q2, path: None, + raw: [q0, q1, q2], } } + /// A new entry for data stored as is (no key, no compression, unsigned). + pub fn new_plain(hash: u32, ext_id: u8, is_resource: bool, size_or_flags: u64) -> Entry { + Entry { + hash, + ext_id, + key_id: 0xFF, + encryption_config: 0, + is_resource, + signed: false, + offset: 0, + size_on_disk: 0, + compression: Compression::None, + size_or_flags, + path: None, + raw: [0; 3], + } + } + + /// The 24 bytes of this entry in a table. Bits that are not fields of + /// [`Entry`] keep their stored value. + pub fn to_bytes(&self) -> [u8; ENTRY_LEN] { + let [mut q0, mut q1, _] = self.raw; + q0 &= !(0xFFFF_FFFF | 0xFF << 32 | 0xFF << 40 | 0xFF << 48 | 0b11 << 56); + q0 |= u64::from(self.hash) + | u64::from(self.encryption_config) << 32 + | u64::from(self.key_id) << 40 + | u64::from(self.ext_id) << 48 + | u64::from(self.is_resource) << 56 + | u64::from(self.signed) << 57; + let comp = match self.compression { + Compression::None => 0, + Compression::Deflate => 1, + Compression::Oodle => 2, + Compression::Unknown(n) => u64::from(n), + }; + q1 &= !(0x0FFF_FFFF | 0x7FFF_FFFF << 28 | 0x1F << 59); + q1 |= (self.size_on_disk >> 4) & 0x0FFF_FFFF | ((self.offset >> 4) & 0x7FFF_FFFF) << 28 | (comp & 0x1F) << 59; + let mut out = [0u8; ENTRY_LEN]; + out[0..8].copy_from_slice(&q0.to_le_bytes()); + out[8..16].copy_from_slice(&q1.to_le_bytes()); + out[16..24].copy_from_slice(&self.size_or_flags.to_le_bytes()); + out + } + pub fn is_encrypted(&self) -> bool { self.key_id != 0xFF } @@ -269,6 +320,11 @@ pub fn default_keys() -> Option> { defaults().read().ok()?.0.clone() } +/// The names registered with [`set_defaults`]. +pub fn default_names() -> Option> { + defaults().read().ok()?.1.clone() +} + /// Whether keys were registered with [`set_defaults`]. pub fn has_default_keys() -> bool { defaults().read().is_ok_and(|d| d.0.is_some()) @@ -517,6 +573,53 @@ impl Rpf8 { self.entries.as_deref() } + /// An entry's bytes exactly as stored in the archive (still encrypted, + /// compressed and signed where the entry is). + pub fn read_stored(&self, entry: &Entry) -> Result, RpfError> { + self.read_stored_head(entry, entry.size_on_disk) + } + + /// The first `len` stored bytes of an entry (fewer if it is shorter). + pub fn read_stored_head(&self, entry: &Entry, len: u64) -> Result, RpfError> { + let mut f = File::open(&self.path)?; + f.seek(SeekFrom::Start(self.base + entry.offset))?; + let mut data = vec![0u8; len.min(entry.size_on_disk) as usize]; + f.read_exact(&mut data)?; + Ok(data) + } + + /// The archive's own name table (the last `names length` bytes) as stored. + pub fn read_name_table(&self) -> Result, RpfError> { + let len = u64::from(self.header.names_length); + let mut f = File::open(&self.path)?; + f.seek(SeekFrom::Start(self.base + self.size - len))?; + let mut data = vec![0u8; len as usize]; + f.read_exact(&mut data)?; + Ok(data) + } + + /// A resource entry as a file of its own: the 16-byte `RSC8` header + /// (marked uncompressed) followed by the virtual and physical pages. + /// [`resource_file_flags`] reads such a file back; the archive editor + /// stores it as is. + pub fn resource_file(&self, entry: &Entry) -> Result, RpfError> { + let pages = self.read(entry)?; + let stored = self.read_stored_head(entry, 16)?; + let info = + if stored.len() == 16 && u32::from_le_bytes(stored[0..4].try_into().unwrap_or_default()) == RSC8_MAGIC { + u32::from_le_bytes(stored[4..8].try_into().unwrap_or_default()) + } else { + // An encrypted prefix: the version is all that is known. + entry.resource_version().unwrap_or(0) + }; + let mut out = Vec::with_capacity(16 + pages.len()); + out.extend(RSC8_MAGIC.to_le_bytes()); + out.extend(uncompressed_info(info).to_le_bytes()); + out.extend(entry.size_or_flags.to_le_bytes()); + out.extend(pages); + Ok(out) + } + /// Reads an entry's data: decrypted and decompressed (deflate or Oodle). /// Resources come without their 16-byte on-disk prefix: virtual pages, /// then physical pages. @@ -605,6 +708,40 @@ impl Rpf8 { } } +/// The info word of an `RSC8` header with its compressor field (bits 8–12, +/// the compression id minus one) set to "none" (0x1F). +pub fn uncompressed_info(info: u32) -> u32 { + info | 0x1F << 8 +} + +/// The page flags of a resource saved as a file of its own (`RSC8` header), +/// which become the entry's [`Entry::size_or_flags`]; `None` if `file` is no +/// such resource or its pages are shorter than the flags say. +pub fn resource_file_flags(file: &[u8]) -> Option { + if file.len() < 16 || u32::from_le_bytes(file[0..4].try_into().ok()?) != RSC8_MAGIC { + return None; + } + let flags = u64::from_le_bytes(file[8..16].try_into().ok()?); + let size = (flags & 0xFFFF_FFF0) + (flags >> 32 & 0xFFFF_FFF0); + (file.len() as u64 - 16 >= size).then_some(flags) +} + +/// Reads a resource saved as a file of its own (`RSC8` header, uncompressed +/// pages, as [`Rpf8::resource_file`] writes it), e.g. a replacement in LML's +/// replace folder. +pub fn parse_resource_file(file: &[u8]) -> Option { + let flags = resource_file_flags(file)?; + let virtual_len = (flags & 0xFFFF_FFF0) as usize; + let physical_len = (flags >> 32 & 0xFFFF_FFF0) as usize; + let version = ((flags as u32 & 0xF) << 4) | ((flags >> 32) as u32 & 0xF); + let pages = &file[16..]; + Some(rage_resource::Resource { + version, + system: pages[..virtual_len].to_vec(), + graphics: pages[virtual_len..virtual_len + physical_len].to_vec(), + }) +} + /// Matches the NUL-separated paths of a name table to the entries. fn apply_names(entries: &mut [Entry], names: &[u8], platform: char) { for name in names.split(|&b| b == 0).filter(|n| !n.is_empty()) { diff --git a/crates/rage-rpf/src/rpf8_editor.rs b/crates/rage-rpf/src/rpf8_editor.rs new file mode 100644 index 0000000..8d33731 --- /dev/null +++ b/crates/rage-rpf/src/rpf8_editor.rs @@ -0,0 +1,453 @@ +//! Editing an RPF8 archive (Red Dead Redemption 2) in place. +//! +//! Works like the RPF7 [`ArchiveEditor`](crate::ArchiveEditor): new and +//! changed entries are appended at the end of the file, and the header and +//! entry table at the start are rewritten. Entries whose data lies where a +//! grown table goes are copied to the end as they are stored (the cipher of +//! an entry does not depend on its position). Data of replaced or removed +//! entries stays in the file, unreferenced. +//! +//! What is written: +//! - The entry table in **plain text** (decryption tag 0xFF). OpenRAGE can +//! only decrypt RDR2's cipher, not encrypt with it; the game reads plain +//! tables (its own tools write them, and mods built this way load). +//! - The 256-byte signature after the header is kept as it was. It no +//! longer matches the changed table; the game does not reject it for +//! archives loaded through a mod loader. +//! - Entries untouched by the change keep their stored bytes: encrypted, +//! compressed and signed as before. +//! - New data is stored as is: not encrypted, not compressed, not signed. +//! Resources are written from an `RSC8` file ([`Rpf8::resource_file`]). +//! - The archive's name table: rewritten with every known path when it was +//! readable (plain text), otherwise kept byte for byte. +//! +//! RPF8 has no folders; paths are only hashed. A path given here is hashed +//! the way [`path_hash`] does it, or names an unnamed entry as +//! `hash/XXXXXXXX.ext`. +//! +//! Every commit hands a [`Backup`] of the overwritten start of the file and +//! the old length to the caller before anything is written; it undoes the +//! commit exactly ([`Backup::restore`]). + +use std::fs::OpenOptions; +use std::io::{Read, Seek, SeekFrom, Write}; +use std::path::{Path, PathBuf}; +use std::sync::Arc; + +use crate::RpfError; +use crate::editor::{Backup, CommitStats}; +use crate::rpf8::{ + Compression, ENTRY_LEN, Entry, HEADER_LEN, MAGIC, PLAINTEXT, Rdr2Keys, Rpf8, SIGNATURE_LEN, extension, path_hash, + resource_file_flags, +}; +use crate::rpf8_names::NameIndex; + +fn err(msg: impl Into) -> RpfError { + RpfError::CorruptToc { archive: "RPF8 editor".into(), reason: msg.into() } +} + +/// What an entry's data will be after the commit. +enum Data { + /// Stored bytes at this offset of the original file. + Existing(u64), + /// New bytes, stored as is. + New(Vec), +} + +struct Slot { + entry: Entry, + data: Data, +} + +pub struct Rpf8Editor { + path: PathBuf, + rpf: Rpf8, + slots: Vec, + /// The original name table, when it is not plain text (kept as is). + opaque_names: Option>, + /// Paths of new or renamed entries, for callers that keep names elsewhere. + added_names: Vec, + changed: bool, +} + +/// Parses `hash/XXXXXXXX[.ext]`, the name of an entry whose path is unknown. +fn hash_name(path: &str, platform: char) -> Option<(u32, Option)> { + let rest = path.strip_prefix("hash/")?; + let (hex, ext) = match rest.split_once('.') { + Some((h, e)) => (h, Some(e)), + None => (rest, None), + }; + if hex.len() != 8 { + return None; + } + let hash = u32::from_str_radix(hex, 16).ok()?; + let ext = match ext { + Some(e) => Some(crate::rpf8::extension_id(&e.to_ascii_lowercase(), platform)?), + None => None, + }; + Some((hash, ext)) +} + +fn normalize(path: &str) -> String { + path.replace('\\', "/").split('/').filter(|s| !s.is_empty()).collect::>().join("/") +} + +/// Whether a name table is plain text: NUL-separated printable paths. +fn plain_names(blob: &[u8]) -> bool { + !blob.is_empty() + && blob + .split(|&b| b == 0) + .filter(|n| !n.is_empty()) + .all(|n| std::str::from_utf8(n).is_ok_and(|s| s.bytes().all(|b| b.is_ascii_graphic() || b == b' '))) +} + +impl Rpf8Editor { + /// Opens a top-level archive file for editing. Its entry table must be + /// readable: plain, or encrypted with a key in `keys`. + pub fn open(path: &Path, keys: Option>, names: Option>) -> Result { + let mut rpf = Rpf8::open_with_keys(path, keys)?; + if let Some(n) = names { + rpf.set_names(n); + } + let entries = rpf + .entries() + .ok_or_else(|| RpfError::KeysRequired(format!("{} (its entry table is encrypted)", path.display())))? + .to_vec(); + let header = rpf.header(); + let opaque_names = if header.names_length == 0 { + None + } else { + let blob = rpf.read_name_table()?; + (!plain_names(&blob)).then_some(blob) + }; + let slots = entries.into_iter().map(|entry| Slot { data: Data::Existing(entry.offset), entry }).collect(); + Ok(Self { path: path.to_owned(), rpf, slots, opaque_names, added_names: Vec::new(), changed: false }) + } + + pub fn path(&self) -> &Path { + &self.path + } + + /// The archive as it was when opened (for reading entries, e.g. nested archives). + pub fn archive(&self) -> &Rpf8 { + &self.rpf + } + + pub fn platform(&self) -> char { + self.rpf.platform() + } + + /// Paths given to new or renamed entries in this session. + pub fn added_names(&self) -> &[String] { + &self.added_names + } + + /// The display name of a slot, as [`Rpf8::entry_name`] would give it. + fn name_of(&self, slot: &Slot) -> String { + slot.entry.display_name(self.platform()) + } + + /// The slot a path names: by its known path, as `hash/…`, or by its hash. + fn find(&self, path: &str) -> Option { + let path = normalize(path); + if let Some(i) = self.slots.iter().position(|s| self.name_of(s).eq_ignore_ascii_case(&path)) { + return Some(i); + } + // Entries the reader shows under `hash/` with an extension of its + // own choosing (audio containers): match by hash alone. + if let Some((hash, ext)) = hash_name(&path, self.platform()) { + return self + .slots + .iter() + .position(|s| s.entry.hash == hash && ext.is_none_or(|e| e == s.entry.ext_id)) + .or_else(|| self.slots.iter().position(|s| s.entry.hash == hash && s.entry.path.is_none())); + } + let (hash, ext) = path_hash(&path, self.platform()); + self.slots.iter().position(|s| s.entry.hash == hash && s.entry.ext_id == ext) + } + + /// Whether the archive has an entry at `path`. + pub fn exists(&self, path: &str) -> bool { + self.find(path).is_some() + } + + /// Whether `dir` is a folder: some entry's path starts with it. + pub fn is_dir(&self, dir: &str) -> bool { + let prefix = format!("{}/", normalize(dir).to_ascii_lowercase()); + self.slots.iter().any(|s| self.name_of(s).to_ascii_lowercase().starts_with(&prefix)) + } + + /// The hash and extension id a new entry at `path` gets. + fn new_key(&self, path: &str) -> (u32, u8) { + match hash_name(path, self.platform()) { + Some((hash, Some(ext))) => (hash, ext), + Some((hash, None)) => (hash, 0xFF), + None => path_hash(path, self.platform()), + } + } + + /// Adds or replaces the file at `path`. Data starting with an `RSC8` + /// header becomes a resource; anything else a plain file. + pub fn set(&mut self, path: &str, data: Vec) -> Result<(), RpfError> { + let path = normalize(path); + if path.is_empty() { + return Err(err("empty path")); + } + let (mut entry, data) = match resource_file_flags(&data) { + Some(flags) => { + let size = (flags & 0xFFFF_FFF0) + (flags >> 32 & 0xFFFF_FFF0); + let mut stored = data; + stored.truncate(16 + size as usize); + (Entry::new_plain(0, 0, true, flags), stored) + } + None => { + let len = data.len() as u64; + (Entry::new_plain(0, 0, false, len), data) + } + }; + match self.find(&path) { + Some(i) => { + let old = &self.slots[i].entry; + if old.is_resource != entry.is_resource { + let what = |r: bool| if r { "a resource (RSC8 file)" } else { "a plain file" }; + return Err(err(format!( + "{path} is {} in the archive; the new data is {}", + what(old.is_resource), + what(entry.is_resource) + ))); + } + entry.hash = old.hash; + entry.ext_id = old.ext_id; + entry.path = old.path.clone(); + self.slots[i] = Slot { entry, data: Data::New(data) }; + } + None => { + if self.is_dir(&path) { + return Err(err(format!("{path} is a folder"))); + } + let (hash, ext) = self.new_key(&path); + if entry.is_resource && ext == 0xFF { + return Err(err(format!("{path}: resources need one of the archive's resource extensions"))); + } + entry.hash = hash; + entry.ext_id = ext; + entry.path = hash_name(&path, self.platform()).is_none().then(|| path.clone()); + if entry.path.is_some() { + self.added_names.push(path.clone()); + } + self.slots.push(Slot { entry, data: Data::New(data) }); + } + } + self.changed = true; + Ok(()) + } + + /// Removes a file, or every file below a folder. Returns how many entries went. + pub fn remove(&mut self, path: &str) -> usize { + let path = normalize(path); + let prefix = format!("{}/", path.to_ascii_lowercase()); + let single = self.find(&path); + let before = self.slots.len(); + let names: Vec = self.slots.iter().map(|s| self.name_of(s).to_ascii_lowercase()).collect(); + let mut i = 0; + self.slots.retain(|_| { + let keep = Some(i) != single && !names[i].starts_with(&prefix); + i += 1; + keep + }); + let removed = before - self.slots.len(); + self.changed |= removed > 0; + removed + } + + /// Renames a file, or every file below a folder: the entries get the + /// hashes of their new paths. + pub fn rename(&mut self, from: &str, to: &str) -> Result<(), RpfError> { + let (from, to) = (normalize(from), normalize(to)); + if to.is_empty() { + return Err(err("empty path")); + } + let moves: Vec<(usize, String)> = match self.find(&from) { + Some(i) => vec![(i, to.clone())], + None => { + let prefix = format!("{}/", from.to_ascii_lowercase()); + self.slots + .iter() + .enumerate() + .filter_map(|(i, s)| { + let name = self.name_of(s); + name.to_ascii_lowercase() + .starts_with(&prefix) + .then(|| (i, format!("{to}{}", &name[from.len()..]))) + }) + .collect() + } + }; + if moves.is_empty() { + return Err(RpfError::NotFound(from)); + } + for (i, new) in &moves { + if hash_name(new, self.platform()).is_some() { + return Err(err(format!("{new}: give the entry a real name"))); + } + let (hash, ext) = path_hash(new, self.platform()); + let old = &self.slots[*i].entry; + if ext != old.ext_id { + let shown = |id: u8| extension(id, self.platform()).unwrap_or_else(|| "none".into()); + return Err(err(format!( + "{new}: the extension cannot change ({} → {})", + shown(old.ext_id), + shown(ext) + ))); + } + if let Some(j) = self.find(new).filter(|j| j != i) { + return Err(err(format!("{} already exists", self.name_of(&self.slots[j])))); + } + let e = &mut self.slots[*i].entry; + e.hash = hash; + e.path = Some(new.clone()); + self.added_names.push(new.clone()); + } + self.changed = true; + Ok(()) + } + + /// The name table to write: every known path (plain), or the original one. + fn name_table(&self) -> Vec { + if let Some(blob) = &self.opaque_names { + return blob.clone(); + } + if self.rpf.header().names_length == 0 && self.added_names.is_empty() { + return Vec::new(); + } + let mut paths: Vec<&str> = self.slots.iter().filter_map(|s| s.entry.path.as_deref()).collect(); + paths.sort_unstable(); + paths.dedup(); + let mut out = Vec::new(); + for p in paths { + out.extend(p.as_bytes()); + out.push(0); + } + out + } + + /// Writes all changes. `before_write` receives the backup and must keep + /// it (e.g. in a journal) before the archive is touched; an error aborts. + pub fn commit( + mut self, + before_write: &mut dyn FnMut(&Backup) -> Result<(), RpfError>, + ) -> Result { + if !self.changed { + return Ok(CommitStats::default()); + } + let old_len = std::fs::metadata(&self.path)?.len(); + // The game binary-searches the table by hash. + self.slots.sort_by_key(|s| s.entry.hash); + let count = self.slots.len(); + let table_end = HEADER_LEN + SIGNATURE_LEN + (count * ENTRY_LEN) as u64; + let data_start = table_end.next_multiple_of(16); + + // Where every entry's data goes: unchanged entries stay unless the + // table now covers them; the rest is appended after the old end. + let mut cursor = old_len.next_multiple_of(16).max(data_start); + let mut writes: Vec<(u64, Vec)> = Vec::new(); + let mut relocated = 0; + let mut stored: Vec> = Vec::new(); + for slot in &self.slots { + if let Data::Existing(offset) = slot.data + && offset < data_start + && slot.entry.size_on_disk > 0 + { + stored.push(self.rpf.read_stored(&slot.entry)?); + relocated += 1; + } + } + let mut moved = stored.into_iter(); + for slot in &mut self.slots { + let bytes = match &mut slot.data { + Data::New(d) => Some(std::mem::take(d)), + Data::Existing(offset) if *offset < data_start && slot.entry.size_on_disk > 0 => { + Some(moved.next().expect("read above")) + } + Data::Existing(_) => None, + }; + if let Some(bytes) = bytes { + let len = bytes.len() as u64; + slot.entry.offset = if len == 0 { 0 } else { cursor }; + if matches!(slot.data, Data::New(_)) { + slot.entry.size_on_disk = len.next_multiple_of(16); + slot.entry.compression = Compression::None; + } + if len > 0 { + writes.push((cursor, bytes)); + cursor += len.next_multiple_of(16); + } + } + if slot.entry.size_on_disk > 0x0FFF_FFFF << 4 || slot.entry.offset > 0x7FFF_FFFF << 4 { + return Err(err(format!("{}: too large for an RPF8 entry", self_name(&slot.entry)))); + } + } + // The name table ends the archive, which ends on a 16-byte boundary + // (nested archives are as long as their entry's 16-byte rounded size). + let names = self.name_table(); + let names_at = (cursor + names.len() as u64).next_multiple_of(16) - names.len() as u64; + let new_len = names_at + names.len() as u64; + + let header = self.rpf.header(); + let mut table = Vec::with_capacity(data_start as usize); + table.extend(MAGIC.to_le_bytes()); + table.extend((count as u32).to_le_bytes()); + table.extend((names.len() as u32).to_le_bytes()); + table.extend(PLAINTEXT.to_le_bytes()); + // Platform letter and the byte after it, as they were. + let mut f = OpenOptions::new().read(true).write(true).open(&self.path)?; + let mut region = vec![0u8; data_start.min(old_len) as usize]; + f.read_exact(&mut region)?; + table.push(header.platform as u8); + table.push(region.get(15).copied().unwrap_or(0)); + // The signature block stays. + table.extend(®ion[HEADER_LEN as usize..(HEADER_LEN + SIGNATURE_LEN) as usize]); + for slot in &self.slots { + table.extend(slot.entry.to_bytes()); + } + table.resize(data_start as usize, 0); + + let backup = Backup { old_len, new_len, region }; + before_write(&backup)?; + + let appended: u64 = writes.iter().map(|(_, b)| b.len() as u64).sum(); + for (at, bytes) in &writes { + f.seek(SeekFrom::Start(*at))?; + f.write_all(bytes)?; + } + f.set_len(names_at)?; + f.seek(SeekFrom::Start(names_at))?; + f.write_all(&names)?; + f.set_len(new_len)?; + f.sync_data()?; + f.seek(SeekFrom::Start(0))?; + f.write_all(&table)?; + f.sync_all()?; + Ok(CommitStats { changed: true, appended, relocated, new_len }) + } +} + +/// An RPF8 archive without entries (plain table, empty signature, PC), to +/// fill with [`Rpf8Editor`]. +pub fn empty_archive() -> Vec { + let mut out = Vec::with_capacity((HEADER_LEN + SIGNATURE_LEN) as usize); + out.extend(MAGIC.to_le_bytes()); + out.extend(0u32.to_le_bytes()); + out.extend(0u32.to_le_bytes()); + out.extend(PLAINTEXT.to_le_bytes()); + out.extend([b'y', 0]); + out.resize((HEADER_LEN + SIGNATURE_LEN) as usize, 0); + out +} + +fn self_name(e: &Entry) -> String { + e.path.clone().unwrap_or_else(|| format!("hash/{:08X}", e.hash)) +} + +#[cfg(test)] +mod tests; diff --git a/crates/rage-rpf/src/rpf8_editor/tests.rs b/crates/rage-rpf/src/rpf8_editor/tests.rs new file mode 100644 index 0000000..165888a --- /dev/null +++ b/crates/rage-rpf/src/rpf8_editor/tests.rs @@ -0,0 +1,212 @@ +use super::*; +use crate::rpf8::RSC8_MAGIC; + +/// A plain RPF8 archive with these files (stored as is) and, if `names`, a +/// plain name table. Entries are packed right after the table, without +/// slack, like the game's archives. +fn build(files: &[(&str, &[u8])], names: bool) -> Vec { + let mut entries: Vec<(Entry, &[u8])> = files + .iter() + .map(|(p, d)| { + let (hash, ext) = path_hash(p, 'y'); + let mut e = Entry::new_plain(hash, ext, false, d.len() as u64); + e.path = Some((*p).to_owned()); + (e, *d) + }) + .collect(); + entries.sort_by_key(|(e, _)| e.hash); + let table_end = (HEADER_LEN + SIGNATURE_LEN) as usize + entries.len() * ENTRY_LEN; + let mut data = Vec::new(); + let mut at = table_end.next_multiple_of(16) as u64; + for (e, d) in &mut entries { + e.offset = at; + e.size_on_disk = (d.len() as u64).next_multiple_of(16); + data.extend(*d); + data.resize(data.len().next_multiple_of(16), 0); + at += e.size_on_disk; + } + let blob: Vec = + if names { files.iter().flat_map(|(p, _)| [p.as_bytes(), b"\0"].concat()).collect() } else { Vec::new() }; + let mut out = Vec::new(); + out.extend(MAGIC.to_le_bytes()); + out.extend((entries.len() as u32).to_le_bytes()); + out.extend((blob.len() as u32).to_le_bytes()); + out.extend(PLAINTEXT.to_le_bytes()); + out.extend([b'y', 0]); + out.extend((0..=255u8).collect::>()); + for (e, _) in &entries { + out.extend(e.to_bytes()); + } + out.resize(table_end.next_multiple_of(16), 0); + out.extend(data); + out.extend(blob); + out +} + +fn temp(name: &str, bytes: &[u8]) -> (PathBuf, PathBuf) { + let dir = std::env::temp_dir().join(format!("openrage-rpf8-edit-{}-{name}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join("t.rpf"); + std::fs::write(&path, bytes).unwrap(); + (dir, path) +} + +fn read(rpf: &Rpf8, path: &str) -> Vec { + let i = rpf.find(path).unwrap_or_else(|| panic!("{path} missing")); + rpf.read(&rpf.entries().unwrap()[i]).unwrap() +} + +fn commit(editor: Rpf8Editor) -> (CommitStats, Backup) { + let mut kept = None; + let stats = editor + .commit(&mut |b| { + kept = Some(b.clone()); + Ok(()) + }) + .unwrap(); + (stats, kept.unwrap()) +} + +#[test] +fn entries_round_trip_through_bytes() { + let mut raw = [0u8; 24]; + raw[..8] + .copy_from_slice(&(0x1234_5678u64 | 3 << 32 | 7 << 40 | 5 << 48 | 1 << 56 | 1 << 58 | 1 << 63).to_le_bytes()); + raw[8..16].copy_from_slice(&(0x40u64 >> 4 | (0x1230u64 >> 4) << 28 | 2 << 59).to_le_bytes()); + raw[16..].copy_from_slice(&0xABCD_EF01u64.to_le_bytes()); + let e = Entry::parse(&raw); + assert_eq!(e.to_bytes(), raw, "unknown bits survive"); +} + +#[test] +fn edits_read_back_and_undo_exactly() { + let original = build(&[("data/a.txt", b"first file"), ("data/b.txt", b"second"), ("data/c.ymt", b"meta")], true); + let (dir, path) = temp("edit", &original); + + let mut ed = Rpf8Editor::open(&path, None, None).unwrap(); + ed.set("data/a.txt", b"replaced, and longer than before".to_vec()).unwrap(); + // Two new entries grow the table over the first entry's data. + ed.set("data/new.txt", b"brand new".to_vec()).unwrap(); + ed.set("data/more/d.txt", vec![7; 40]).unwrap(); + ed.set("data/more/e.txt", vec![8; 3]).unwrap(); + ed.set("data/more/f.txt", Vec::new()).unwrap(); + assert_eq!(ed.remove("data/b.txt"), 1); + ed.rename("data/c.ymt", "data/renamed.ymt").unwrap(); + assert!(ed.rename("data/renamed.ymt", "data/x.ydr").is_err(), "extension ids cannot change"); + let (stats, backup) = commit(ed); + assert!(stats.changed); + assert!(stats.relocated >= 1, "the grown table pushed an entry to the end"); + assert_eq!(std::fs::metadata(&path).unwrap().len() % 16, 0); + + let rpf = Rpf8::open(&path).unwrap(); + assert!(!rpf.header().is_encrypted()); + assert_eq!(rpf.entries().unwrap().len(), 6); + assert_eq!(read(&rpf, "data/more/f.txt"), b""); + assert_eq!(read(&rpf, "data/a.txt"), b"replaced, and longer than before"); + assert_eq!(read(&rpf, "data/new.txt"), b"brand new"); + assert_eq!(read(&rpf, "data/more/d.txt"), vec![7; 40]); + assert_eq!(read(&rpf, "data/renamed.ymt"), b"meta"); + assert!(rpf.find("data/b.txt").is_none()); + let hashes: Vec = rpf.entries().unwrap().iter().map(|e| e.hash).collect(); + assert!(hashes.is_sorted(), "sorted by hash for the game's binary search"); + // The signature block is kept. + let now = std::fs::read(&path).unwrap(); + assert_eq!(now[16..272], original[16..272]); + + backup.restore(&path).unwrap(); + assert_eq!(std::fs::read(&path).unwrap(), original, "undo gives the original bytes back"); + std::fs::remove_dir_all(dir).ok(); +} + +#[test] +fn resources_are_stored_from_rsc8_files() { + let original = build(&[("a.txt", b"x")], false); + let (dir, path) = temp("rsc", &original); + let pages = vec![0x5Au8; 0x30]; + // 0x20 bytes of virtual pages, 0x10 of physical ones, version 2. + let flags: u64 = 0x20 | 0x10 << 32 | 2; + let mut file = Vec::new(); + file.extend(RSC8_MAGIC.to_le_bytes()); + file.extend(crate::rpf8::uncompressed_info(2).to_le_bytes()); + file.extend(flags.to_le_bytes()); + file.extend(&pages); + let mut ed = Rpf8Editor::open(&path, None, None).unwrap(); + assert!(ed.set("textures/t.ytd", b"not a resource".to_vec()).is_ok()); + assert!(ed.set("textures/t.ytd", file.clone()).is_err(), "a plain file cannot become a resource"); + assert!(ed.remove("textures/t.ytd") == 1); + ed.set("textures/t.ytd", file.clone()).unwrap(); + commit(ed); + let rpf = Rpf8::open(&path).unwrap(); + let e = &rpf.entries().unwrap()[rpf.find("textures/t.ytd").expect("named by the new name table")]; + assert!(e.is_resource); + assert_eq!(e.size_or_flags, flags); + let res = rpf.read_resource(e).unwrap(); + assert_eq!(res.system.len(), 0x20); + assert_eq!(res.graphics.len(), 0x10); + assert_eq!(rpf.resource_file(e).unwrap(), file, "exported again as the same file"); + let loose = crate::rpf8::parse_resource_file(&file).unwrap(); + assert_eq!((loose.version, loose.system, loose.graphics), (res.version, res.system, res.graphics)); + std::fs::remove_dir_all(dir).ok(); +} + +#[test] +fn unreadable_name_tables_are_kept() { + let mut original = build(&[("a.txt", b"alpha"), ("b.txt", b"beta")], true); + // Scramble the name table, as the game's encrypted ones look. + let n = original.len(); + for b in &mut original[n - 12..] { + *b ^= 0x9C; + } + let (dir, path) = temp("names", &original); + let blob = original[n - 12..].to_vec(); + let mut ed = Rpf8Editor::open(&path, None, None).unwrap(); + let (ha, _) = path_hash("a.txt", 'y'); + ed.set(&format!("hash/{ha:08X}"), b"ALPHA".to_vec()).unwrap(); + ed.set("c.txt", b"gamma".to_vec()).unwrap(); + assert_eq!(ed.added_names().len(), 1); + commit(ed); + let now = std::fs::read(&path).unwrap(); + assert_eq!(now[now.len() - 12..], blob[..]); + let rpf = Rpf8::open(&path).unwrap(); + assert_eq!(read(&rpf, &format!("hash/{ha:08X}")), b"ALPHA"); + std::fs::remove_dir_all(dir).ok(); +} + +#[test] +fn nested_archives_open_after_a_rebuild() { + let inner = build(&[("x.txt", b"inside")], true); + let outer = build(&[("data/inner.rpf", &inner), ("data/y.txt", b"outside")], true); + let (dir, path) = temp("nested", &outer); + // Change the nested archive in a file of its own, then put it back. + let inner_path = dir.join("inner.rpf"); + let rpf = Rpf8::open(&path).unwrap(); + std::fs::write(&inner_path, read(&rpf, "data/inner.rpf")).unwrap(); + let mut sub = Rpf8Editor::open(&inner_path, None, None).unwrap(); + sub.set("x.txt", b"changed inside".to_vec()).unwrap(); + sub.set("z.txt", b"new inside".to_vec()).unwrap(); + commit(sub); + let mut ed = Rpf8Editor::open(&path, None, None).unwrap(); + ed.set("data/inner.rpf", std::fs::read(&inner_path).unwrap()).unwrap(); + commit(ed); + + let rpf = Rpf8::open(&path).unwrap(); + let e = &rpf.entries().unwrap()[rpf.find("data/inner.rpf").unwrap()]; + let child = rpf.open_child(e).unwrap(); + assert_eq!(read(&child, "x.txt"), b"changed inside"); + assert_eq!(read(&child, "z.txt"), b"new inside"); + assert_eq!(read(&rpf, "data/y.txt"), b"outside"); + std::fs::remove_dir_all(dir).ok(); +} + +#[test] +fn archives_grow_from_nothing() { + let (dir, path) = temp("empty", &empty_archive()); + assert_eq!(Rpf8::open(&path).unwrap().entries().unwrap().len(), 0); + let mut ed = Rpf8Editor::open(&path, None, None).unwrap(); + ed.set("x64/data/a.ymt", b"a".to_vec()).unwrap(); + assert!(ed.set("x64/data", b"b".to_vec()).is_err(), "a folder of another entry"); + commit(ed); + let rpf = Rpf8::open(&path).unwrap(); + assert_eq!(read(&rpf, "x64/data/a.ymt"), b"a"); + std::fs::remove_dir_all(dir).ok(); +} diff --git a/crates/rage-rpf/src/rpf8_names.rs b/crates/rage-rpf/src/rpf8_names.rs index 9683607..4558087 100644 --- a/crates/rage-rpf/src/rpf8_names.rs +++ b/crates/rage-rpf/src/rpf8_names.rs @@ -95,6 +95,41 @@ impl NameIndex { self.names.len() - before } + /// Adds the path of an entry that OpenRAGE created or renamed: trusted, + /// stored under the hash [`crate::rpf8::path_hash`] gives it. + pub fn add_path(&mut self, path: &str, platform: char) { + let path = path.to_ascii_lowercase().replace('\\', "/"); + let (hash, ext) = crate::rpf8::path_hash(&path, platform); + let name = + if ext == 0xFF { path } else { path.rsplit_once('.').map_or(path.clone(), |(stem, _)| stem.to_owned()) }; + self.names.insert(hash, name); + self.files.insert(hash, IMPORTED); + self.untrusted.remove(&hash); + } + + /// Adds the `x64/…` form of every trusted path. The game's files mostly + /// name paths without it (`data/ui/startup_data`), while the update + /// archives hash the full path (`x64/data/ui/startup_data`). Returns how + /// many were added. + pub fn add_x64_forms(&mut self) -> usize { + let derived: Vec<(u32, String, u32)> = self + .names + .iter() + .filter(|(h, n)| self.trusted(**h) && n.contains('/') && !n.contains(':') && !n.starts_with("x64/")) + .map(|(h, n)| { + let full = format!("x64/{n}"); + (joaat(&full), full, self.files.get(h).copied().unwrap_or(1)) + }) + .filter(|(h, _, _)| !self.names.contains_key(h)) + .collect(); + let added = derived.len(); + for (h, n, files) in derived { + self.names.insert(h, n); + self.files.insert(h, files); + } + added + } + /// Whether the name for a hash is trusted (see [`NameIndex::judge`]). pub fn trusted(&self, hash: u32) -> bool { self.names.contains_key(&hash) && !self.untrusted.contains(&hash) @@ -380,19 +415,19 @@ mod tests { assert_eq!(idx.add_list("P_Chair01x.ydr\ncommon:/data/x.meta\nnope\n", &wanted), 2); let back = NameIndex::from_text(&idx.to_text()).unwrap(); assert_eq!(back, idx); - let e = Entry { - hash: joaat("p_chair01x"), - ext_id: 2, - key_id: 0xFF, - encryption_config: 0, - is_resource: true, - signed: false, - offset: 0, - size_on_disk: 0, - compression: crate::rpf8::Compression::None, - size_or_flags: 0, - path: None, - }; + let e = Entry::new_plain(joaat("p_chair01x"), 2, true, 0); assert_eq!(idx.name_for(&e, 'y').as_deref(), Some("p_chair01x.ydr")); } + + #[test] + fn x64_forms_and_own_paths() { + let mut idx = NameIndex::default(); + idx.add_path("data/ui/startup_data.rpf", 'y'); + idx.add_path("pack:/x.clip", 'y'); + assert_eq!(idx.add_x64_forms(), 1, "paths only, without mount prefixes"); + let e = Entry::new_plain(joaat("x64/data/ui/startup_data"), 0, false, 0); + assert_eq!(idx.name_for(&e, 'y').as_deref(), Some("x64/data/ui/startup_data.rpf")); + let plain = Entry::new_plain(joaat("data/ui/startup_data"), 0, false, 0); + assert_eq!(idx.name_for(&plain, 'y').as_deref(), Some("data/ui/startup_data.rpf")); + } } diff --git a/site/content/modding.md b/site/content/modding.md index db8357f..1690141 100644 --- a/site/content/modding.md +++ b/site/content/modding.md @@ -4,12 +4,17 @@ description = "Change the game safely with OpenRAGE: edit mode, editing archives [extra] docs = true -lead = "Every change goes to OpenIV's `mods` folder, never into your game files, and every change can be undone." +lead = "Every change goes to OpenIV's `mods` folder (RDR2: the replace folder of Lenny's Mod Loader), never into your game files, and every change can be undone." toc = true +++ ## Edit mode +> [!NOTE] +> **Red Dead Redemption 2** works the same way, but changes go into `lml/replace`, the replace folder of +> [Lenny's Mod Loader](https://www.rdr2mods.com/downloads/rdr2/tools/76-lennys-mod-loader-rdr/): changed files +> loose, changed nested archives as copies. See [Changing files](@/rdr2.md#changing-files) for what LML allows. + OpenRAGE starts read-only, like OpenIV. - **Read-only → Editing** in the toolbar (or Edit → Unlock editing…) unlocks changes, once per session. diff --git a/site/content/rdr2.md b/site/content/rdr2.md index b621418..a3387bd 100644 --- a/site/content/rdr2.md +++ b/site/content/rdr2.md @@ -1,10 +1,10 @@ +++ title = "Red Dead Redemption 2" -description = "Red Dead Redemption 2 in OpenRAGE: setting up the keys from your own game, file names, archives, textures, models, peds, animations, metadata, audio and texts." +description = "Red Dead Redemption 2 in OpenRAGE: setting up the keys from your own game, file names, archives, changing files through Lenny's Mod Loader, textures, models, peds, animations, metadata, audio and texts." [extra] docs = true -lead = "Explore RDR2 with keys from your own game. Read-only for now." +lead = "Explore and mod RDR2 with keys from your own game. Changes go into the replace folder of Lenny's Mod Loader, never into the game's archives." toc = true +++ @@ -59,8 +59,8 @@ Only the Steam version of 2 April 2024 is known so far; other versions report wh | What | Files | Status | |---|---|---| -| Archives | `.rpf` (RPF8) | browse and extract | -| Textures | `.ytd` | view, export DDS/PNG | +| Archives | `.rpf` (RPF8) | browse, extract, change (into `lml/replace`, with undo) | +| Textures | `.ytd` | view, export DDS/PNG, replace (same format, size and mips) | | Models | `.ydr`, `.ydd`, `.yft` | view, export glTF | | Peds and animals | `metapeds` outfits | put together with outfits, tints and face shapes | | Animations | `.ycd` | play, partly approximated | @@ -68,7 +68,7 @@ Only the Steam version of 2 April 2024 is known so far; other versions report wh | Audio | `.awc` | play, save WAV | | Texts | `.yldb` | view | -Changing RDR2 files and the search index are not available yet. +The search index is not available for RDR2 yet. ## Archives @@ -82,6 +82,66 @@ openrage --game "/path/to/Red Dead Redemption 2" ls levels_1.rpf/levels/rdr3 **Checked:** all 89 archives, 4,874 nested archives and 493,592 files. +## Changing files + +RDR2 has no OpenIV.asi. Its mods are loaded by **[Lenny's Mod Loader](https://www.rdr2mods.com/downloads/rdr2/tools/76-lennys-mod-loader-rdr/)** +(LML), and OpenRAGE writes for it: its **replace folder** loads `lml/replace//` in place of the file +`` inside the game's `.rpf`. The game's archives are never changed. Install LML (with its +`vfs.asi`) to see the changes in the game. + +| You change | OpenRAGE writes | +|---|---| +| a file inside a game archive, e.g. `update_4.rpf/x64/data/ui/blipdata.ymt` | that file, loose: `lml/replace/update_4/x64/data/ui/blipdata.ymt` | +| anything inside a nested archive, e.g. `update_4.rpf/x64/data/ui/startup_data.rpf/settings/…` | the nested archive, copied there once and then edited in place: `lml/replace/update_4/x64/data/ui/startup_data.rpf` | + +- **Edit mode** works as for GTA V: unlock editing, then **Import…**, **Replace…**, **Rename…** and **Delete** in an + archive's folder, or **Replace…** on a texture. The command line has `put`, `rm`, `mv`, `history` and `undo`. +- **Delete and Rename** work inside nested archives (and on files OpenRAGE put into `lml/replace`). LML cannot hide or + rename a file of the game's own archives. +- **Undo** and **History** work as for GTA V; the journal is in `lml/replace/.openrage`. +- **Names:** LML finds a replacement by the file's real path, so files that show only as `hash/XXXXXXXX` cannot be + replaced at the top of an archive (inside nested archives they can). Run `rdr2-names` first; OpenRAGE also tries the + `x64/…` form of every name it found, which names most files of the `update_*.rpf` archives. Names given to new or + renamed entries are kept in `lml/replace/.openrage/names.txt`. +- **Resources** (textures, models and other `RSC8` files) are replaced with an RSC8 file: *Extract…* saves resources + in that form (header and pages, uncompressed), so an extracted file can go back after editing. +- **Textures:** a DDS of the same format, size and mip count is written into the dictionary in place (RDR2's padded + layout). Adding and removing textures, or other sizes, are not supported yet. + +``` +openrage --game put blipdata.ymt update_4.rpf/x64/data/ui/blipdata.ymt +openrage --game put flow.ymt update_4.rpf/x64/data/ui/startup_data.rpf/settings/flow/settings_group_flow.ymt +openrage --game history +openrage --game undo +``` + +### How nested archives are written + +OpenRAGE's RPF8 writer edits an archive in place, like the GTA V editor: new data is appended, the header and entry +table at the start are rewritten, and entries in the way of a grown table move to the end unchanged. In detail: + +- The entry table is written **unencrypted** (the header's decryption tag says so). RDR2's cipher can only be + decrypted with the game's keys, not encrypted again. The game reads plain tables: a public mod (DualSense for RDR2) + ships a nested archive rebuilt this way through LML's replace folder. +- Untouched entries keep their stored bytes, still encrypted, compressed and signed. New data is stored as is: not + encrypted, not compressed, not signed. +- The signature block after the header is kept as it was; it no longer matches the changed table. +- The archive's own name table is rewritten when it is readable and kept byte for byte otherwise. + +``` +openrage --game verify --rebuild # every archive: edit a copy, read it back, undo +``` + +**Checked:** `verify --rebuild` over the whole game (Steam version, November 2026): 4,905 archives edited and undone +(467,546 entries, every nested archive included) and 81,021 texture dictionaries (379,191 textures) written in place +and read back, 0 failed. 58 archives over 512 MB were not copied whole; their nested archives were checked. + +**Not checked in the game:** these changes were tested in OpenRAGE only, not in RDR2 itself. In particular, whether +LML picks up files from `lml/replace` for archives in subfolders (`x64/dlcpacks/…`, `x64/audio/sfx/…`), whether the +game accepts unencrypted, unsigned new entries of every file type (one public mod reports that the game crashed on an +uncompressed new UI scene and needed Oodle compression, which OpenRAGE cannot write yet), and whether the game takes +a changed nested archive's table from the file or from its packfile cache (`pfm.dat`). + ## Textures Texture dictionaries (`.ytd`) open like GTA V's: preview, viewer and export as DDS or PNG. RDR2 stores each mip level From 5b23472ecb3ee40182407d8559b2ca7d5b69ddee Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 22:06:20 +0100 Subject: [PATCH 3/8] RDR2 palette shaders: cart and strap colours instead of pink (#141) Shaders with a tint palette keep a shade in lyr0DiffuseTex; the palette slot is the vertex colour's blue. The viewer showed the palette (or the game's pink debug palette) as the colour. - Vehicles (vehTintPaletteTex, e.g. generic_wagon_palette): each slot gets the paint and worn rows of the model's first variation in carvariations.ymt; green picks the column, blue blends to the worn row. - Props and weapons (TintPaletteTex, e.g. *_pal): tint 0, column = slot, the grey texture laid over the colour (hard light). Meshes that mix slots are split; each (shader, slot) gets a baked texture and shader copy, so the viewer and glTF export show the colours. The vertex colours of those meshes are dropped (they held slots, not colours). Co-authored-by: Claude Opus 5.5 --- crates/openrage-app/src/lib.rs | 1 + crates/openrage-app/src/models.rs | 2 + crates/openrage-app/src/palette.rs | 442 ++++++++++++++++++++++++++++ crates/rage-formats/src/drawable.rs | 23 +- site/content/rdr2.md | 4 + 5 files changed, 470 insertions(+), 2 deletions(-) create mode 100644 crates/openrage-app/src/palette.rs diff --git a/crates/openrage-app/src/lib.rs b/crates/openrage-app/src/lib.rs index cfb480f..826ae93 100644 --- a/crates/openrage-app/src/lib.rs +++ b/crates/openrage-app/src/lib.rs @@ -24,6 +24,7 @@ pub mod models; pub mod natives; pub mod obj; pub mod oiv; +pub mod palette; pub mod paths; pub mod plugins; pub mod progress; diff --git a/crates/openrage-app/src/models.rs b/crates/openrage-app/src/models.rs index 6b0b23a..9a5ab86 100644 --- a/crates/openrage-app/src/models.rs +++ b/crates/openrage-app/src/models.rs @@ -1469,6 +1469,8 @@ fn load_rdr2(rpf: &Arc, i: usize) -> Result { // The rest from shared dictionaries elsewhere, through the texture index. if let Some(game) = crate::rdr2::game_folder(rpf.path()) { rdr2_shared_textures(&game, &drawables, &mut external, 32); + // Palette shaders: colours from the palettes (vehicles: their first variation). + crate::palette::apply(&crate::palette::carvariations(&game), &stem, &mut drawables, &mut external); } let skeleton = base.or_else(|| drawables.iter().find_map(|(_, d)| d.skeleton.clone())); let mut model = LoadedModel { diff --git a/crates/openrage-app/src/palette.rs b/crates/openrage-app/src/palette.rs new file mode 100644 index 0000000..77401f8 --- /dev/null +++ b/crates/openrage-app/src/palette.rs @@ -0,0 +1,442 @@ +//! RDR2 palette shaders: colour textures that hold a shade, coloured from a +//! palette per *slot*. The slot of a vertex is its vertex colour's blue +//! channel (0, 1, 2, … as bytes); a mesh can mix slots. +//! +//! Two kinds, by the shader's textures (`lyr0DiffuseTex` holds the shade): +//! +//! - Vehicles (`standard_vehicle_2lyr`, … with `vehTintPaletteTex`, e.g. +//! `generic_wagon_palette`): the palette has one row per colour (named in +//! `carcols.ymt`), its columns run from dark to light. A vehicle's +//! variation (`carvariations.ymt`) gives each slot a paint colour and a +//! worn colour. The shade's green picks the column, its blue (scratches) +//! blends the paint towards the worn colour. +//! - Props and weapons (`TintPaletteTex`, e.g. `w_repeater_cloth_strap01_pal`, +//! 256 × tints): column = slot, row = tint (0 here). The grey colour +//! texture is laid over the palette colour (hard light). +//! +//! The game builds the palette texture of a vehicle at run time; the one in +//! its files (`Generic_skinned_pal`) is a debug palette and is not used here. + +use std::collections::{BTreeMap, HashMap}; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, OnceLock}; + +use rage_formats::drawable::{Drawable, Mesh, Shader, param}; +use rage_formats::texture::{Format, Texture}; +use rage_formats::ytd::TextureDictionary; + +/// Vehicle colour variations. +pub const CARVARIATIONS: &str = "packs_0.rpf/packs/base/data/carvariations.ymt"; + +/// The game's debug palette in vehicle shaders (replaced at run time). +const DEBUG_PALETTE: &str = "generic_skinned_pal"; + +/// A vehicle palette slot: rows of the vehicle palette. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct VehicleSlot { + pub paint: u8, + pub worn: u8, +} + +/// The slots of each vehicle's first colour variation, by model name (lower +/// case), from `carvariations.ymt` as XML. +pub fn parse_carvariations(xml: &str) -> Variations { + // Field names are unknown: hashes. + const VARIATIONS: &str = "hash_99C68B00"; + const SLOTS: &str = "hash_E0E9752E"; + const PAINT: &str = "hash_A2039C71"; + const WORN: &str = "hash_41F13680"; + let mut out = HashMap::new(); + let Ok(doc) = roxmltree::Document::parse_with_options( + xml, + roxmltree::ParsingOptions { allow_dtd: false, nodes_limit: u32::MAX, ..Default::default() }, + ) else { + return out; + }; + fn child<'a, 'i>(n: roxmltree::Node<'a, 'i>, name: &str) -> Option> { + n.children().find(|c| c.has_tag_name(name)) + } + let value = |n: roxmltree::Node<'_, '_>, name: &str| { + child(n, name).and_then(|c| c.attribute("value")?.parse::().ok()).map(|v| v.min(255) as u8) + }; + for model in doc.descendants().filter(|n| n.has_tag_name("Item")) { + let Some(name) = child(model, "modelName").and_then(|n| n.text()) else { continue }; + let first = child(model, VARIATIONS).and_then(|v| v.children().find(|c| c.has_tag_name("Item"))); + let Some(slots) = first.and_then(|v| child(v, SLOTS)) else { continue }; + let slots: Vec = slots + .children() + .filter(|c| c.has_tag_name("Item")) + .map(|s| VehicleSlot { paint: value(s, PAINT).unwrap_or(0), worn: value(s, WORN).unwrap_or(0) }) + .collect(); + out.entry(name.trim().to_ascii_lowercase()).or_insert(slots); + } + out +} + +/// Palette slots by vehicle model name. +pub type Variations = HashMap>; + +/// The vehicle variations of a game folder, read once. +pub fn carvariations(game: &Path) -> Arc { + static CACHE: OnceLock>>> = OnceLock::new(); + let cache = CACHE.get_or_init(Default::default); + if let Some(v) = cache.lock().ok().and_then(|c| c.get(game).cloned()) { + return v; + } + let read = crate::metadata::load(game, None, CARVARIATIONS).map(|x| parse_carvariations(&x.text)); + let v = Arc::new(read.unwrap_or_default()); + if let Ok(mut c) = cache.lock() { + c.insert(game.to_path_buf(), v.clone()); + } + v +} + +/// One RGBA pixel of a palette, columns interpolated (`x` in pixels). +fn palette_at(palette: &[u8], width: usize, height: usize, row: usize, x: f32) -> [f32; 3] { + let row = row.min(height.saturating_sub(1)); + let x = x.clamp(0.0, width.saturating_sub(1) as f32); + let (x0, t) = (x.floor() as usize, x.fract()); + let x1 = (x0 + 1).min(width - 1); + let px = |x: usize, c: usize| palette.get((row * width + x) * 4 + c).copied().unwrap_or(0) as f32; + [0, 1, 2].map(|c| px(x0, c) * (1.0 - t) + px(x1, c) * t) +} + +/// Colours a vehicle shade texture (RGBA) with a slot's palette rows: green +/// picks the column, blue blends from the paint row to the worn row. +pub fn bake_vehicle(shade: &[u8], palette: &[u8], width: usize, height: usize, slot: VehicleSlot) -> Vec { + let mut out = Vec::with_capacity(shade.len()); + if width == 0 || height == 0 { + return shade.to_vec(); + } + let ramp = (width - 1) as f32; + for px in shade.as_chunks::<4>().0 { + let x = px[1] as f32 / 255.0 * ramp; + let paint = palette_at(palette, width, height, slot.paint as usize, x); + let worn = palette_at(palette, width, height, slot.worn as usize, x); + let t = px[2] as f32 / 255.0; + out.extend([0, 1, 2].map(|c| (paint[c] * (1.0 - t) + worn[c] * t).round().clamp(0.0, 255.0) as u8)); + out.push(px[3]); + } + out +} + +/// Lays a grey colour texture (RGBA) over a colour (hard light): mid grey +/// gives the colour, darker and lighter shades darken and lighten it. +pub fn bake_tint(grey: &[u8], colour: [f32; 3]) -> Vec { + let mut out = Vec::with_capacity(grey.len()); + for px in grey.as_chunks::<4>().0 { + let g = px[1] as f32 / 255.0; + out.extend(colour.map(|c| { + let c = c / 255.0; + let v = if g < 0.5 { 2.0 * g * c } else { 1.0 - 2.0 * (1.0 - g) * (1.0 - c) }; + (v * 255.0).round().clamp(0.0, 255.0) as u8 + })); + out.push(px[3]); + } + out +} + +/// A dictionary of textures made here (not read from a file). +fn dictionary(textures: Vec) -> TextureDictionary { + TextureDictionary { + textures, + errors: Vec::new(), + layout: rage_formats::ytd::Layout::Rdr2, + version: 0, + root: Vec::new(), + stored: Vec::new(), + } +} + +/// How a shader's palette is applied. +#[derive(Clone, Debug)] +enum Kind { + Vehicle { palette: String }, + Tint { palette: String }, +} + +fn kind(shader: &Shader, vehicle: bool) -> Option { + shader.sampler(param::LYR0_DIFFUSE_TEX)?; + if vehicle && let Some(p) = shader.sampler(param::VEH_TINT_PALETTE_TEX) { + return Some(Kind::Vehicle { palette: p.to_owned() }); + } + let p = shader.sampler(param::TINT_PALETTE_TEX)?; + (!p.eq_ignore_ascii_case(DEBUG_PALETTE)).then(|| Kind::Tint { palette: p.to_owned() }) +} + +/// A mesh with only the given triangles (indices into `mesh`'s vertices). +fn submesh(mesh: &Mesh, indices: &[u32]) -> Mesh { + let n = mesh.positions.len(); + let mut out = Mesh { shader: mesh.shader, bone_tags: mesh.bone_tags.clone(), ..Default::default() }; + let mut map: HashMap = HashMap::new(); + for &i in indices { + let k = *map.entry(i).or_insert_with(|| { + let v = i as usize; + fn copy(dst: &mut Vec, src: &[T], n: usize, v: usize) { + if src.len() == n + && let Some(x) = src.get(v) + { + dst.push(*x); + } + } + copy(&mut out.positions, &mesh.positions, n, v); + copy(&mut out.normals, &mesh.normals, n, v); + copy(&mut out.uvs, &mesh.uvs, n, v); + copy(&mut out.uvs1, &mesh.uvs1, n, v); + copy(&mut out.colors, &mesh.colors, n, v); + copy(&mut out.bone_indices, &mesh.bone_indices, n, v); + copy(&mut out.bone_weights, &mesh.bone_weights, n, v); + out.positions.len() as u32 - 1 + }); + out.indices.push(k); + } + out +} + +/// The palette slot of a vertex (vertex colour blue as a byte). +fn slot_of(mesh: &Mesh, v: u32) -> u8 { + mesh.colors.get(v as usize).map_or(0, |c| (c[2] * 255.0).round().clamp(0.0, 255.0) as u8) +} + +/// Colours the palette shaders of `drawables`: each (shader, slot) gets a +/// baked colour texture (added to `external`) and a copy of the shader that +/// uses it; meshes that mix slots are split by slot. `model` names the +/// vehicle in `carvariations.ymt` (vehicles without one keep their shade). +pub fn apply( + variations: &Variations, + model: &str, + drawables: &mut [(String, Drawable)], + external: &mut Vec<(String, TextureDictionary)>, +) { + let vehicle_slots = variations.get(&model.to_ascii_lowercase()); + let mut baked: Vec = Vec::new(); + for (_, d) in drawables.iter_mut() { + let kinds: Vec> = d.shaders.iter().map(|s| kind(s, vehicle_slots.is_some())).collect(); + if kinds.iter().all(Option::is_none) { + continue; + } + // Split the meshes by slot. + let mut meshes: Vec<(Mesh, Option)> = Vec::new(); + for mesh in std::mem::take(&mut d.meshes) { + let paletted = kinds.get(mesh.shader as usize).is_some_and(Option::is_some); + if !paletted || mesh.colors.len() != mesh.positions.len() { + meshes.push((mesh, None)); + continue; + } + let mut by_slot: BTreeMap> = BTreeMap::new(); + for tri in mesh.indices.chunks(3) { + by_slot.entry(slot_of(&mesh, tri[0])).or_default().extend_from_slice(tri); + } + if by_slot.len() <= 1 { + let slot = by_slot.keys().next().copied().unwrap_or(0); + meshes.push((mesh, Some(slot))); + } else { + meshes.extend(by_slot.iter().map(|(&slot, tris)| (submesh(&mesh, tris), Some(slot)))); + } + } + // A baked texture and shader per (shader, slot). + let mut made: HashMap<(u16, u8), Option> = HashMap::new(); + for (mesh, slot) in &mut meshes { + let Some(slot) = *slot else { continue }; + let key = (mesh.shader, slot); + let index = match made.get(&key) { + Some(i) => *i, + None => { + let i = bake_shader(d, &kinds, key, vehicle_slots, external, &mut baked); + made.insert(key, i); + i + } + }; + if let Some(i) = index { + mesh.shader = i; + // The vertex colour held the slot, not a colour. + mesh.colors.clear(); + } + } + d.meshes = meshes.into_iter().map(|(m, _)| m).collect(); + drop_replaced(d, &kinds); + } + if baked.is_empty() { + return; + } + external.push(("palettes (baked)".to_owned(), dictionary(baked))); +} + +/// Removes the palette shaders that no mesh uses any more (all their meshes +/// now use baked copies), so exports carry no unused materials. +fn drop_replaced(d: &mut Drawable, kinds: &[Option]) { + let used = |i: usize| d.meshes.iter().any(|m| m.shader as usize == i); + let keep: Vec = (0..d.shaders.len()).map(|i| kinds.get(i).is_none_or(Option::is_none) || used(i)).collect(); + if keep.iter().all(|k| *k) { + return; + } + let mut new_index = Vec::with_capacity(keep.len()); + let mut next = 0u16; + for &k in &keep { + new_index.push(next); + next += u16::from(k); + } + for m in &mut d.meshes { + m.shader = new_index.get(m.shader as usize).copied().unwrap_or(m.shader); + } + let mut k = keep.iter(); + d.shaders.retain(|_| *k.next().unwrap_or(&true)); +} + +/// Bakes the colour texture of shader `key.0` for slot `key.1` and adds a +/// copy of the shader that uses it; its index, or `None` when the textures +/// are missing. +fn bake_shader( + d: &mut Drawable, + kinds: &[Option], + (shader, slot): (u16, u8), + vehicle_slots: Option<&Vec>, + external: &[(String, TextureDictionary)], + baked: &mut Vec, +) -> Option { + let kind = kinds.get(shader as usize)?.as_ref()?; + let original = d.shaders.get(shader as usize)?; + let shade_name = original.sampler(param::LYR0_DIFFUSE_TEX)?.to_owned(); + let (palette_name, tag) = match kind { + Kind::Vehicle { palette } => { + let s = vehicle_slots?.get(slot as usize)?; + (palette.clone(), format!("{}_{}", s.paint, s.worn)) + } + Kind::Tint { palette } => (palette.clone(), slot.to_string()), + }; + let new_name = format!("{shade_name}+{palette_name}#{tag}"); + if !baked.iter().any(|t| t.name == new_name) { + let find = |name: &str| { + let f = |t: &TextureDictionary| t.textures.iter().find(|x| x.name.eq_ignore_ascii_case(name)).cloned(); + d.textures.as_ref().and_then(f).or_else(|| external.iter().find_map(|(_, t)| f(t))) + }; + let shade = find(&shade_name)?; + let palette = find(&palette_name)?; + let (rgba, pal) = (shade.to_rgba()?, palette.to_rgba()?); + let (w, h) = (palette.width.max(1) as usize, palette.height.max(1) as usize); + let data = match kind { + Kind::Vehicle { .. } => bake_vehicle(&rgba, &pal, w, h, *vehicle_slots?.get(slot as usize)?), + Kind::Tint { .. } => bake_tint(&rgba, palette_at(&pal, w, h, 0, slot as f32)), + }; + baked.push(Texture { + name: new_name.clone(), + width: shade.width.max(1), + height: shade.height.max(1), + depth: 1, + levels: 1, + format: Format::R8G8B8A8_UNORM, + dimension: shade.dimension, + usage: shade.usage, + data, + }); + } + // Slots with the same colours share one copy. + if let Some(i) = d.shaders.iter().position(|s| s.sampler(param::LYR0_DIFFUSE_TEX) == Some(new_name.as_str())) { + return u16::try_from(i).ok(); + } + let mut copy = original.clone(); + for (h, t) in copy.samplers.iter_mut() { + if *h == param::LYR0_DIFFUSE_TEX { + *t = new_name.clone(); + } + } + copy.textures.push(new_name); + d.shaders.push(copy); + u16::try_from(d.shaders.len() - 1).ok() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn reads_first_variation_slots() { + let xml = r#" + cart07 + + + + + + + + + + "#; + let v = parse_carvariations(xml); + assert_eq!(v["cart07"], vec![VehicleSlot { paint: 8, worn: 242 }, VehicleSlot { paint: 22, worn: 254 }]); + } + + #[test] + fn vehicle_shade_picks_column_scratches_pick_worn_row() { + // Two rows, 3 wide: row 0 ramps red, row 1 is blue. + let pal = [0, 0, 0, 255, 100, 0, 0, 255, 200, 0, 0, 255, 0, 0, 90, 255, 0, 0, 90, 255, 0, 0, 90, 255]; + let slot = VehicleSlot { paint: 0, worn: 1 }; + assert_eq!(bake_vehicle(&[0, 255, 0, 7], &pal, 3, 2, slot), vec![200, 0, 0, 7]); + assert_eq!(bake_vehicle(&[0, 128, 0, 255], &pal, 3, 2, slot), vec![100, 0, 0, 255]); + assert_eq!(bake_vehicle(&[0, 0, 255, 255], &pal, 3, 2, slot), vec![0, 0, 90, 255]); + } + + #[test] + fn hard_light_keeps_colour_at_mid_grey() { + let c = [200.0, 100.0, 50.0]; + assert_eq!(bake_tint(&[0, 0, 0, 255], c), vec![0, 0, 0, 255]); + assert_eq!(bake_tint(&[255, 255, 255, 255], c), vec![255, 255, 255, 255]); + let mid = bake_tint(&[128, 128, 128, 255], c); + assert!(mid[..3].iter().zip(c).all(|(a, b)| (*a as f32 - b).abs() <= 2.0), "{mid:?}"); + } + + #[test] + fn splits_meshes_by_slot() { + let shader = |pal: &str| Shader { + name_hash: 1, + textures: vec!["shade".into(), pal.into()], + samplers: vec![(param::LYR0_DIFFUSE_TEX, "shade".into()), (param::TINT_PALETTE_TEX, pal.into())], + }; + let tex = |name: &str, w: u32, h: u32, data: Vec| Texture { + name: name.into(), + width: w, + height: h, + depth: 1, + levels: 1, + format: Format::R8G8B8A8_UNORM, + dimension: rage_formats::texture::Dimension::Texture2D, + usage: 0, + data, + }; + // Slot 0 red, slot 1 green. + let pal = tex("thing_pal", 2, 1, vec![255, 0, 0, 255, 0, 255, 0, 255]); + let shade = tex("shade", 1, 1, vec![128, 128, 128, 255]); + let blue = |b: f32| [1.0, 1.0, b, 1.0]; + let mesh = Mesh { + positions: vec![[0.0; 3]; 6], + colors: vec![blue(0.0), blue(0.0), blue(0.0), blue(1.0 / 255.0), blue(1.0 / 255.0), blue(1.0 / 255.0)], + indices: vec![0, 1, 2, 3, 4, 5], + ..Default::default() + }; + let d = Drawable { + meshes: vec![mesh], + shaders: vec![shader("thing_pal"), shader(DEBUG_PALETTE)], + textures: Some(dictionary(vec![pal, shade])), + ..Default::default() + }; + let mut drawables = vec![("thing".to_owned(), d)]; + let mut external = Vec::new(); + apply(&HashMap::new(), "thing", &mut drawables, &mut external); + let d = &drawables[0].1; + assert_eq!(d.meshes.len(), 2); + // The replaced shader is gone: the debug one and two copies are left. + assert_eq!(d.shaders.len(), 3); + assert!(d.meshes.iter().all(|m| m.positions.len() == 3 && m.colors.is_empty())); + let baked = &external[0].1.textures; + let colour = |m: &Mesh| { + let name = d.shaders[m.shader as usize].base_texture().unwrap(); + baked.iter().find(|t| t.name == name).unwrap().data[..3].to_vec() + }; + assert_eq!(colour(&d.meshes[0]), vec![255, 1, 1]); + assert_eq!(colour(&d.meshes[1]), vec![1, 255, 1]); + // The debug palette is left alone: its shade stays the colour. + assert_eq!(d.shaders[0].sampler(param::TINT_PALETTE_TEX), Some(DEBUG_PALETTE)); + assert_eq!(d.shaders[0].base_texture(), Some("shade")); + } +} diff --git a/crates/rage-formats/src/drawable.rs b/crates/rage-formats/src/drawable.rs index 3603509..ab86b00 100644 --- a/crates/rage-formats/src/drawable.rs +++ b/crates/rage-formats/src/drawable.rs @@ -126,10 +126,23 @@ pub mod param { /// `TextureSampler`: the base colour (GTA IV). pub const TEXTURE_SAMPLER: u32 = 0x2b5170fd; + /// RDR2 `lyr0DiffuseTex`: the colour of the first layer of layered + /// shaders (`standard_vehicle_2lyr`, …). With a tint palette it holds a + /// shade (and masks) that the palette colours. + pub const LYR0_DIFFUSE_TEX: u32 = 0x346394ea; + /// RDR2 `TintPaletteTex`: palette colours, one column per palette slot + /// (vertex colour blue), one row per tint. + pub const TINT_PALETTE_TEX: u32 = 0x2c8d7182; + /// RDR2 `vehTintPaletteTex`: vehicle colours, one row per colour + /// (`carcols.ymt`), columns from dark to light. + pub const VEH_TINT_PALETTE_TEX: u32 = 0x7b21acbf; + /// Parameters that hold the base colour. - pub const BASE: [u32; 3] = [DIFFUSE_TEX, DIFFUSE_SAMPLER, TEXTURE_SAMPLER]; + pub const BASE: [u32; 4] = [DIFFUSE_TEX, DIFFUSE_SAMPLER, TEXTURE_SAMPLER, LYR0_DIFFUSE_TEX]; /// Parameters that never hold the base colour. - pub const NOT_BASE: [u32; 9] = [ + pub const NOT_BASE: [u32; 11] = [ + TINT_PALETTE_TEX, + VEH_TINT_PALETTE_TEX, DIFFUSE_TEX2, DIFFUSE_SAMPLER2, DIRT_TEX, @@ -952,6 +965,12 @@ mod tests { // Unknown parameters: by name. let unknown = s(&[(0, "plate01_n"), (0, "plate01")]); assert_eq!(unknown.base_texture(), Some("plate01")); + // RDR2 palette shaders: the shade in lyr0DiffuseTex, not the palette. + let pal = s(&[ + (param::TINT_PALETTE_TEX, "w_repeater_cloth_strap01_pal"), + (param::LYR0_DIFFUSE_TEX, "w_repeater_cloth_strap01_ab"), + ]); + assert_eq!(pal.base_texture(), Some("w_repeater_cloth_strap01_ab")); } #[test] diff --git a/site/content/rdr2.md b/site/content/rdr2.md index a3387bd..6f41a1d 100644 --- a/site/content/rdr2.md +++ b/site/content/rdr2.md @@ -155,6 +155,10 @@ Drawables, drawable dictionaries and fragments open in the viewer and export as shared texture dictionaries elsewhere in the game; `rdr2-names` indexes them once (162,256 textures) so the viewer finds them. +Many vehicles, weapons and props are coloured from palettes: their colour texture holds a shade, and the palette +colour comes from a slot per vertex. OpenRAGE bakes them into ordinary textures: vehicles in the colours of their +first variation (`carvariations.ymt`), props and weapons in their first tint. + **Not yet:** moving parts of fragments, skeleton animations of models and cloth. ## Peds and animals From a52d971a438b0bd3d694f2f5f22ccb96a6428301 Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 22:22:06 +0100 Subject: [PATCH 4/8] RDR2 viewer: moving parts of fragments, animations on fitting models, cloth (#138) * RDR2: fragments show their moving parts An RDR2 fragment's children are drawables of their own (wheels) in the physics LOD (fragment 0x90, LOD at +0x10): list at 0x118, u8 count at 0x146, group of each child at 0x110, groups at 0xC8 with the name at +0x4F and the parent at +0x06. A child sits on the bone its group (or a parent group) is named after and uses the body's shaders. The viewer places them like GTA V's, copies a wheel to the other side, and keeps the blurred `_fast` wheels hidden. `rpf8 --models` reads the children too (113,466 models, the cloth strap still fails). Co-Authored-By: Claude Opus 5.5 * RDR2: animations play on fitting models, object clips read - Clips of one animation (kind 1 at 0x20: doors, destruction, props) keep their layer in the clip at 0x68 instead of a part list; 109 clip dictionaries failed to read before. - Fitting models for RDR2 clip dictionaries: skeletons of RDR2 models (.ydr, .yft, .ydd, ped outfit files) are read for ranking; every ped and animal is ranked by its base skeleton (read once each, in parallel, skeleton only), by the share of all the dictionary's bones since RDR2's people and animals share the main bones' names. Prop clips named after their model (`des_brt3_door_01`) name candidates. - RDR2's main bones (hashes of SKEL_* names) count as ped bones. - Debug: OPENRAGE_ANIM_AT pauses a viewer clip at a share of its length. Co-Authored-By: Claude Opus 5.5 * RDR2: cloth of fragments in its rest pose An RDR2 fragment lists its cloth at 0x48 (16-byte entries, u16 count at 0x50); each cloth keeps its drawable at +0x18, the rest pose (flags, awnings, straps). The viewer shows them as Cloth parts; a fragment that is only cloth (w_repeater_cloth_strap01) now reads. Ped coats already came complete from their .ydd. `rpf8 --models`: all 113,468 models, 628 fragment parts and 894 cloths. Docs and README updated. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- README.md | 2 +- crates/openrage-app/src/models.rs | 140 +++++++++++++++++----- crates/openrage-app/src/suggest.rs | 173 +++++++++++++++++++++++++++- crates/openrage-cli/src/cmd/rdr2.rs | 30 ++++- crates/openrage-gui/src/debug.rs | 5 + crates/openrage-gui/src/model_ui.rs | 30 ++++- crates/rage-formats/src/clip.rs | 98 +++++++++++++--- crates/rage-formats/src/drawable.rs | 132 +++++++++++++++++++-- crates/rage-formats/src/wdr.rs | 2 +- site/content/rdr2.md | 25 +++- 10 files changed, 562 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index ef31597..bb40d62 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ More screenshots and all features: **[two-play.github.io/openrage](https://two-p | Game | Archives | Formats | |---|---|---| | **GTA V** (Legacy & Enhanced) | ✅ read and edit (mods folder, with undo) | ✅ textures (also inside models) · models · audio · animations · metadata · text · collisions · paths · cutscenes · scripts · ASI mods (manager, Proton fix on Linux) · ◐ model import from OBJ with compressed textures and detail levels (Enhanced `.ydr` and vehicle bodies `.yft`, preview; explorer via the OBJ tools plugin) | -| **Red Dead Redemption 2** | ✅ read, with keys from your own game · ◐ edit (Lenny's Mod Loader `lml/replace` folder, with undo; nested archives rewritten; not yet tried in the game) | ◐ textures (replace same-shape) · models · texts · metadata · audio · animations · ped outfits (read-only) | +| **Red Dead Redemption 2** | ✅ read, with keys from your own game · ◐ edit (Lenny's Mod Loader `lml/replace` folder, with undo; nested archives rewritten; not yet tried in the game) | ◐ textures (replace same-shape) · models with moving parts and cloth · texts · metadata · audio · animations on fitting models · ped outfits (read-only) | | **GTA VI** | 🔜 next: as fast as possible once it comes to PC | – | | **GTA IV** (Complete Edition) | ✅ read (IMG3, RPF2, RPF3), key from your own `GTAIV.exe` | ◐ textures · models · collisions · animations · text · scripts · maps in 3D · cutscenes (played with their cast, camera, subtitles and particle effects) · particle effect lists (`.wpfl`) · editing `.img`, `.rpf`, placement files, loose files and textures (`.wtd`, inside `.wdr`) (update folder, or the game files with originals kept) | diff --git a/crates/openrage-app/src/models.rs b/crates/openrage-app/src/models.rs index 9a5ab86..5ee4c09 100644 --- a/crates/openrage-app/src/models.rs +++ b/crates/openrage-app/src/models.rs @@ -371,7 +371,7 @@ fn streamed_ped(rpf: &rage_rpf::Rpf7, folder: rage_rpf::EntryId) -> Result (Vec<(String, Drawable)>, Vec) { - let drawable::Fragment { drawable: body, children } = fragment; + let drawable::Fragment { drawable: body, children, cloths } = fragment; let skeleton = body.skeleton.clone().unwrap_or_default(); let world = skeleton.world_transforms(); let mut drawables = vec![(name.to_owned(), body)]; @@ -383,6 +383,20 @@ fn fragment_parts(fragment: drawable::Fragment, name: &str) -> (Vec<(String, Dra visible: true, bone: None, }]; + // Cloth (RDR2's flags and straps) in its rest pose: the game moves it. + for (k, cloth) in cloths.into_iter().enumerate() { + let label = if k == 0 { "cloth".to_owned() } else { format!("cloth_{k}") }; + let index = drawables.len(); + parts.push(Part { + name: label.clone(), + group: "Cloth".into(), + drawable: index, + transform: math::IDENTITY, + visible: true, + bone: None, + }); + drawables.push((label, cloth)); + } let mut wheels: Vec<(String, usize)> = Vec::new(); for child in children { let bone = skeleton.find_tag(child.bone_tag); @@ -391,11 +405,13 @@ fn fragment_parts(fragment: drawable::Fragment, name: &str) -> (Vec<(String, Dra let index = drawables.len(); drawables.push((bone_name.clone(), child.drawable)); let transform = bone.and_then(|b| world.get(b)).copied().unwrap_or(math::IDENTITY); - if bone_name.starts_with("wheel_") { + // RDR2's blurred wheels for high speeds (`wheel_lf_fast`) stay hidden. + let variant = is_wheel_variant(&bone_name); + if bone_name.starts_with("wheel_") && !variant { wheels.push((bone_name.clone(), index)); } let group = if bone_name.starts_with("wheel_") { "Wheels" } else { "Parts" }; - parts.push(Part { name: bone_name, group: group.into(), drawable: index, transform, visible: true, bone }); + parts.push(Part { name: bone_name, group: group.into(), drawable: index, transform, visible: !variant, bone }); } // Copy wheels to the wheel bones that have no drawable of their own. if !wheels.is_empty() { @@ -403,7 +419,7 @@ fn fragment_parts(fragment: drawable::Fragment, name: &str) -> (Vec<(String, Dra let is_rear = |n: &str| n.ends_with('r') || n.contains("_lm") || n.contains("_rm"); for (b, bone) in skeleton.bones.iter().enumerate() { let n = bone.name.to_ascii_lowercase(); - let is_wheel_bone = n.starts_with("wheel_") && !n.contains("mesh"); + let is_wheel_bone = n.starts_with("wheel_") && !n.contains("mesh") && !is_wheel_variant(&n); if !is_wheel_bone || wheels.iter().any(|(w, _)| w.eq_ignore_ascii_case(&n)) { continue; } @@ -432,6 +448,13 @@ fn fragment_parts(fragment: drawable::Fragment, name: &str) -> (Vec<(String, Dra (drawables, parts) } +/// RDR2 wheel bones besides the wheel itself: the blurred one shown at +/// speed (`wheel_lf_fast`) and the one for upgrades (`wheel_lf_mod`). +fn is_wheel_variant(bone: &str) -> bool { + let n = bone.to_ascii_lowercase(); + n.starts_with("wheel_") && (n.ends_with("_fast") || n.ends_with("_mod")) +} + pub fn is_model(name: &str) -> bool { let n = name.to_ascii_lowercase(); n.ends_with(".ydr") @@ -1400,7 +1423,7 @@ fn load_rdr2(rpf: &Arc, i: usize) -> Result { }) .collect() } else if lower.ends_with(".yft") { - vec![(stem.clone(), drawable::parse_fragment_rdr2(&res)?.drawable)] + Vec::new() } else { bail!("{name}: only .ydr, .ydd and .yft models of Red Dead Redemption 2 can be shown so far"); }; @@ -1411,23 +1434,30 @@ fn load_rdr2(rpf: &Arc, i: usize) -> Result { if let Some(sk) = &base { fit_to_skeleton(&mut drawables, sk); } - let layout = if drawables.len() > 1 && base.is_none() { - grid_layout(&drawables) + let parts = if lower.ends_with(".yft") { + // Fragments: the body and its children (wheels) on their bones. + let (d, p) = fragment_parts(drawable::parse_fragment_rdr2(&res)?, &stem); + drawables = d; + p } else { - vec![math::IDENTITY; drawables.len()] + let layout = if drawables.len() > 1 && base.is_none() { + grid_layout(&drawables) + } else { + vec![math::IDENTITY; drawables.len()] + }; + drawables + .iter() + .enumerate() + .map(|(k, (n, _))| Part { + name: n.clone(), + group: String::new(), + drawable: k, + transform: layout[k], + visible: true, + bone: None, + }) + .collect() }; - let parts = drawables - .iter() - .enumerate() - .map(|(k, (n, _))| Part { - name: n.clone(), - group: String::new(), - drawable: k, - transform: layout[k], - visible: true, - bone: None, - }) - .collect(); // Texture dictionaries in the same folder: `.ytd` first, then those // whose name shares the model's prefix, then the rest; at most eight. let dir = full.rsplit_once('/').map_or("", |(d, _)| d).to_owned(); @@ -1597,13 +1627,8 @@ fn load_rdr2_ped_inner(game: &Path, ped: &str, outfit: usize) -> Result 0.0, + (_, true) => 1.0, + _ => -1.0, + }; + bone(n, i as u16, x) + }); + let body = Drawable { skeleton: Some(drawable::Skeleton { bones: bones.collect() }), ..Default::default() }; + let wheel = |tag| drawable::FragmentChild { bone_tag: tag, drawable: Drawable::default() }; + let cloth = Drawable { meshes: vec![drawable::Mesh::default()], ..Default::default() }; + let fragment = drawable::Fragment { drawable: body, children: vec![wheel(1), wheel(2)], cloths: vec![cloth] }; + let (drawables, parts) = fragment_parts(fragment, "cart"); + assert_eq!(drawables.len(), 4); + let shown: Vec<(&str, bool)> = parts.iter().map(|p| (p.name.as_str(), p.visible)).collect(); + // The cloth in place; the blurred wheel hidden; only the plain right wheel gets a copy. + let expected = + [("cart", true), ("cloth", true), ("wheel_lf", true), ("wheel_lf_fast", false), ("wheel_rf", true)]; + assert_eq!(shown, expected); + assert_eq!((parts[1].group.as_str(), parts[1].transform), ("Cloth", math::IDENTITY)); + assert_eq!(parts[4].drawable, 2); + assert_eq!(parts[4].transform[12], 1.0); + } + #[test] fn cloth_follows_the_nearest_bones() { // A thigh going down from the pelvis, and the spine going up. diff --git a/crates/openrage-app/src/suggest.rs b/crates/openrage-app/src/suggest.rs index f405fff..8fbd5cd 100644 --- a/crates/openrage-app/src/suggest.rs +++ b/crates/openrage-app/src/suggest.rs @@ -62,6 +62,39 @@ const PED_CORE: [u16; 23] = [ 0xB1C5, 0x9D4D, 0xEEEB, 0x6E5C, 0x49D9, 0xDEAD, 0x9995, 0x796E, 0x322C, ]; +/// Main bones of Red Dead Redemption 2's people and animals. Their tags are +/// hashes of the names like every other bone's ([`bone_tag`]), not GTA V's +/// fixed ones; animals share these names, so they tell peds from objects +/// but not people from animals. +const RDR2_SKEL_CORE: [&str; 21] = [ + "SKEL_Pelvis", + "SKEL_Spine_Root", + "SKEL_Spine0", + "SKEL_Spine1", + "SKEL_Spine2", + "SKEL_Spine3", + "SKEL_Neck0", + "SKEL_Neck1", + "SKEL_Head", + "SKEL_L_Thigh", + "SKEL_L_Calf", + "SKEL_L_Foot", + "SKEL_R_Thigh", + "SKEL_R_Calf", + "SKEL_R_Foot", + "SKEL_L_Clavicle", + "SKEL_L_UpperArm", + "SKEL_L_Forearm", + "SKEL_R_Clavicle", + "SKEL_R_UpperArm", + "SKEL_R_Forearm", +]; + +fn rdr2_core() -> &'static HashSet { + static TAGS: OnceLock> = OnceLock::new(); + TAGS.get_or_init(|| RDR2_SKEL_CORE.iter().map(|n| bone_tag(n)).collect()) +} + /// The human skeleton's tags as a set (for ranking peds without loading them). pub fn ped_skeleton() -> Arc> { static TAGS: OnceLock>> = OnceLock::new(); @@ -169,7 +202,7 @@ pub fn classify(tags: &HashSet) -> Option { return None; } let ped = tags.iter().filter(|t| PED_TAGS.contains(t)).count(); - let core = tags.iter().filter(|t| PED_CORE.contains(t)).count(); + let core = tags.iter().filter(|t| PED_CORE.contains(t) || rdr2_core().contains(t)).count(); let vehicle = tags.iter().filter(|t| vehicle_tags().contains(t)).count(); // Cutscene peds also move a full facial rig of their own, so the main // body bones count on their own. @@ -243,6 +276,14 @@ pub fn clip_model(clip: &str) -> Option { (name.len() > 2).then(|| name.to_ascii_lowercase()) } +/// A clip named after the object it moves (RDR2's doors and destruction: +/// `p_door_barnslide01x`, `des_brt3_door_01`). +fn prop_clip(clip: &str) -> Option { + let name = clip.to_ascii_lowercase(); + let prop = ["p_", "prop_", "des_", "s_"].iter().any(|p| name.starts_with(p)); + (prop && !name.contains(['@', '/', ' '])).then_some(name) +} + /// Model names a dictionary name hints at, most specific first: /// `va_zion2` → `zion2`; `vehicle_cutter` → `cutter`; /// `anim@veh@armordillo@turret@base` → `armordillo`, `turret`. @@ -282,6 +323,10 @@ pub struct Profile { pub female: bool, /// Model names from cutscene clip names, then from the dictionary name. pub hints: Vec, + /// Moves RDR2's people or animals (their main bones, see [`RDR2_SKEL_CORE`]). + pub rdr2_peds: bool, + /// For RDR2's people and animals: every bone the dictionary moves. + all_bones: HashSet, } impl Profile { @@ -312,18 +357,25 @@ impl Profile { let animal = name.split("creatures@").nth(1).map(|rest| rest.split('@').next().unwrap_or(rest).to_owned()); let female = name.contains("_f@") || name.contains("female") || name.starts_with("move_f"); let mut hints: Vec = Vec::new(); - for h in clips.iter().filter_map(|c| clip_model(c)).chain(name_hints(ycd)) { + for h in clips.iter().filter_map(|c| clip_model(c).or_else(|| prop_clip(c))).chain(name_hints(ycd)) { if !hints.contains(&h) { hints.push(h); } } - Profile { animations, kinds, animal, female, hints } + let rdr2_peds = animations.iter().any(|(t, _)| t.iter().filter(|t| rdr2_core().contains(t)).count() >= 3); + let all_bones = + if rdr2_peds { animations.iter().flat_map(|(t, _)| t.iter().copied()).collect() } else { HashSet::new() }; + Profile { animations, kinds, animal, female, hints, rdr2_peds, all_bones } } pub fn describe(&self) -> String { if let Some(a) = &self.animal { return format!("Animal animation ({a})"); } + // Facial tracks of RDR2's people count as objects: say what the body is. + if self.rdr2_peds { + return "Animation of people or animals".into(); + } let names: Vec<&str> = self .kinds .iter() @@ -343,7 +395,16 @@ impl Profile { /// How well a skeleton fits: per mille of the best-fitting animation's /// bones it has, the number of those bones, and what that animation is for. + /// + /// RDR2's people and animals share the main bones' names, so a cow has + /// every bone of a clip that moves only the pelvis and spine. For them + /// the share of all the bones the dictionary moves counts instead (a + /// person has the fingers and face bones too). pub fn fit(&self, skeleton: &HashSet) -> (usize, usize, Option) { + if self.rdr2_peds { + let hits = self.all_bones.iter().filter(|t| skeleton.contains(t)).count(); + return (hits * 1000 / self.all_bones.len().max(1), hits, Some(Kind::Ped)); + } self.animations .iter() .map(|(a, k)| { @@ -476,6 +537,9 @@ pub fn skeleton_tags(game_dir: &Path, keys: Option>, vpath: &str) } let load = || -> Option { let (node, _) = rage_mods::resolve(game_dir, vpath, keys).ok()?; + if let Node::Rpf8File(rpf, i) = node { + return rdr2_skeleton(&rpf, i); + } let Node::ArchiveFile(rpf, id) = node else { return None }; let res = rpf.read_resource(id).ok()?; let lower = vpath.to_ascii_lowercase(); @@ -499,6 +563,83 @@ pub fn skeleton_tags(game_dir: &Path, keys: Option>, vpath: &str) tags } +/// The skeleton of an RDR2 model: a fragment's, a drawable's, a drawable +/// dictionary's own or its ped's base skeleton, or a ped's (outfit file). +fn rdr2_skeleton(rpf: &rage_rpf::Rpf8, i: usize) -> Option { + let full = rpf.entry_name(i); + let stem = model_stem(&full); + if crate::models::is_rdr2_ped_file(&full, rpf.display_name()) { + return crate::models::rdr2_ped_skeleton(&crate::rdr2::game_folder(rpf.path())?, &stem); + } + let res = rpf.read_resource(rpf.entries()?.get(i)?).ok()?; + let lower = full.to_ascii_lowercase(); + if lower.ends_with(".yft") { + return drawable::parse_fragment_rdr2(&res).ok()?.drawable.skeleton; + } + if lower.ends_with(".ydr") { + return drawable::parse_ydr_rdr2(&res).ok()?.skeleton; + } + let own = drawable::parse_ydd_rdr2(&res).ok()?.into_iter().find_map(|(_, d)| d.skeleton); + own.or_else(|| crate::models::rdr2_base_skeleton(rpf, &stem)) +} + +/// RDR2's peds and animals as candidates: their outfit files +/// (`…/metapeds.rpf/.ymt`), each with the tags of its base skeleton. +/// The base skeletons (a few hundred, shared by many peds) are read once, +/// in parallel. The player (Arthur) comes first, then story characters, +/// then the rest. +pub fn rdr2_ped_candidates(game_dir: &Path, outfit_files: Vec) -> Vec { + use rayon::prelude::*; + type Cache = Mutex>>>>; + static BASES: OnceLock = OnceLock::new(); + let cache = BASES.get_or_init(Default::default); + let mut files = outfit_files; + files.sort_by_key(|v| { + let n = model_stem(v); + (n != "player_zero", !n.starts_with("cs_"), n) + }); + files.dedup_by(|a, b| model_stem(a) == model_stem(b)); + let bases: Vec<(String, String)> = files + .iter() + .map(|v| { + let ped = model_stem(v); + (crate::models::rdr2_ped_base(game_dir, &ped).unwrap_or_default(), ped) + }) + .collect(); + let tags_of = |s: drawable::Skeleton| Arc::new(s.bones.iter().map(|b| b.tag).filter(|&t| t != 0).collect()); + // Base skeletons not read yet, from the archive of base skeletons. + let mut missing: Vec<&str> = bases.iter().map(|(b, _)| b.as_str()).filter(|b| !b.is_empty()).collect(); + missing.sort_unstable(); + missing.dedup(); + missing.retain(|b| cache.lock().is_ok_and(|c| !c.contains_key(*b))); + if let Some(frags) = crate::models::rdr2_base_skeletons(game_dir) { + let read: Vec<(String, Option>>)> = missing + .par_iter() + .map(|base| { + let skeleton = frags + .find(base) + .and_then(|i| frags.entries()?.get(i).cloned()) + .and_then(|e| frags.read_resource(&e).ok()) + .and_then(|res| drawable::fragment_skeleton_rdr2(&res).ok().flatten()); + (base.to_string(), skeleton.map(tags_of)) + }) + .collect(); + if let Ok(mut c) = cache.lock() { + c.extend(read); + } + } + files + .into_iter() + .zip(bases) + .map(|(vpath, (base, ped))| { + let cached = (!base.is_empty()).then(|| cache.lock().ok().and_then(|c| c.get(&base).cloned())).flatten(); + // Peds missing from the ped list: their skeleton guessed from the name. + let tags = cached.flatten().or_else(|| crate::models::rdr2_ped_skeleton(game_dir, &ped).map(tags_of)); + Candidate { vpath, tags } + }) + .collect() +} + #[cfg(test)] mod tests { use super::*; @@ -606,6 +747,32 @@ mod tests { ); } + #[test] + fn prop_clips_name_their_model() { + let door = set(&[bone_tag("door")]); + let p = profile("p_door", &[("p_door_barnslide01x", &door), ("idle", &door)]); + assert_eq!(p.hints[0], "p_door_barnslide01x"); + assert!(!p.hints.contains(&"idle".to_owned())); + } + + #[test] + fn rdr2_people_before_animals() { + let core = ["SKEL_Pelvis", "SKEL_Spine0", "SKEL_Spine1", "SKEL_Spine2", "SKEL_Neck0", "SKEL_Head"]; + let hands = ["SKEL_L_Finger00", "SKEL_L_Finger01", "SKEL_R_Finger00", "SKEL_R_Finger01", "SKEL_Spine6"]; + let body = names(&core); + let person: HashSet = names(&core).union(&names(&hands)).copied().collect(); + // A sitting clip: the body alone, then the body with the hands. + let p = profile("de817d5c", &[("base", &body), ("enter", &person)]); + assert!(p.rdr2_peds); + assert_eq!(p.describe(), "Animation of people or animals"); + // A cow has the body bones only; the person every bone. + let cow = Candidate { vpath: "metapeds.rpf/a_c_cow.ymt".into(), tags: Some(Arc::new(body.clone())) }; + let man = Candidate { vpath: "metapeds.rpf/cs_abe.ymt".into(), tags: Some(Arc::new(person.clone())) }; + assert_eq!(rank(&p, vec![cow, man]), ["metapeds.rpf/cs_abe.ymt", "metapeds.rpf/a_c_cow.ymt"]); + // GTA V's peds are not RDR2's. + assert!(!profile("move_m@generic", &[("walk", &set(&PED_CORE))]).rdr2_peds); + } + #[test] fn picks_the_clip_of_the_model() { let d: Vec<(String, HashSet)> = diff --git a/crates/openrage-cli/src/cmd/rdr2.rs b/crates/openrage-cli/src/cmd/rdr2.rs index 55de401..4e1fc1a 100644 --- a/crates/openrage-cli/src/cmd/rdr2.rs +++ b/crates/openrage-cli/src/cmd/rdr2.rs @@ -54,6 +54,9 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { /// PSO files rebuilt byte for byte, and ones not fully readable. identical: usize, unreadable: usize, + /// Fragment children with meshes (wheels) and cloths. + parts: usize, + cloths: usize, lines: Vec, } /// Parses a texture dictionary and decodes all its textures; returns how many. @@ -74,12 +77,19 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { } Ok(dict.textures.len()) } - /// Parses a model; returns its triangle count. - fn check_model(rpf: &Rpf8, e: &rage_rpf::rpf8::Entry) -> Result { + /// Parses a model; returns its triangle count, and for a fragment its + /// children with meshes and its cloths. + fn check_model(rpf: &Rpf8, e: &rage_rpf::rpf8::Entry) -> Result<(usize, usize, usize), String> { use rage_formats::drawable; let res = rpf.read_resource(e).map_err(|err| err.to_string())?; + let (mut parts, mut cloths) = (0, 0); let drawables = match e.ext_id { - 3 => vec![drawable::parse_fragment_rdr2(&res).map_err(|err| err.to_string())?.drawable], + 3 => { + // The body, the children with meshes (wheels) and the cloth. + let f = drawable::parse_fragment_rdr2(&res).map_err(|err| err.to_string())?; + (parts, cloths) = (f.children.len(), f.cloths.len()); + std::iter::once(f.drawable).chain(f.children.into_iter().map(|c| c.drawable)).chain(f.cloths).collect() + } 4 => drawable::parse_ydd_rdr2(&res).map_err(|err| err.to_string())?.into_iter().map(|(_, d)| d).collect(), _ => vec![drawable::parse_ydr_rdr2(&res).map_err(|err| err.to_string())?], }; @@ -94,7 +104,7 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { } } } - Ok(triangles) + Ok((triangles, parts, cloths)) } /// Converts a metadata file to XML; returns how many problems it had. fn check_meta(rpf: &Rpf8, e: &rage_rpf::rpf8::Entry) -> Result { @@ -249,9 +259,11 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { } else if models { if matches!(e.ext_id, 2..=4) && e.is_resource { match check_model(rpf, e) { - Ok(n) => { + Ok((n, parts, cloths)) => { t.textures += 1; t.triangles += n; + t.parts += parts; + t.cloths += cloths; } Err(err) => { t.failed += 1; @@ -339,6 +351,7 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { let mut textures_total = 0; let mut triangles_total = 0; let (mut identical, mut unreadable) = (0, 0); + let (mut parts_total, mut cloths_total) = (0, 0); for (_, t) in &tallies { for l in &t.lines { outln!("{l}"); @@ -355,12 +368,17 @@ pub(crate) fn cmd_rpf8(path: &Path, list: bool, checks: Checks) -> Result<()> { triangles_total += t.triangles; identical += t.identical; unreadable += t.unreadable; + parts_total += t.parts; + cloths_total += t.cloths; } if textures { outln!("\n{textures_total} textures decoded"); } if models { - outln!("\n{textures_total} models parsed ({triangles_total} triangles)"); + outln!( + "\n{textures_total} models parsed ({triangles_total} triangles; fragments: {parts_total} parts, \ + {cloths_total} cloths)" + ); } if text { outln!("\n{textures_total} text tables read ({triangles_total} strings)"); diff --git a/crates/openrage-gui/src/debug.rs b/crates/openrage-gui/src/debug.rs index 3e1e47d..dfc34f5 100644 --- a/crates/openrage-gui/src/debug.rs +++ b/crates/openrage-gui/src/debug.rs @@ -109,6 +109,11 @@ pub(crate) fn debug_viewer(ui: &AppWindow) { if let Some(i) = (0..rows.row_count()).find(|&i| rows.row_data(i).is_some_and(|r| r.name == clip)) { v.invoke_anim_select(i as i32); } + // `OPENRAGE_ANIM_AT=<0..1>`: pause there (a share of the clip). + if let Ok(at) = std::env::var("OPENRAGE_ANIM_AT") { + v.invoke_anim_toggle(); + v.invoke_anim_seek(at.parse().unwrap_or(0.0)); + } } if let Ok(hex) = std::env::var("OPENRAGE_PAINT") { use slint::Model; diff --git a/crates/openrage-gui/src/model_ui.rs b/crates/openrage-gui/src/model_ui.rs index d2c071e..ff73b76 100644 --- a/crates/openrage-gui/src/model_ui.rs +++ b/crates/openrage-gui/src/model_ui.rs @@ -205,7 +205,21 @@ pub(crate) fn suggest_models(game_dir: &Path, keys: Option>, profi } let mut candidates: Vec = Vec::new(); let mut load: Vec = named.clone(); - if let Some(animal) = &profile.animal { + if is_rdr2_dir(game_dir) { + // RDR2's people and animals share bone names: rank them all by their + // base skeletons (vehicles and objects follow below as for GTA V). + if profile.kinds.contains(&suggest::Kind::Ped) || profile.rdr2_peds { + // The game has some 90,000 `.ymt` files; the outfit files are among them. + let outfits: Vec = search(".ymt", 200_000) + .into_iter() + .filter(|v| { + let (dir, name) = v.rsplit_once('/').unwrap_or(("", v)); + openrage_app::models::is_rdr2_ped_file(name, dir) + }) + .collect(); + candidates.extend(suggest::rdr2_ped_candidates(game_dir, outfits)); + } + } else if let Some(animal) = &profile.animal { load.extend(search(&format!("a_c_{animal}"), 160).into_iter().filter(|v| v.ends_with(".ydd"))); } else if profile.kinds.contains(&suggest::Kind::Ped) { // All peds share one skeleton: no need to load each. @@ -243,9 +257,17 @@ pub(crate) fn suggest_models(game_dir: &Path, keys: Option>, profi load.extend(vehicles); } if profile.kinds.contains(&suggest::Kind::Prop) && named.is_empty() { - // Objects sharing a word of the dictionary name. - if let Some(word) = profile.hints.iter().filter(|h| !h.contains('@')).max_by_key(|h| h.len()) { - load.extend(search(word, 400).into_iter().filter(|v| is_model(v)).take(80)); + // Objects sharing a word of the dictionary or clip names: the + // longest that names any model (RDR2's prop clips name models whose + // file names are not known). + let mut words: Vec<&String> = profile.hints.iter().filter(|h| !h.contains('@')).collect(); + words.sort_by_key(|h| std::cmp::Reverse(h.len())); + for word in words.into_iter().take(6) { + let models: Vec = search(word, 400).into_iter().filter(|v| is_model(v)).take(80).collect(); + if !models.is_empty() { + load.extend(models); + break; + } } } load.sort(); diff --git a/crates/rage-formats/src/clip.rs b/crates/rage-formats/src/clip.rs index 1212c9f..2fc7009 100644 --- a/crates/rage-formats/src/clip.rs +++ b/crates/rage-formats/src/clip.rs @@ -785,25 +785,30 @@ pub fn parse_ycd_rdr2(res: &Resource) -> Result { let name_ptr = res.u64(clip + 0x28)?; let name = if name_ptr != 0 { res.string(name_ptr).unwrap_or_default() } else { String::new() }; let name = name.strip_prefix("pack:/").unwrap_or(&name).trim_end_matches(".clip").to_owned(); - // Parts (played one after another): each a list of animation - // layers and a duration. The first layer is the part's animation: - // pointer, then start, end and rate at 0x28. - let list = res.u64(clip + 0x68)?; - let n = res.u16(clip + 0x70)? as u64; + // A layer: animation pointer, then start, end and rate at 0x28. + let layer = |at: u64| -> Result, ResourceError> { + Ok(index_of(res.u64(at)?).map(|animation| ClipPart { + animation, + start: f32::from_bits(res.u32(at + 0x28).unwrap_or(0)), + end: f32::from_bits(res.u32(at + 0x2C).unwrap_or(0)), + rate: f32::from_bits(res.u32(at + 0x30).unwrap_or(0)), + })) + }; let mut parts = Vec::new(); - for i in 0..n.min(256) { - let part = list + i * RDR2_CLIP_PART; - let (layers, layer_count) = (res.u64(part)?, res.u16(part + 8)?); - if layers == 0 || layer_count == 0 { - continue; - } - if let Some(animation) = index_of(res.u64(layers)?) { - parts.push(ClipPart { - animation, - start: f32::from_bits(res.u32(layers + 0x28)?), - end: f32::from_bits(res.u32(layers + 0x2C)?), - rate: f32::from_bits(res.u32(layers + 0x30)?), - }); + if res.u32(clip + 0x20)? == RDR2_CLIP_SINGLE { + // One animation (props, destruction): the layer is in the clip. + parts.extend(layer(clip + 0x68)?); + } else { + // Parts (played one after another): each a list of animation + // layers and a duration. The first layer is the part's animation. + let list = res.u64(clip + 0x68)?; + let n = res.u16(clip + 0x70)? as u64; + for i in 0..n.min(256) { + let part = list + i * RDR2_CLIP_PART; + let (layers, layer_count) = (res.u64(part)?, res.u16(part + 8)?); + if layers != 0 && layer_count != 0 { + parts.extend(layer(layers)?); + } } } let sequential = parts.len() > 1; @@ -816,6 +821,10 @@ pub fn parse_ycd_rdr2(res: &Resource) -> Result { /// Resource version of Red Dead Redemption 2's clip dictionaries. pub const RDR2_VERSION: u32 = 58; +/// Kind (at `0x20` of a clip) of an RDR2 clip that plays one animation; the +/// others (`2`) have a list of parts. +const RDR2_CLIP_SINGLE: u32 = 1; + /// Size of a part of an RDR2 clip (layer list, count, capacity, duration). const RDR2_CLIP_PART: u64 = 0x18; @@ -898,6 +907,59 @@ mod tests { assert_eq!(actor.part_at(20.0).unwrap().0, 2); } + /// A minimal RDR2 clip dictionary: one animation (no tracks) and one clip + /// of `kind`: its layer in the clip, or in a list of parts. + fn rdr2_ycd(kind: u32) -> Resource { + const BASE: u64 = 0x5000_0000; + let mut m = vec![0u8; 0x400]; + let mut put = |at: usize, v: &[u8]| m[at..at + v.len()].copy_from_slice(v); + let ptr = |o: usize| (BASE + o as u64).to_le_bytes(); + // Root: clips map (buckets 0x100, 1) and animation dictionaries (0x110, 1). + put(0x48, &ptr(0x100)); + put(0x50, &1u16.to_le_bytes()); + put(0x70, &ptr(0x110)); + put(0x78, &1u16.to_le_bytes()); + put(0x100, &ptr(0x120)); // clip map entry + put(0x128, &ptr(0x200)); // -> clip + put(0x110, &ptr(0x140)); // animation dictionary + put(0x140 + 0x48, &ptr(0x1C0)); + put(0x140 + 0x50, &1u16.to_le_bytes()); + put(0x1C0, &ptr(0x1D0)); // animation map entry + put(0x1D8, &ptr(0x300)); // -> animation + put(0x300 + 0x24, &31u16.to_le_bytes()); + put(0x300 + 0x28, &1.0f32.to_le_bytes()); + // The clip: kind, name, then the layer or the part list at 0x68. + put(0x200 + 0x20, &kind.to_le_bytes()); + put(0x200 + 0x28, &ptr(0x3C0)); + put(0x3C0, b"pack:/p_door01x.clip\0"); + let layer = if kind == RDR2_CLIP_SINGLE { + 0x200 + 0x68 + } else { + put(0x200 + 0x68, &ptr(0x2C0)); + put(0x200 + 0x70, &1u16.to_le_bytes()); + put(0x2C0, &ptr(0x2E0)); // part: layers, count + put(0x2C8, &1u16.to_le_bytes()); + 0x2E0 + }; + put(layer, &ptr(0x300)); + put(layer + 0x28, &0.0f32.to_le_bytes()); + put(layer + 0x2C, &1.0f32.to_le_bytes()); + put(layer + 0x30, &1.0f32.to_le_bytes()); + Resource { version: RDR2_VERSION, system: m, graphics: Vec::new() } + } + + #[test] + fn rdr2_clips_of_one_animation_and_of_parts() { + for kind in [RDR2_CLIP_SINGLE, 2] { + let dict = parse_ycd(&rdr2_ycd(kind)).unwrap(); + assert_eq!(dict.animations.len(), 1); + let clip = &dict.clips[0]; + assert_eq!(clip.name, "p_door01x"); + assert_eq!(clip.parts.len(), 1, "kind {kind}"); + assert_eq!((clip.parts[0].animation, clip.parts[0].end, clip.parts[0].rate), (0, 1.0, 1.0)); + } + } + #[test] fn bit_reader() { let data = [0b1010_1100u8, 0b0000_0011]; diff --git a/crates/rage-formats/src/drawable.rs b/crates/rage-formats/src/drawable.rs index ab86b00..09d3d33 100644 --- a/crates/rage-formats/src/drawable.rs +++ b/crates/rage-formats/src/drawable.rs @@ -239,6 +239,8 @@ pub struct Fragment { pub drawable: Drawable, /// Children with meshes of their own (e.g. wheels). pub children: Vec, + /// Cloth (RDR2's flags and straps) in its rest pose, in model space. + pub cloths: Vec, } impl Drawable { @@ -819,10 +821,56 @@ pub fn parse_yft(res: &Resource) -> Result { Ok(parse_fragment(res)?.drawable) } -/// A `.yft` file with the child drawables (wheels and other parts). /// A Red Dead Redemption 2 `.yft`: its main drawable (at `0x20` of the -/// fragment; found among the root's pointers if not). Children are not read yet. +/// fragment; found among the root's pointers if not) and the children with +/// meshes of their own (wheels, see [`read_fragment_children_rdr2`]). pub fn parse_fragment_rdr2(res: &Resource) -> Result { + let body = read_drawable_gen(res, fragment_drawable_rdr2(res)?, Gen::Rdr2)?; + // Cloth and children are optional extras, as in GTA V. + let (cloth_ptrs, cloths) = read_cloths_rdr2(res, &body).unwrap_or_default(); + let children = read_fragment_children_rdr2(res, &body, &cloth_ptrs).unwrap_or_default(); + Ok(Fragment { drawable: body, children, cloths }) +} + +/// The cloth of an RDR2 fragment (flags, straps, awnings), in its rest pose: +/// a list at `0x48` of the fragment (16-byte entries, `u16` count at +/// `0x50`), each cloth with its drawable at `0x18`. A cloth drawable without +/// shaders of its own uses the body's. Returns the drawables' addresses too +/// (a cloth's drawable can also be a child of the physics LOD). +fn read_cloths_rdr2(res: &Resource, body: &Drawable) -> Result<(Vec, Vec), ResourceError> { + let ok = |p: u64| (0x5000_0000..0x6000_0000).contains(&p); + let list = res.u64(Resource::ROOT + 0x48)?; + if !ok(list) { + return Ok(Default::default()); + } + let (mut ptrs, mut out) = (Vec::new(), Vec::new()); + for i in 0..res.u16(Resource::ROOT + 0x50)?.min(64) as u64 { + let cloth = res.u64(list + i * 16)?; + let ptr = if ok(cloth) { res.u64(cloth + 0x18)? } else { 0 }; + if !ok(ptr) || ptrs.contains(&ptr) { + continue; + } + let mut drawable = read_drawable_gen(res, ptr, Gen::Rdr2)?; + if drawable.shaders.is_empty() { + drawable.shaders = body.shaders.clone(); + } + ptrs.push(ptr); + if !drawable.meshes.is_empty() { + out.push(drawable); + } + } + Ok((ptrs, out)) +} + +/// Only the skeleton of an RDR2 `.yft` (much faster than reading the meshes). +pub fn fragment_skeleton_rdr2(res: &Resource) -> Result, ResourceError> { + let skeleton = res.u64(fragment_drawable_rdr2(res)? + 0x18)?; + Ok(if skeleton != 0 { Some(read_skeleton_gen(res, skeleton, Gen::Rdr2)?) } else { None }) +} + +/// The main drawable of an RDR2 fragment: at `0x20`, else the first of the +/// root's pointers that looks like one. +fn fragment_drawable_rdr2(res: &Resource) -> Result { let root = Resource::ROOT; let looks_like_drawable = |p: u64| -> bool { let ok = |q: u64| (0x5000_0000..0x6000_0000).contains(&q); @@ -833,11 +881,79 @@ pub fn parse_fragment_rdr2(res: &Resource) -> Result { }) }; let candidates = std::iter::once(0x20).chain((0..0xC0).step_by(8)); - let drawable = candidates - .filter_map(|o| res.u64(root + o).ok()) - .find(|&p| looks_like_drawable(p)) - .ok_or_else(|| bad("fragment without a drawable"))?; - Ok(Fragment { drawable: read_drawable_gen(res, drawable, Gen::Rdr2)?, children: Vec::new() }) + let found = candidates.filter_map(|o| res.u64(root + o).ok()).find(|&p| looks_like_drawable(p)); + // A fragment that is all cloth (a strap): the body has shaders and a + // skeleton but no meshes of its own. + let ok = |q: u64| (0x5000_0000..0x6000_0000).contains(&q); + let body_of_cloth = || { + let p = res.u64(root + 0x20).ok().filter(|&p| ok(p))?; + (res.u64(p + 0x10).is_ok_and(ok) && res.u64(root + 0x48).is_ok_and(ok)).then_some(p) + }; + found.or_else(body_of_cloth).ok_or_else(|| bad("fragment without a drawable")) +} + +/// The children of an RDR2 fragment that have meshes. The physics LOD group +/// is at `0x90` of the fragment, its first LOD at `0x10`. Unlike GTA V's, a +/// child is a drawable itself (list at `0x118` of the LOD, `u8` count at +/// `0x146`) without a shader group: its meshes use the body's shaders. Its +/// bone is named by its group (group of each child: `u16` list at `0x110`; +/// groups at `0xC8`, with the parent group at `+0x06` and the name at +/// `+0x4F`), and a group without a bone of that name sits on its parent's. +fn read_fragment_children_rdr2( + res: &Resource, + body: &Drawable, + cloths: &[u64], +) -> Result, ResourceError> { + let ok = |p: u64| (0x5000_0000..0x6000_0000).contains(&p); + let group = res.u64(Resource::ROOT + 0x90)?; + if !ok(group) { + return Ok(Vec::new()); + } + let Some(lod) = (0..3).map(|i| res.u64(group + 0x10 + i * 8)).find_map(|p| p.ok().filter(|&p| ok(p))) else { + return Ok(Vec::new()); + }; + let (groups, group_of, list) = (res.u64(lod + 0xC8)?, res.u64(lod + 0x110)?, res.u64(lod + 0x118)?); + let (group_count, count) = (res.u8(lod + 0x140)? as u64, res.u8(lod + 0x146)? as u64); + if !ok(groups) || !ok(group_of) || !ok(list) { + return Ok(Vec::new()); + } + let skeleton = body.skeleton.as_ref(); + // The bone of group `g`: by its name, else its parent's (at most 64 steps up). + let bone_of = |mut g: u64| -> Option { + let skeleton = skeleton?; + for _ in 0..64 { + if g >= group_count { + return None; + } + let at = res.u64(groups + g * 8).ok().filter(|&p| ok(p))?; + let name = res.string(at + 0x4F).ok()?; + if let Some(b) = skeleton.find_name(&name) { + return Some(skeleton.bones[b].tag); + } + g = res.u8(at + 0x06).ok().filter(|&p| p != 0xFF)? as u64; + } + None + }; + let mut seen = cloths.to_vec(); + let mut out = Vec::new(); + for i in 0..count { + let ptr = res.u64(list + i * 8)?; + if !ok(ptr) || seen.contains(&ptr) { + continue; + } + seen.push(ptr); + let mut drawable = read_drawable_gen(res, ptr, Gen::Rdr2)?; + if drawable.meshes.is_empty() { + continue; + } + if drawable.shaders.is_empty() { + drawable.shaders = body.shaders.clone(); + } + let g = res.u16(group_of + i * 2)? as u64; + let bone_tag = bone_of(g).or_else(|| skeleton.and_then(|s| s.bones.first()).map(|b| b.tag)).unwrap_or(0); + out.push(FragmentChild { bone_tag, drawable }); + } + Ok(out) } pub fn parse_fragment(res: &Resource) -> Result { @@ -853,7 +969,7 @@ pub fn parse_fragment(res: &Resource) -> Result { } // Children are optional extras: a fragment without readable ones is still fine. let children = read_fragment_children(res, enhanced).unwrap_or_default(); - Ok(Fragment { drawable: d, children }) + Ok(Fragment { drawable: d, children, cloths: Vec::new() }) } fn read_fragment_children(res: &Resource, enhanced: bool) -> Result, ResourceError> { diff --git a/crates/rage-formats/src/wdr.rs b/crates/rage-formats/src/wdr.rs index 25f8fab..da25ddf 100644 --- a/crates/rage-formats/src/wdr.rs +++ b/crates/rage-formats/src/wdr.rs @@ -315,7 +315,7 @@ pub fn parse_wft(res: &Resource) -> Result { } let mut drawable = read_drawable(res, main)?; drawable.name = fragment_name(res).unwrap_or_default(); - let mut fragment = Fragment { drawable, children: Vec::new() }; + let mut fragment = Fragment { drawable, ..Default::default() }; let list = ptr(res, root + 0xD4)?; let count = res.u8(root + 0x1F2)? as u64; if !valid(res, list) { diff --git a/site/content/rdr2.md b/site/content/rdr2.md index 6f41a1d..34ee06d 100644 --- a/site/content/rdr2.md +++ b/site/content/rdr2.md @@ -61,7 +61,7 @@ Only the Steam version of 2 April 2024 is known so far; other versions report wh |---|---|---| | Archives | `.rpf` (RPF8) | browse, extract, change (into `lml/replace`, with undo) | | Textures | `.ytd` | view, export DDS/PNG, replace (same format, size and mips) | -| Models | `.ydr`, `.ydd`, `.yft` | view, export glTF | +| Models | `.ydr`, `.ydd`, `.yft` | view with moving parts and cloth, export glTF | | Peds and animals | `metapeds` outfits | put together with outfits, tints and face shapes | | Animations | `.ycd` | play, partly approximated | | Metadata | `.ymap`, `.ytyp`, `.ymt`, `.ymf`, `.meta` | view as XML | @@ -159,7 +159,15 @@ Many vehicles, weapons and props are coloured from palettes: their colour textur colour comes from a slot per vertex. OpenRAGE bakes them into ordinary textures: vehicles in the colours of their first variation (`carvariations.ymt`), props and weapons in their first tint. -**Not yet:** moving parts of fragments, skeleton animations of models and cloth. +Fragments (`.yft`) show their moving parts like GTA V's: a wagon's wheels sit on their bones, one wheel copied to the +other side, and follow animations. The blurred wheels the game shows at speed (`wheel_lf_fast`) are listed under +*Parts* but hidden. + +**Cloth** shows in its rest pose, as the game stores it before it moves it: flags, awnings and straps of fragments are +listed as *Cloth* under *Parts*, and people's coats and skirts are part of their outfits' models (their `.yld` files +only hold the simulation). The cloth does not sway: it moves only with the bones it hangs from. + +**Checked:** all 113,468 models, with 628 moving parts and 894 cloths of fragments. ## Peds and animals @@ -191,13 +199,20 @@ openrage model …/metapeds.rpf/.ymt --outfit 2 --export ped.glb ## Animations -Clip dictionaries (`.ycd`) open like GTA V's: select one to list its clips, or paste its path into the viewer's -animation search to play a clip on a model. +Clip dictionaries (`.ycd`) open like GTA V's: select one to see its clips and a list of fitting models, best first; +click one, or double-click the dictionary, to open it in the viewer with the animation playing. In the viewer, paste a +dictionary's path into the animation search. + +- **People and animals** share the main bones' names in RDR2, so every ped (`…/metapeds.rpf/.ymt`) is ranked by + how many of the dictionary's bones its base skeleton has: a sitting clip lists Arthur and the other people first, a + cow last. Most dictionaries are named only by a hash, so the bones decide. +- **Vehicles, doors and destruction** play on their models: wheels and other parts of fragments move with their + bones, and a destruction clip (`des_…`) lists the models it was made for. RDR2 uses one kind of animation data whose key values are not fully understood yet. Those tracks are interpolated, so the timing is right to four frames but fast motion comes out softened; the viewer says so. -**Checked:** 359,466 clips, every frame evaluated. +**Checked:** 607,406 clips with 220,688 animations, every frame evaluated. ## Metadata From 6686a1645e677bb04d365cae42a4d9e553d60525 Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 22:34:36 +0100 Subject: [PATCH 5/8] OBJ import: wheels, mod parts, .ydd, bone weights, collisions (#139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * OBJ import: vehicle wheels, .ydd drawables, bone weights from the original The model writer now writes into any drawable of a file (`Place`): the main drawable, a fragment child's own model (a vehicle's wheel, its meshes in the bone's space, its shader copies in the main drawable's group) and every drawable of a `.ydd`, several at once (`replace_parts`). Skinned vertices can be blended between up to four bones (`NewMesh::blend`); a geometry gets a bone table of its own when the template's lacks some of the bones. The OBJ import routes parts by name: `wheel_lf` replaces the wheel model (copies on the other wheel bones are left out, as the game makes them), parts named after a dictionary's drawable replace it (`--drawable` for the rest), and models blended between bones (peds, clothing) take the weights of the original's nearest vertex, as OBJ cannot carry weights. The plugin `build-model` takes the same path, also for `.ydd`. `verify --models --rebuild` now rewrites the body and wheel models of every `.yft` and every drawable of every `.ydd` too, with all bone weights. Co-Authored-By: Claude Opus 5.5 * Vehicle mod parts in the viewer; importing onto them A vehicle's mod parts (the .yft files of its _mods.rpf archives) are listed under Parts as "Mods: bonnet", "Mods: spoiler" …, hidden at first, each on the bone the game's carcols files name for it (PSO files keep the model names as hashes, so placements are looked up by hash). The archives are found once per game. Importing an OBJ onto a mod part already worked except for textures: mod archives have no texture structure to lend, so the shared vehshare.ytd does. Co-Authored-By: Claude Opus 5.5 * Collisions from OBJ: --collision for drawables, .ybn files New `ybn_write`: a triangle mesh as a BVH bound (type 8), copied from a BVH bound of the original (or, for collisions of boxes and spheres only, of another one of the game), with shared quantized vertices, edge neighbours, material types per triangle and the hierarchy built the way the game's are (leaves of up to four polygons in order, subtree sizes, Bullet's subtree headers). `check_bvh` checks hierarchies against that reading; it passes on the game's own. `replace-model prop.ydr model.obj --collision col.obj` replaces a drawable's collision, `replace-model x.ybn col.obj` a collision file's; OBJ materials named after a collision material get it. A composite keeps one child, the new bound. Fragments (vehicles) keep theirs: it is split over the physics parts. `verify --collisions --rebuild` checks the game's hierarchies, then writes every collision anew from its own triangles and compares what reads back. Co-Authored-By: Claude Opus 5.5 * Collision check by area; texture structure from the first readable texture The new collision is one bound, so its vertex grid is that of the whole collision; slivers (tessellated tiny spheres and capsules) can collapse. The check compares the area per material and allows triangles only to get fewer. Documented: vertices lie on 1/65,534 of the collision's size. Embedded dictionaries can list empty entries: the writer copies the first texture there is instead of the first entry. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- crates/openrage-app/src/lib.rs | 1 + crates/openrage-app/src/models.rs | 92 ++- crates/openrage-app/src/obj.rs | 771 +++++++++++++++++++++--- crates/openrage-app/src/plugins.rs | 122 ++-- crates/openrage-app/src/vehicle_mods.rs | 173 ++++++ crates/openrage-cli/src/cli.rs | 26 +- crates/openrage-cli/src/cmd/edit.rs | 173 ++++-- crates/openrage-cli/src/cmd/verify.rs | 482 +++++++++++---- crates/openrage-cli/src/main.rs | 15 +- crates/rage-formats/src/lib.rs | 1 + crates/rage-formats/src/ybn_write.rs | 688 +++++++++++++++++++++ crates/rage-formats/src/ydr_write.rs | 510 +++++++++++++--- plugins/examples/obj-tools/plugin.toml | 4 +- site/content/cli.md | 9 +- site/content/modding.md | 50 +- site/content/plugins.md | 2 +- site/content/viewers.md | 8 +- 17 files changed, 2654 insertions(+), 473 deletions(-) create mode 100644 crates/openrage-app/src/vehicle_mods.rs create mode 100644 crates/rage-formats/src/ybn_write.rs diff --git a/crates/openrage-app/src/lib.rs b/crates/openrage-app/src/lib.rs index 826ae93..0c4b07d 100644 --- a/crates/openrage-app/src/lib.rs +++ b/crates/openrage-app/src/lib.rs @@ -37,6 +37,7 @@ pub mod suggest; pub mod texttable; pub mod textures; pub mod tint; +pub mod vehicle_mods; pub mod world; pub mod xmltree; diff --git a/crates/openrage-app/src/models.rs b/crates/openrage-app/src/models.rs index 5ee4c09..23503de 100644 --- a/crates/openrage-app/src/models.rs +++ b/crates/openrage-app/src/models.rs @@ -272,6 +272,21 @@ impl LoadedModel { /// Ped component names (`head_000_r`, `uppr_001_u`, …) by hash: drawable /// dictionaries of peds only store the hashes. +/// The names of a `.ydd`'s drawables as the viewer shows them (and OBJ +/// export names their parts): ped components by name (`uppr_000_u`), others +/// `#`, or `#` without a hash. +pub fn dictionary_names(stem: &str, hashes: &[u32]) -> Vec { + hashes + .iter() + .enumerate() + .map(|(i, &hash)| match ped_component_names().get(&hash) { + Some(n) => n.clone(), + None if hash != 0 => format!("{stem}#{hash:08x}"), + None => format!("{stem}#{i}"), + }) + .collect() +} + fn ped_component_names() -> &'static HashMap { static NAMES: OnceLock> = OnceLock::new(); NAMES.get_or_init(|| { @@ -448,6 +463,57 @@ fn fragment_parts(fragment: drawable::Fragment, name: &str) -> (Vec<(String, Dra (drawables, parts) } +/// A vehicle's mod parts ([`crate::vehicle_mods`]), hidden at first, each on +/// the bone the game puts it on, grouped by kind (`Mods: bonnet`). +fn add_mod_parts( + game_dir: &Path, + keys: Option>, + vehicle: &str, + drawables: &mut Vec<(String, Drawable)>, + parts: &mut Vec, +) { + let Some(skeleton) = drawables.first().and_then(|(_, d)| d.skeleton.clone()) else { return }; + // Vehicles only: their skeleton has a chassis. + if skeleton.find_name("chassis").is_none() { + return; + } + let world = skeleton.world_transforms(); + let mods = crate::vehicle_mods::mod_parts(game_dir, keys.clone(), vehicle); + let total = mods.len() as u64; + for (k, m) in mods.into_iter().enumerate() { + crate::progress::set("Loading the mod parts", k as u64, total); + let Ok((Node::ArchiveFile(rpf, id), _)) = rage_mods::resolve(game_dir, &m.vpath, keys.clone()) else { + continue; + }; + let Some(fragment) = rpf.read_resource(id).ok().and_then(|r| drawable::parse_fragment(&r).ok()) else { + continue; + }; + if fragment.drawable.meshes.is_empty() { + continue; + } + // By name, or by its hash where `carcols` keeps one. + let bone = m.bone.as_deref().and_then(|b| { + let hash = rage_formats::names::parse(&b.to_ascii_lowercase()); + skeleton.find_name(b).or_else(|| { + skeleton.bones.iter().position(|x| rage_core::hash::joaat(&x.name.to_ascii_lowercase()) == hash) + }) + }); + let kind = m.kind.as_deref().map(crate::vehicle_mods::kind_label).unwrap_or_else(|| "other".into()); + parts.push(Part { + name: m.name.clone(), + group: format!("Mods: {kind}"), + drawable: drawables.len(), + transform: bone.and_then(|b| world.get(b)).copied().unwrap_or(math::IDENTITY), + visible: false, + bone, + }); + let mut d = fragment.drawable; + // Its own one-bone skeleton is not the vehicle's. + d.skeleton = None; + drawables.push((m.name, d)); + } +} + /// RDR2 wheel bones besides the wheel itself: the blurred one shown at /// speed (`wheel_lf_fast`) and the one for upgrades (`wheel_lf_mod`). fn is_wheel_variant(bone: &str) -> bool { @@ -525,7 +591,8 @@ fn register_gta4_materials(archive: &rage_rpf::Gta4Archive, bounds: &[(String, D } /// Names of the collision materials, read once from the game's `materials.dat`. -fn collision_material_names(game_dir: &Path, keys: Option>) -> &'static [String] { +/// The names of the game's collision materials (`materials.dat`), by type. +pub fn collision_material_names(game_dir: &Path, keys: Option>) -> &'static [String] { static NAMES: std::sync::OnceLock> = std::sync::OnceLock::new(); NAMES.get_or_init(|| { for path in ["update/update.rpf/common/data/materials/materials.dat", "common.rpf/data/materials/materials.dat"] @@ -614,7 +681,7 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu let lower = name.to_ascii_lowercase(); let stem = name.split('.').next().unwrap_or(&name).to_owned(); let mut external = Vec::new(); - let (drawables, parts) = if rage_formats::paths::is_path_file(&lower) { + let (mut drawables, mut parts) = if rage_formats::paths::is_path_file(&lower) { let ext = lower.rsplit('.').next().unwrap_or_default(); let (path, _) = rage_formats::paths::parse(&res, ext)?; let part = Part { @@ -678,18 +745,10 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu } (drawables, parts) } else if lower.ends_with(".ydd") { - let drawables: Vec<(String, Drawable)> = drawable::parse_ydd(&res)? - .into_iter() - .enumerate() - .map(|(i, (hash, d))| { - let name = match ped_component_names().get(&hash) { - Some(n) => n.clone(), - None if hash != 0 => format!("{stem}#{hash:08x}"), - None => format!("{stem}#{i}"), - }; - (name, d) - }) - .collect(); + let parsed = drawable::parse_ydd(&res)?; + let hashes: Vec = parsed.iter().map(|(h, _)| *h).collect(); + let drawables: Vec<(String, Drawable)> = + dictionary_names(&stem, &hashes).into_iter().zip(parsed).map(|(name, (_, d))| (name, d)).collect(); let names: Vec = drawables.iter().map(|(n, _)| n.clone()).collect(); // Peds are assembled in place; other dictionaries are laid out in a grid. let layout = @@ -748,6 +807,10 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu bail!("{name} is not a model (.ydr, .yft, .ydd, .ypt, .ybn, .ynd, .yvr, .ywr)"); }; + if lower.ends_with(".yft") { + add_mod_parts(game_dir, keys.clone(), &stem, &mut drawables, &mut parts); + } + // Textures usually live next to the model: adder.yft → adder.ytd (+ vehshare.ytd for vehicles). let dir = rpf.entry(id).parent.unwrap_or(rage_rpf::Rpf7::ROOT); let mut candidates = vec![format!("{stem}.ytd"), format!("{stem}+hi.ytd")]; @@ -798,7 +861,6 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu let tid = rpf.find_child(dir, &format!("{stem}.yft"))?; drawable::parse_fragment(&rpf.read_resource(tid).ok()?).ok()?.drawable.skeleton }); - let mut drawables = drawables; if let Some(sk) = &skeleton { fit_to_skeleton(&mut drawables, sk); } diff --git a/crates/openrage-app/src/obj.rs b/crates/openrage-app/src/obj.rs index dc1360d..1b9053b 100644 --- a/crates/openrage-app/src/obj.rs +++ b/crates/openrage-app/src/obj.rs @@ -11,7 +11,8 @@ use std::sync::Arc; use anyhow::{Context, Result, bail}; use rage_crypto::GtaVKeys; use rage_formats::texture::Texture; -use rage_formats::ydr_write::{MAX_VERTICES, NewMaterial, NewMesh, ShaderInfo}; +use rage_formats::ydr_write::{Blend, MAX_VERTICES, NewMaterial, NewMesh, Place, ShaderInfo}; +use rage_resource::Resource; use rage_rpf::vfs::Node; /// Triangles of one material. @@ -240,23 +241,6 @@ pub fn decode_png(data: &[u8]) -> Result<(u32, u32, Vec)> { Ok((info.width, info.height, rgba)) } -/// Puts OBJ meshes of one or more detail levels on materials: every OBJ -/// material (by name, across levels) becomes one [`NewMaterial`] on a -/// template shader (in order, the last taking the rest, or all on `shader`) -/// with its texture, if `textures` has one. -pub struct Fitter<'a> { - shaders: &'a [u16], - shader: Option, - textures: &'a HashMap, - /// (OBJ material name, material) - pub materials: Vec<(String, NewMaterial)>, - bones: Option, - infos: Vec, - /// Materials whose texture was not used: their shader takes none, so - /// it keeps its own. - pub textures_kept: Vec, -} - /// The template shader a material is named after: OpenRAGE's OBJ export /// names materials `_` and their images after the /// texture, so exported models go back on the shaders they came from. @@ -283,8 +267,34 @@ pub fn fit_texture(infos: &[ShaderInfo], shader: u16, texture: Option) } } +/// What a part's name says, without what tools add: after a dot +/// (`door_dside_f.001`), a level suffix (`_lod1`); with and without a number +/// at the end (`door_dside_f_3`, from OpenRAGE's OBJ export). +fn name_candidates(part: &str) -> (String, Option) { + let lower = part.trim().to_ascii_lowercase(); + let base = lower.split('.').next().unwrap_or(""); + let base = (1..=3).find_map(|k| base.strip_suffix(&format!("_lod{k}"))).unwrap_or(base); + let numbered = base + .rsplit_once('_') + .filter(|(_, n)| !n.is_empty() && n.bytes().all(|c| c.is_ascii_digit())) + .map(|(b, _)| b.to_owned()); + (base.to_owned(), numbered) +} + +/// The index of the name in `names` a part is named after (names that keep +/// their number, such as `extra_1`, first). +fn find_name>(names: &[S], part: &str) -> Option { + let (base, numbered) = name_candidates(part); + // OBJ export writes names with `_` for other characters (`ped#1a2b` → `ped_1a2b`). + let safe = |n: &str| -> String { + n.chars().map(|c| if c.is_ascii_alphanumeric() || c == '-' { c.to_ascii_lowercase() } else { '_' }).collect() + }; + let find = |n: &str| names.iter().position(|b| safe(b.as_ref()) == safe(n)); + find(&base).or_else(|| numbered.and_then(|n| find(&n))) +} + /// Puts parts of a model on the bones of a skeleton by name (vehicles: -/// `door_dside_f`, `bonnet`, `wheel_lf` …); other parts go on the body. +/// `door_dside_f`, `bonnet` …); other parts go on the body. #[derive(Debug, Clone)] pub struct Bones { names: Vec, @@ -308,6 +318,13 @@ impl Bones { Self { names, body, own_models: Vec::new(), matched: Vec::new(), unmatched: Vec::new(), left_out: Vec::new() } } + /// Whether the skeleton is a vehicle's (it has `chassis` or `bodyshell`): + /// parts go on bones by name. Other skinned models (peds) take their + /// weights from the original mesh ([`Weights`]). + pub fn is_vehicle(names: &[String]) -> bool { + names.iter().any(|n| n.eq_ignore_ascii_case("chassis") || n.eq_ignore_ascii_case("bodyshell")) + } + /// Bones that have a model of their own (a fragment's wheels): parts /// named like them are left out, as the game draws those models there. pub fn with_own_models(mut self, bones: Vec) -> Self { @@ -317,17 +334,7 @@ impl Bones { /// The skeleton index of the bone a part is named after. fn find(&self, part: &str) -> Option { - let lower = part.trim().to_ascii_lowercase(); - let base = lower.split('.').next().unwrap_or(""); - let base = (1..=3).find_map(|k| base.strip_suffix(&format!("_lod{k}"))).unwrap_or(base); - let find = |n: &str| self.names.iter().position(|b| b.eq_ignore_ascii_case(n)); - // OBJ exports number their objects (`door_dside_f_3`); bones such as - // `extra_1` keep their number when they exist. - let numbered = base - .rsplit_once('_') - .filter(|(_, n)| !n.is_empty() && n.bytes().all(|c| c.is_ascii_digit())) - .map(|(b, _)| b); - find(base).or_else(|| numbered.and_then(find)) + find_name(&self.names, part) } /// Whether a part is left out: named after a bone with a model of its own. @@ -366,96 +373,522 @@ impl Bones { } } -impl<'a> Fitter<'a> { - pub fn new(shaders: &'a [u16], shader: Option, textures: &'a HashMap) -> Result { - if shaders.is_empty() { - bail!("the template has no shader meshes can use"); +/// Bone weights for new vertices of a model blended between bones (peds, +/// clothing), taken from the nearest vertex of the original meshes: an OBJ +/// file has no place for weights, so a new mesh moves as the original did +/// where it lies. +#[derive(Debug, Clone)] +pub struct Weights { + points: Vec<[f32; 3]>, + blends: Vec, + min: [f32; 3], + cell: f32, + cells: HashMap<[i32; 3], Vec>, +} + +impl Weights { + /// From the original meshes' vertices that carry bones; `None` if none do. + pub fn from_meshes(meshes: &[rage_formats::drawable::Mesh]) -> Option { + let mut points = Vec::new(); + let mut blends = Vec::new(); + for m in meshes { + if m.bone_indices.len() != m.positions.len() || m.bone_weights.len() != m.positions.len() { + continue; + } + for i in 0..m.positions.len() { + if m.positions[i].iter().all(|v| v.is_finite()) { + points.push(m.positions[i]); + blends.push(Blend { bones: m.bone_indices[i], weights: m.bone_weights[i] }); + } + } } - if let Some(s) = shader - && !shaders.contains(&s) - { - bail!("shader {s} cannot be used; the template has {shaders:?}"); + if points.is_empty() { + return None; + } + let (mut min, mut max) = ([f32::MAX; 3], [f32::MIN; 3]); + for p in &points { + for k in 0..3 { + min[k] = min[k].min(p[k]); + max[k] = max[k].max(p[k]); + } + } + // About four points per cell. + let volume = (0..3).map(|k| (max[k] - min[k]).max(1e-3)).product::(); + let cell = (volume / points.len() as f32 * 4.0).cbrt().max(1e-3); + let mut cells: HashMap<[i32; 3], Vec> = HashMap::new(); + let mut w = Self { points, blends, min, cell, cells: HashMap::new() }; + for (i, p) in w.points.iter().enumerate() { + cells.entry(w.cell_of(*p)).or_default().push(i as u32); } - Ok(Self { + w.cells = cells; + Some(w) + } + + fn cell_of(&self, p: [f32; 3]) -> [i32; 3] { + std::array::from_fn(|k| ((p[k] - self.min[k]) / self.cell).floor().clamp(-1e6, 1e6) as i32) + } + + /// The bones and weights of the original vertex nearest to `p`. + pub fn nearest(&self, p: [f32; 3]) -> Blend { + let c = self.cell_of(p); + let (mut best, mut best_d) = (0usize, f32::MAX); + let d2 = |q: [f32; 3]| (0..3).map(|k| (q[k] - p[k]) * (q[k] - p[k])).sum::(); + // Rings of cells around p until no closer point can be in the next one. + for r in 0..=8i32 { + for x in -r..=r { + for y in -r..=r { + for z in -r..=r { + if x.abs().max(y.abs()).max(z.abs()) != r { + continue; + } + if let Some(list) = self.cells.get(&[c[0] + x, c[1] + y, c[2] + z]) { + for &i in list { + let d = d2(self.points[i as usize]); + if d < best_d { + (best, best_d) = (i as usize, d); + } + } + } + } + } + } + let reach = r as f32 * self.cell; + if best_d < f32::MAX && best_d <= reach * reach { + break; + } + } + // Far from the original mesh: search everything. + let reach = 8.0 * self.cell; + if best_d > reach * reach { + for (i, q) in self.points.iter().enumerate() { + let d = d2(*q); + if d < best_d { + (best, best_d) = (i, d); + } + } + } + self.blends[best] + } +} + +/// A place of the template that parts of a model go to: the main drawable, +/// a fragment child's model (a wheel), a drawable of a `.ydd`. +#[derive(Debug, Clone)] +pub struct Target { + pub place: Place, + /// Parts named like one of these go here (a wheel bone, a dictionary + /// drawable's name); see [`Fitter::with_targets`] for the others. + pub names: Vec, + /// From model space to the place's own (a wheel: its bone's inverse). + to_local: Option, + shaders: Vec, + infos: Vec, + bones: Option, + weights: Option, + /// (OBJ material name, material) + pub materials: Vec<(String, NewMaterial)>, + /// Materials whose texture was not used: their shader takes none, so + /// it keeps its own. + pub textures_kept: Vec, + /// Parts that went here. + pub parts: Vec, +} + +impl Target { + /// `shaders`: the template shaders meshes there can use. + pub fn new(place: Place, names: Vec, shaders: Vec) -> Self { + Self { + place, + names, + to_local: None, shaders, - shader, - textures, - materials: Vec::new(), - bones: None, infos: Vec::new(), + bones: None, + weights: None, + materials: Vec::new(), textures_kept: Vec::new(), - }) + parts: Vec::new(), + } } - /// What the template's shaders look like ([`rage_formats::ydr_write::shader_infos`]): - /// materials named after a shader's texture go on it, and textures go - /// only to shaders that can take one. + /// What the shaders look like ([`rage_formats::ydr_write::shader_infos_at`]). pub fn with_shader_info(mut self, infos: Vec) -> Self { self.infos = infos; self } - /// Puts the parts on these bones (templates with skinned meshes). + /// Meshes there are in the space of a bone placed at `transform` (model + /// space, column-major): the OBJ's positions are moved into it. + pub fn in_bone_space(mut self, transform: &rage_formats::math::Mat4) -> Self { + self.to_local = Some(rage_formats::math::inverse_affine(transform)); + self + } + pub fn with_bones(mut self, bones: Bones) -> Self { self.bones = Some(bones); self } - /// The bones parts went on, after [`Self::level`]. + pub fn with_weights(mut self, weights: Weights) -> Self { + self.weights = Some(weights); + self + } + pub fn bones(&self) -> Option<&Bones> { self.bones.as_ref() } - /// The meshes of one level, their `shader` the index of their material. - pub fn level(&mut self, meshes: Vec) -> Vec { - let mut out = Vec::new(); + /// Whether the new vertices take their weights from the original mesh. + pub fn has_weights(&self) -> bool { + self.weights.is_some() + } +} + +/// Puts OBJ meshes of one or more detail levels on the places of a template +/// ([`Target`]) and on materials: every OBJ material (by name, across levels) +/// of a place becomes one [`NewMaterial`] on a template shader (in order, the +/// last taking the rest, or all on `shader`) with its texture, if `textures` +/// has one. +pub struct Fitter<'a> { + shader: Option, + textures: &'a HashMap, + targets: Vec, + /// The target parts named after none go to. + default: Option, + /// Parts named after no place, when there is no default place. + pub unplaced: Vec, + /// Materials named `#n` whose shader `n` cannot be used where they are. + pub unusable: Vec, +} + +impl<'a> Fitter<'a> { + /// For the main drawable only, whose meshes can use `shaders`. + pub fn new(shaders: &[u16], shader: Option, textures: &'a HashMap) -> Result { + Self::with_targets(vec![Target::new(Place::Main, Vec::new(), shaders.to_vec())], Some(0), shader, textures) + } + + /// For several places; parts named after none go to `targets[default]` + /// (none: they are left out, listed in [`Self::unplaced`]). + pub fn with_targets( + targets: Vec, + default: Option, + shader: Option, + textures: &'a HashMap, + ) -> Result { + if let Some(t) = targets.iter().find(|t| t.shaders.is_empty()) { + bail!("{:?}: the template has no shader meshes can use there", t.place); + } + if targets.is_empty() { + bail!("the template has no place for meshes"); + } + if let Some(s) = shader + && !targets.iter().any(|t| t.shaders.contains(&s)) + { + bail!("shader {s} cannot be used; the template has {:?}", targets[0].shaders); + } + Ok(Self { shader, textures, targets, default, unplaced: Vec::new(), unusable: Vec::new() }) + } + + /// What the template's shaders look like ([`rage_formats::ydr_write::shader_infos`]): + /// materials named after a shader's texture go on it, and textures go + /// only to shaders that can take one. For the first place. + pub fn with_shader_info(mut self, infos: Vec) -> Self { + self.targets[0].infos = infos; + self + } + + /// Puts the parts of the first place on these bones (templates with skinned meshes). + pub fn with_bones(mut self, bones: Bones) -> Self { + self.targets[0].bones = Some(bones); + self + } + + /// The bones parts of the first place went on, after [`Self::level`]. + pub fn bones(&self) -> Option<&Bones> { + self.targets[0].bones.as_ref() + } + + pub fn targets(&self) -> &[Target] { + &self.targets + } + + pub fn into_targets(self) -> Vec { + self.targets + } + + /// The materials of the first place. + pub fn materials(&self) -> &[(String, NewMaterial)] { + &self.targets[0].materials + } + + /// The target a part goes to. + fn target_of(&mut self, part: &str) -> Option { + let named = self.targets.iter().position(|t| find_name(&t.names, part).is_some()); + let k = named.or(self.default); + match k { + Some(k) if !self.targets[k].parts.iter().any(|p| p == part) => self.targets[k].parts.push(part.to_owned()), + None if !self.unplaced.iter().any(|p| p == part) => self.unplaced.push(part.to_owned()), + _ => {} + } + k + } + + /// The meshes of one level per place (in the order of the targets), + /// their `shader` the index of their material at that place. + pub fn level(&mut self, meshes: Vec) -> Vec> { + let mut out: Vec> = vec![Vec::new(); self.targets.len()]; for m in meshes { - let m = match &mut self.bones { - Some(b) => { - let out: Vec = m.part_names.iter().map(|p| b.leaves_out(p)).collect(); - if out.contains(&true) { without_triangles(m, |part| out[part as usize]) } else { m } + let of: Vec> = m.part_names.iter().map(|p| self.target_of(p)).collect(); + for (k, slot) in out.iter_mut().enumerate() { + let piece = if of.iter().all(|t| *t == Some(k)) { + m.clone() + } else if of.contains(&Some(k)) { + without_triangles(m.clone(), |part| of[part as usize] != Some(k)) + } else { + continue; + }; + slot.extend(self.fit(k, piece)); + } + } + out + } + + /// One mesh at a place: moved into its space, on a material, its + /// vertices on bones. + fn fit(&mut self, k: usize, mut m: ObjMesh) -> Vec { + let shader_opt = self.shader; + let textures = self.textures; + let unusable = &mut self.unusable; + let t = &mut self.targets[k]; + // Only the parts that still have vertices here (others went to other places). + let present = |m: &ObjMesh| -> Vec { + let mut p = vec![false; m.part_names.len()]; + m.parts.iter().for_each(|&k| p[k as usize] = true); + p + }; + if let Some(b) = &mut t.bones { + let here = present(&m); + let out: Vec = m.part_names.iter().zip(&here).map(|(p, &h)| h && b.leaves_out(p)).collect(); + if out.contains(&true) { + m = without_triangles(m, |part| out[part as usize]); + } + } + if m.indices.is_empty() { + return Vec::new(); + } + if let Some(to) = &t.to_local { + m.positions.iter_mut().for_each(|p| *p = rage_formats::math::transform_point(to, *p)); + m.normals.iter_mut().for_each(|n| *n = rage_formats::math::transform_dir(to, *n)); + } + let i = match t.materials.iter().position(|(name, _)| *name == m.material) { + Some(i) => i, + None => { + let i = t.materials.len(); + let texture = textures.get(&m.material).cloned(); + let last = *t.shaders.last().expect("checked"); + let explicit = m.material.strip_prefix('#').and_then(|n| n.parse::().ok()); + if explicit.is_some_and(|s| !t.shaders.contains(&s)) && !unusable.contains(&m.material) { + unusable.push(m.material.clone()); } - None => m, - }; - if m.indices.is_empty() { - continue; + let shader = explicit + .filter(|s| t.shaders.contains(s)) + .or(shader_opt.filter(|s| t.shaders.contains(s))) + .or_else(|| shader_named(&t.infos, &m.material, texture.as_ref().map(|t| t.name.as_str()))) + .filter(|s| t.shaders.contains(s)) + .unwrap_or_else(|| *t.shaders.get(i).unwrap_or(&last)); + let (texture, kept) = fit_texture(&t.infos, shader, texture); + if kept { + t.textures_kept.push(m.material.clone()); + } + t.materials.push((m.material.clone(), NewMaterial { shader, texture })); + i } - let k = match self.materials.iter().position(|(name, _)| *name == m.material) { - Some(k) => k, - None => { - let i = self.materials.len(); - let texture = self.textures.get(&m.material).cloned(); - let shader = self.shader.unwrap_or_else(|| { - shader_named(&self.infos, &m.material, texture.as_ref().map(|t| t.name.as_str())) - .unwrap_or_else(|| *self.shaders.get(i).unwrap_or(self.shaders.last().expect("checked"))) - }); - let (texture, kept) = fit_texture(&self.infos, shader, texture); - if kept { - self.textures_kept.push(m.material.clone()); - } - self.materials.push((m.material.clone(), NewMaterial { shader, texture })); - i + }; + let bones = match &mut t.bones { + Some(b) => { + let here = present(&m); + let of: Vec = + m.part_names.iter().zip(&here).map(|(p, &h)| if h { b.bone_of(p) } else { 0 }).collect(); + m.parts.iter().map(|&p| of[p as usize]).collect() + } + None => Vec::new(), + }; + let blend = match &t.weights { + Some(w) => m.positions.iter().map(|p| w.nearest(*p)).collect(), + None => Vec::new(), + }; + split(NewMesh { + shader: i as u16, + positions: m.positions, + normals: m.normals, + uvs: m.uvs, + colors: Vec::new(), + indices: m.indices, + bones, + blend, + }) + } +} + +/// The places of a template that an OBJ's parts can go to, as +/// [`Fitter::with_targets`] takes them: the main drawable (with its bones for +/// vehicles, weights from the original for other skinned models) and the +/// models of fragment children (wheels: parts named after their bone), or the +/// drawables of a `.ydd` (`names`: theirs, by index; parts named after one go +/// to it, the rest to `drawable` if given). Returns the targets and the default. +pub fn targets( + template: &Resource, + dictionary: Option<(&[String], Option)>, +) -> Result<(Vec, Option)> { + use rage_formats::ydr_write as w; + let place_target = |place: Place, names: Vec| -> Result { + let mut t = Target::new(place, names, w::usable_shaders_at(template, place)?) + .with_shader_info(w::shader_infos_at(template, place)?); + if w::is_skinned_at(template, place)? { + let original = w::read_at(template, place)?; + let bones: Option> = + original.skeleton.as_ref().map(|s| s.bones.iter().map(|b| b.name.clone()).collect()); + match bones { + Some(names) if Bones::is_vehicle(&names) => { + t = t.with_bones(Bones::new(names).with_own_models(w::bones_with_own_models(template))) } - }; - let bones = match &mut self.bones { - Some(b) => { - let of: Vec = m.part_names.iter().map(|p| b.bone_of(p)).collect(); - m.parts.iter().map(|&p| of[p as usize]).collect() + _ => { + if let Some(weights) = Weights::from_meshes(&original.meshes) { + t = t.with_weights(weights); + } } - None => Vec::new(), - }; - out.extend(split(NewMesh { - shader: k as u16, - positions: m.positions, - normals: m.normals, - uvs: m.uvs, - colors: Vec::new(), - indices: m.indices, - bones, - })); + } } - out + Ok(t) + }; + if let Some((names, drawable)) = dictionary { + let targets = (0..names.len()) + .map(|i| place_target(Place::Entry(i), vec![names[i].clone()])) + .collect::>>()?; + return Ok((targets, drawable)); + } + let mut targets = vec![place_target(Place::Main, Vec::new())?]; + for (i, child) in w::child_models(template).into_iter().enumerate() { + // Children this writer cannot fill (no usable geometry) keep their models. + let Ok(t) = place_target(Place::Child(i), vec![child.bone.clone()]) else { continue }; + if t.shaders.is_empty() { + continue; + } + targets.push(t.in_bone_space(&child.transform)); + } + Ok((targets, Some(0))) +} + +/// What [`import`] needs besides the model. +#[derive(Debug, Clone, Copy, Default)] +pub struct ImportOptions<'a> { + /// Every material on this shader (where it can be used). + pub shader: Option, + /// `.ydd`: the drawable parts named after none go to (its name or index). + pub drawable: Option<&'a str>, +} + +/// A written model and where its parts went. +pub struct Imported { + pub file: Vec, + pub targets: Vec, + /// Parts of a `.ydd` model named after none of its drawables (left out). + pub unplaced: Vec, + /// Detail levels of the closest place written. + pub levels: usize, +} + +/// The places of the model at `vpath` (a `.ydr`, `.yft` or `.ydd` of GTA V +/// Enhanced) parts can go to ([`targets`]). +pub fn targets_of(template: &Resource, vpath: &str, drawable: Option<&str>) -> Result<(Vec, Option)> { + let lower = vpath.to_ascii_lowercase(); + if !lower.ends_with(".ydd") { + if drawable.is_some() { + bail!("--drawable is for drawable dictionaries (.ydd)"); + } + return targets(template, None); } + let stem = lower.rsplit('/').next().unwrap_or(&lower).trim_end_matches(".ydd"); + let hashes = rage_formats::ydr_write::entry_hashes(template)?; + let names = crate::models::dictionary_names(stem, &hashes); + let default = match drawable { + None => None, + Some(d) => Some( + find_name(&names, d) + .or_else(|| d.parse::().ok().filter(|&i| i < names.len())) + .with_context(|| format!("{vpath} has no drawable {d:?}; it has {}", names.join(", ")))?, + ), + }; + targets(template, Some((&names, default))) +} + +/// Writes OBJ meshes (one list per detail level) into the model `template` +/// at `vpath`: every part to its place ([`targets_of`]), checked to read back. +/// `donor` is asked for a texture structure when the model has none. +pub fn import( + template: &Resource, + vpath: &str, + levels: Vec>, + textures: &HashMap, + options: ImportOptions, + donor: impl FnOnce() -> Option, +) -> Result { + use rage_formats::ydr_write as w; + let (targets, default) = targets_of(template, vpath, options.drawable)?; + let mut fitter = Fitter::with_targets(targets, default, options.shader, textures)?; + let fitted: Vec>> = levels.into_iter().map(|l| fitter.level(l)).collect(); + if !fitter.unusable.is_empty() { + bail!("materials {}: no such shader can be used there", fitter.unusable.join(", ")); + } + let parts = parts_of(&fitter, &fitted)?; + let needs_donor = parts.iter().any(|(_, _, m)| m.iter().any(|m| m.texture.is_some())); + let donor = (needs_donor && !w::can_donate_textures(template)).then(donor).flatten(); + let lods: Vec> = parts.iter().map(|(_, l, _)| l.iter().map(Vec::as_slice).collect()).collect(); + let write_parts: Vec = parts + .iter() + .zip(&lods) + .map(|((place, _, mats), l)| w::Part { place: *place, lods: l, materials: Some(mats) }) + .collect(); + let file = w::replace_parts(template, &write_parts, donor.as_ref())?; + // What the game gets must read back. + let back = Resource::from_rsc7(&file)?; + if vpath.to_ascii_lowercase().ends_with(".ydd") { + rage_formats::drawable::parse_ydd(&back).context("the built model does not read back")?; + } else { + w::read_back(&file).context("the built model does not read back")?; + } + for (place, _, _) in &parts { + w::read_at(&back, *place).with_context(|| format!("{place:?} does not read back"))?; + } + let levels = parts.first().map_or(0, |(_, l, _)| l.len()); + let unplaced = std::mem::take(&mut fitter.unplaced); + Ok(Imported { file, targets: fitter.into_targets(), unplaced, levels }) +} + +/// The levels per target, as [`rage_formats::ydr_write::Part`]s need them: +/// for every target with meshes in the closest level, its levels up to the +/// first empty one, and its materials. +#[allow(clippy::type_complexity)] +pub fn parts_of( + fitter: &Fitter, + levels: &[Vec>], +) -> Result>, Vec)>> { + let mut out = Vec::new(); + for (k, t) in fitter.targets().iter().enumerate() { + let lods: Vec> = + levels.iter().map(|l| l.get(k).cloned().unwrap_or_default()).take_while(|l| !l.is_empty()).collect(); + if lods.is_empty() { + if levels.iter().any(|l| l.get(k).is_some_and(|m| !m.is_empty())) { + bail!("{:?}: meshes only for further detail levels, none for the closest", t.place); + } + continue; + } + out.push((t.place, lods, t.materials.iter().map(|(_, m)| m.clone()).collect())); + } + if out.is_empty() { + bail!("no meshes for the model: every part was left out"); + } + Ok(out) } /// An Enhanced drawable with embedded textures (or a texture dictionary), @@ -467,7 +900,7 @@ pub fn find_texture_donor( keys: Option>, ) -> Option { let parent = vpath.rsplit_once('/').map_or("", |(p, _)| p); - let Ok((Node::ArchiveDir(rpf, dir), _)) = rage_mods::resolve(game_dir, parent, keys) else { return None }; + let Ok((Node::ArchiveDir(rpf, dir), _)) = rage_mods::resolve(game_dir, parent, keys.clone()) else { return None }; let donates = |r: &rage_resource::Resource| rage_formats::ydr_write::can_donate_textures(r); // Drawables first, then texture dictionaries (vehicle archives have only // fragments and dictionaries). @@ -505,9 +938,89 @@ pub fn find_texture_donor( }, &mut |_| {}, ); - found + // Archives of fragments only (vehicle mod parts): the game's shared vehicle textures. + found.or_else(|| { + let Ok((Node::ArchiveFile(rpf, id), _)) = rage_mods::resolve(game_dir, SHARED_TEXTURES, keys) else { + return None; + }; + rpf.read_resource(id).ok().filter(donates) + }) +} + +/// An OBJ model as a collision: every triangle, with the material type +/// its OBJ material is named after (`CONCRETE`, `metal_solid_medium`: a name +/// of the game's `materials.dat`, ignoring case; others get the original's +/// first material). Returns the mesh and per OBJ material the name it matched. +pub fn collision_mesh( + meshes: &[ObjMesh], + names: &[String], +) -> (rage_formats::ybn_write::CollisionMesh, Vec<(String, Option)>) { + let mut out = rage_formats::ybn_write::CollisionMesh::default(); + let mut matched = Vec::new(); + for m in meshes { + let k = names.iter().position(|n| n.eq_ignore_ascii_case(m.material.trim())); + if !matched.iter().any(|(n, _): &(String, Option)| *n == m.material) { + matched.push((m.material.clone(), k.map(|k| names[k].clone()))); + } + let base = out.positions.len() as u32; + out.positions.extend_from_slice(&m.positions); + out.indices.extend(m.indices.iter().map(|i| i + base)); + out.materials.extend(std::iter::repeat_n(k.and_then(|k| u8::try_from(k).ok()), m.indices.len() / 3)); + } + (out, matched) +} + +/// A collision with a triangle mesh (a `.ybn`; `true`: a `.ydr`) to lend +/// its structure to a model whose collision has none (only boxes, spheres): +/// one in the archive of `vpath`, else the first one of the game. +pub fn find_collision_donor( + game_dir: &Path, + vpath: &str, + keys: Option>, +) -> Option<(rage_resource::Resource, bool)> { + use rage_formats::ybn_write::can_donate; + let look = |rpf: &rage_rpf::Rpf7, from: rage_rpf::EntryId, limit: usize| { + let mut found = None; + let mut seen = 0; + rage_rpf::vfs::walk( + rpf, + from, + "", + true, + &mut |a, id, p| { + let ydr = p.to_ascii_lowercase().ends_with(".ydr"); + if found.is_some() || seen > limit || !(ydr || p.to_ascii_lowercase().ends_with(".ybn")) { + return; + } + seen += 1; + if let Ok(r) = a.read_resource(id) + && can_donate(&r, ydr) + { + found = Some((r, ydr)); + } + }, + &mut |_| {}, + ); + found + }; + let parent = vpath.rsplit_once('/').map_or("", |(p, _)| p); + if let Ok((Node::ArchiveDir(rpf, _), _)) = rage_mods::resolve(game_dir, parent, keys.clone()) + && let Some(f) = look(&rpf, rage_rpf::Rpf7::ROOT, 5000) + { + return Some(f); + } + let mut rpfs = Vec::new(); + crate::detect::collect_rpfs(game_dir, &mut rpfs); + rpfs.sort(); + rpfs.iter().find_map(|p| { + let rpf = rage_rpf::Rpf7::open(p, keys.clone()).ok()?; + look(&rpf, rage_rpf::Rpf7::ROOT, 2000) + }) } +/// A texture dictionary every GTA V installation has, as the last donor. +const SHARED_TEXTURES: &str = "x64e.rpf/levels/gta5/vehicles.rpf/vehshare.ytd"; + /// The mesh without the triangles whose first corner belongs to a part /// `drop` names (by index into its part names); unused vertices go too. fn without_triangles(m: ObjMesh, drop: impl Fn(u16) -> bool) -> ObjMesh { @@ -566,6 +1079,9 @@ pub fn split(m: NewMesh) -> Vec { if !m.bones.is_empty() { piece.bones.push(m.bones[i as usize]); } + if !m.blend.is_empty() { + piece.blend.push(m.blend[i as usize]); + } k }); piece.indices.push(k); @@ -626,7 +1142,7 @@ mod tests { let skeleton = ["chassis", "bonnet", "door_dside_f", "bodyshell"].map(String::from).to_vec(); let textures = HashMap::new(); let mut fit = Fitter::new(&[0], None, &textures).unwrap().with_bones(Bones::new(skeleton)); - let out = fit.level(meshes); + let out = fit.level(meshes).swap_remove(0); assert_eq!(out[0].bones, [3, 3, 3, 2, 2, 2], "unknown parts go on the body (bodyshell)"); assert_eq!(out[1].bones, [1, 1, 1]); let bones = fit.bones().unwrap(); @@ -641,7 +1157,7 @@ mod tests { let wheels = Bones::new(skeleton).with_own_models(vec!["wheel_lf".into()]); let mut fit = Fitter::new(&[0], None, &textures).unwrap().with_bones(wheels); let text = "v 0 0 0\nv 1 0 0\nv 0 1 0\nv 1 1 0\no body_0\nf 1 2 3\no wheel_lf_7\nf 2 4 3\n"; - let out = fit.level(read(text).unwrap()); + let out = fit.level(read(text).unwrap()).swap_remove(0); assert_eq!((out.len(), out[0].positions.len(), out[0].indices.len()), (1, 3, 3)); assert_eq!(fit.bones().unwrap().left_out, ["wheel_lf_7"]); @@ -660,7 +1176,7 @@ mod tests { // Without bones: none. let mut plain = Fitter::new(&[0], None, &textures).unwrap(); - assert!(plain.level(read(text).unwrap()).iter().all(|m| m.bones.is_empty())); + assert!(plain.level(read(text).unwrap())[0].iter().all(|m| m.bones.is_empty())); } #[test] @@ -675,9 +1191,9 @@ mod tests { }; let textures = HashMap::new(); let mut fit = Fitter::new(&[0, 2], None, &textures).unwrap(); - let hi = fit.level(vec![mesh("a"), mesh("b"), mesh("c")]); - let lod = fit.level(vec![mesh("c"), mesh("d")]); - let shaders: Vec = fit.materials.iter().map(|(_, m)| m.shader).collect(); + let hi = fit.level(vec![mesh("a"), mesh("b"), mesh("c")]).swap_remove(0); + let lod = fit.level(vec![mesh("c"), mesh("d")]).swap_remove(0); + let shaders: Vec = fit.materials().iter().map(|(_, m)| m.shader).collect(); assert_eq!(shaders, [0, 2, 2, 2], "in order, the last taking the rest"); assert_eq!(hi.iter().map(|m| m.shader).collect::>(), [0, 1, 2]); assert_eq!(lod.iter().map(|m| m.shader).collect::>(), [2, 3], "materials shared across levels by name"); @@ -692,4 +1208,59 @@ mod tests { assert!(pieces.iter().all(|p| p.positions.len() <= MAX_VERTICES)); assert_eq!(pieces.iter().map(|p| p.indices.len()).sum::(), n); } + + #[test] + fn parts_go_to_their_places() { + // A body with bones and a wheel model on `wheel_lf` at (1, 2, 3). + let skeleton = ["chassis", "bodyshell", "wheel_lf", "wheel_rf"].map(String::from).to_vec(); + let own = vec!["wheel_lf".to_owned(), "wheel_rf".to_owned()]; + let body = Target::new(Place::Main, Vec::new(), vec![0]).with_bones(Bones::new(skeleton).with_own_models(own)); + let mut at = rage_formats::math::IDENTITY; + (at[12], at[13], at[14]) = (1.0, 2.0, 3.0); + let wheel = Target::new(Place::Child(0), vec!["wheel_lf".into()], vec![4]).in_bone_space(&at); + let textures = HashMap::new(); + let mut fit = Fitter::with_targets(vec![body, wheel], Some(0), None, &textures).unwrap(); + let text = "v 0 0 0\nv 1 0 0\nv 0 1 0\nv 1 1 0\n\ + o body_0\nusemtl paint\nf 1 2 3\no wheel_lf_7\nusemtl tyre\nf 2 4 3\no wheel_rf_8\nusemtl tyre\nf 1 2 4\n"; + let out = fit.level(read(text).unwrap()); + assert_eq!(out[0].len(), 1, "the body"); + assert_eq!(out[0][0].indices.len(), 3, "without the wheels"); + assert_eq!(out[1][0].positions.len(), 3, "the wheel"); + // OBJ (1, 0, 0) is (1, 0, 0) in the game, minus the bone's place. + assert_eq!(out[1][0].positions[0], [0.0, -2.0, -3.0]); + assert!(out[1][0].bones.is_empty(), "the wheel model is fixed"); + let t = fit.targets(); + assert_eq!(t[1].materials[0].1.shader, 4, "the wheel's own shaders"); + assert_eq!(t[1].parts, ["wheel_lf_7"]); + assert_eq!(t[0].bones().unwrap().left_out, ["wheel_rf_8"], "the copy the game makes of wheel_lf"); + let levels = vec![out]; + let parts = parts_of(&fit, &levels).unwrap(); + assert_eq!(parts.iter().map(|p| p.0).collect::>(), [Place::Main, Place::Child(0)]); + + // Dictionaries: parts by drawable name (also as OBJ export writes them), the rest to the default. + let a = Target::new(Place::Entry(0), vec!["uppr_000_u".into()], vec![0]); + let b = Target::new(Place::Entry(1), vec!["ped#1a2b".into()], vec![0]); + let mut fit = Fitter::with_targets(vec![a, b], None, None, &textures).unwrap(); + let text = "v 0 0 0\nv 1 0 0\nv 0 1 0\no ped_1a2b_3\nf 1 2 3\no other\nf 1 2 3\n"; + let out = fit.level(read(text).unwrap()); + assert!(out[0].is_empty()); + assert_eq!(out[1].len(), 1); + assert_eq!(fit.unplaced, ["other"]); + } + + #[test] + fn weights_come_from_the_nearest_vertex() { + let mesh = rage_formats::drawable::Mesh { + positions: vec![[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 5.0, 0.0]], + bone_indices: vec![[1, 0, 0, 0], [2, 3, 0, 0], [4, 0, 0, 0]], + bone_weights: vec![[1.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]], + ..Default::default() + }; + let w = Weights::from_meshes(&[mesh]).unwrap(); + assert_eq!(w.nearest([0.9, 0.1, 0.0]).bones, [2, 3, 0, 0]); + assert_eq!(w.nearest([0.1, 0.0, 0.0]).weights, [1.0, 0.0, 0.0, 0.0]); + assert_eq!(w.nearest([0.0, 4.0, 1.0]).bones[0], 4); + assert_eq!(w.nearest([0.0, 400.0, 0.0]).bones[0], 4, "far away: still the nearest"); + assert!(Weights::from_meshes(&[rage_formats::drawable::Mesh::default()]).is_none()); + } } diff --git a/crates/openrage-app/src/plugins.rs b/crates/openrage-app/src/plugins.rs index 12ff6cf..8781b86 100644 --- a/crates/openrage-app/src/plugins.rs +++ b/crates/openrage-app/src/plugins.rs @@ -122,26 +122,22 @@ impl GameFiles for GameDir { } fn build_model(&self, template: &str, model: &Model) -> Result> { - use rage_formats::ydr_write; let Node::ArchiveFile(rpf, id) = self.resolve(template)? else { bail!("{template} is not a model inside an archive") }; let lower = template.to_ascii_lowercase(); - if !lower.ends_with(".ydr") && !lower.ends_with(".yft") { - bail!("{template}: only drawables (.ydr) and fragments (.yft) can be built so far"); + if !lower.ends_with(".ydr") && !lower.ends_with(".yft") && !lower.ends_with(".ydd") { + bail!( + "{template}: only drawables (.ydr), fragments (.yft) and drawable dictionaries (.ydd) can be built so far" + ); } let res = rpf.read_resource(id)?; - let own = ydr_write::bones_with_own_models(&res); - let mut bones = ydr_write::skinned_bones(&res)?.map(|b| crate::obj::Bones::new(b).with_own_models(own)); - let (levels, materials) = plugin_meshes(model, &ydr_write::shader_infos(&res)?, bones.as_mut())?; - let donor = (materials.iter().any(|m| m.texture.is_some()) && !ydr_write::can_donate_textures(&res)) - .then(|| crate::obj::find_texture_donor(&self.dir, template, self.keys.clone())) - .flatten(); - let refs: Vec<&[ydr_write::NewMesh]> = levels.iter().map(Vec::as_slice).collect(); - let file = ydr_write::replace_lods(&res, &refs, Some(&materials), donor.as_ref())?; - // What the game gets must read back. - ydr_write::read_back(&file).context("the built model does not read back")?; - Ok(file) + let (levels, textures) = plugin_meshes(model)?; + let options = crate::obj::ImportOptions::default(); + let imported = crate::obj::import(&res, template, levels, &textures, options, || { + crate::obj::find_texture_donor(&self.dir, template, self.keys.clone()) + })?; + Ok(imported.file) } fn texture(&self, vpath: &str, name: &str) -> Result { @@ -237,70 +233,53 @@ impl GameFiles for GameDir { } } -/// A plugin's model for the model writer: one [`NewMaterial`] per material -/// (material `i` on the template's `i`-th usable shader, the last one taking -/// the rest, or on shader `n` for a material named `#n`; its pixels, if any, -/// as its texture, named after `texture` or the material) and the meshes per -/// detail level: meshes whose part ends in `_lod1`, `_lod2` or `_lod3` (or is -/// `lod1` …) go to the further levels. Meshes too large for one geometry are -/// split. With `bones` (skinned templates: vehicles), each part goes on the -/// bone of its name (without the level suffix), others on the body. +/// A plugin's model for the model writer ([`crate::obj::import`]): its +/// meshes per detail level as OBJ meshes (meshes whose part ends in `_lod1`, +/// `_lod2` or `_lod3`, or is `lod1` …, go to the further levels) and the +/// textures of its materials by name (a material's pixels, named after its +/// `texture` or itself). Materials go on the template's shaders in order, a +/// material named `#n` on shader `n`, one named after a shader's texture on +/// that shader; parts go to the place named like them (a vehicle's bone, its +/// wheel, a dictionary's drawable). +#[allow(clippy::type_complexity)] pub fn plugin_meshes( model: &Model, - infos: &[rage_formats::ydr_write::ShaderInfo], - mut bones: Option<&mut crate::obj::Bones>, -) -> Result<(Vec>, Vec)> { - use rage_formats::ydr_write::{NewMaterial, NewMesh, texture_from_rgba}; - let shaders: Vec = infos.iter().map(|i| i.index).collect(); - let Some(&last) = shaders.last() else { bail!("the template has no shader meshes can use") }; - let mut materials = Vec::new(); - for (i, m) in model.materials.iter().enumerate() { - let shader = match m.name.strip_prefix('#').map(str::parse::) { - Some(Ok(n)) if shaders.contains(&n) => n, - Some(_) => bail!("material {:?}: the template has the shaders {shaders:?}", m.name), - None => crate::obj::shader_named(infos, &m.name, (!m.texture.is_empty()).then_some(m.texture.as_str())) - .unwrap_or_else(|| shaders.get(i).copied().unwrap_or(last)), - }; - let texture = match &m.image { - Some(img) => { - let name = crate::obj::texture_name(if m.texture.is_empty() { &m.name } else { &m.texture }); - Some(texture_from_rgba(&name, img.width, img.height, &img.rgba)?) - } - None => None, - }; - let (texture, _) = crate::obj::fit_texture(infos, shader, texture); - materials.push(NewMaterial { shader, texture }); +) -> Result<(Vec>, std::collections::HashMap)> { + use rage_formats::ydr_write::texture_from_rgba; + let mut textures = std::collections::HashMap::new(); + for m in &model.materials { + if let Some(img) = &m.image + && !textures.contains_key(&m.name) + { + let name = crate::obj::texture_name(if m.texture.is_empty() { &m.name } else { &m.texture }); + textures.insert(m.name.clone(), texture_from_rgba(&name, img.width, img.height, &img.rgba)?); + } } let level_of = |part: &str| -> usize { let p = part.to_ascii_lowercase(); (1..=3).rev().find(|k| p == format!("lod{k}") || p.ends_with(&format!("_lod{k}"))).unwrap_or(0) }; - let mut levels: Vec> = vec![Vec::new(); 4]; + let mut levels: Vec> = vec![Vec::new(); 4]; for m in &model.meshes { - if m.material as usize >= materials.len() { - bail!("mesh with an unknown material"); - } - if bones.as_deref_mut().is_some_and(|b| b.leaves_out(&m.part)) { - continue; - } + let Some(material) = model.materials.get(m.material as usize) else { bail!("mesh with an unknown material") }; let n = m.positions.len() / 3; - let bone = bones.as_deref_mut().map(|b| b.bone_of(&m.part)); - levels[level_of(&m.part)].extend(crate::obj::split(NewMesh { - shader: m.material as u16, + let normals = m.normals.as_chunks::<3>().0.to_vec(); + let uvs = m.uvs.as_chunks::<2>().0.to_vec(); + levels[level_of(&m.part)].push(crate::obj::ObjMesh { + material: material.name.clone(), positions: m.positions.as_chunks::<3>().0.to_vec(), - normals: m.normals.as_chunks::<3>().0.to_vec(), - uvs: m.uvs.as_chunks::<2>().0.to_vec(), - colors: Vec::new(), + normals: if normals.len() == n { normals } else { Vec::new() }, + uvs: if uvs.len() == n { uvs } else { Vec::new() }, indices: m.indices.clone(), - bones: bone.map(|b| vec![b; n]).unwrap_or_default(), - })); + part_names: vec![m.part.clone()], + parts: vec![0; n], + }); } if levels[0].is_empty() { bail!("the model has no meshes for the closest detail level (only _lod parts)"); } // Levels in order, without gaps. - let levels: Vec> = levels.into_iter().take_while(|l| !l.is_empty()).collect(); - Ok((levels, materials)) + Ok((levels.into_iter().take_while(|l| !l.is_empty()).collect(), textures)) } /// Collision and path files count as models in the explorer, but plugins @@ -869,15 +848,22 @@ mod tests { meshes: vec![mesh(0, "body"), mesh(1, ""), mesh(2, "body_LOD1"), mesh(3, "lod2")], materials: vec![material("a"), material("#0"), textured, material("d")], }; - let (levels, materials) = plugin_meshes(&model, &plain(&[0, 3]), None).unwrap(); - assert_eq!(materials.iter().map(|m| m.shader).collect::>(), [0, 0, 3, 3]); - assert_eq!(materials[2].texture.as_ref().unwrap().name, "c"); + let (levels, textures) = plugin_meshes(&model).unwrap(); assert_eq!(levels.iter().map(Vec::len).collect::>(), [2, 1, 1]); - assert_eq!(levels[1][0].shader, 2, "meshes keep their material index"); + assert_eq!(textures["c"].name, "c"); + let mut fit = crate::obj::Fitter::new(&[0, 3], None, &textures).unwrap().with_shader_info(plain(&[0, 3])); + let fitted: Vec<_> = levels.into_iter().map(|l| fit.level(l).swap_remove(0)).collect(); + let shaders: Vec = fit.materials().iter().map(|(_, m)| m.shader).collect(); + assert_eq!(shaders, [0, 0, 3, 3], "in order, #0 on shader 0, the last taking the rest"); + assert_eq!(fit.materials()[2].1.texture.as_ref().unwrap().name, "c"); + assert_eq!(fitted[1][0].shader, 2, "meshes keep their material index"); let pinned = Model { meshes: vec![mesh(0, "")], materials: vec![material("#7")] }; - assert!(plugin_meshes(&pinned, &plain(&[0, 3]), None).is_err()); + let (levels, textures) = plugin_meshes(&pinned).unwrap(); + let mut fit = crate::obj::Fitter::new(&[0, 3], None, &textures).unwrap(); + fit.level(levels.into_iter().next().unwrap()); + assert_eq!(fit.unusable, ["#7"]); let only_lod = Model { meshes: vec![mesh(0, "x_lod1")], materials: vec![material("a")] }; - assert!(plugin_meshes(&only_lod, &plain(&[0]), None).is_err()); + assert!(plugin_meshes(&only_lod).is_err()); } #[test] diff --git a/crates/openrage-app/src/vehicle_mods.rs b/crates/openrage-app/src/vehicle_mods.rs new file mode 100644 index 0000000..c52e5e2 --- /dev/null +++ b/crates/openrage-app/src/vehicle_mods.rs @@ -0,0 +1,173 @@ +//! Vehicle mod parts (tuning: bonnets, bumpers, spoilers …): the `.yft` +//! files in a vehicle's `_mods.rpf` archives, and the bone the +//! game's `carcols` files put each of them on. A mod part's meshes are in the +//! space of that bone. + +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, OnceLock}; + +use rage_crypto::GtaVKeys; +use rage_rpf::{Rpf7, vfs}; +use rayon::prelude::*; + +/// A mod part of a vehicle. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ModPart { + /// Its model name (`sultan_hood_1`). + pub name: String, + /// Its virtual path in the game. + pub vpath: String, + /// The bone it goes on (`bonnet`), from `carcols`. + pub bone: Option, + /// What kind of part it is (`VMT_BONNET`), from `carcols`. + pub kind: Option, +} + +/// What `carcols` says about a mod part: (bone, kind). +type Placement = (Option, Option); + +/// What one archive holds: (vehicle, mod part path) and placements. +type Found = (Vec<(String, String)>, Vec<(u32, Placement)>); + +#[derive(Default)] +struct Index { + /// Vehicle name → its mod parts' virtual paths. + parts: HashMap>, + /// Mod part name hash → where it goes (PSO files keep names as hashes). + placements: HashMap, +} + +fn indexes() -> &'static Mutex>> { + static INDEXES: OnceLock>>> = OnceLock::new(); + INDEXES.get_or_init(Default::default) +} + +/// The mod parts of `vehicle` (its model name, `sultan`), sorted by name. +/// The first call reads every archive of the game once. +pub fn mod_parts(game_dir: &Path, keys: Option>, vehicle: &str) -> Vec { + let index = { + let cached = indexes().lock().ok().and_then(|m| m.get(game_dir).cloned()); + match cached { + Some(i) => i, + None => { + let built = Arc::new(build(game_dir, keys)); + if let Ok(mut m) = indexes().lock() { + m.insert(game_dir.to_path_buf(), built.clone()); + } + built + } + } + }; + let mut out: Vec = Vec::new(); + for vpath in index.parts.get(&vehicle.to_ascii_lowercase()).into_iter().flatten() { + let file = vpath.rsplit('/').next().unwrap_or(vpath); + let name = file.strip_suffix(".yft").unwrap_or(file).to_owned(); + // The same part in several packs: the last one found (updates come after the base game). + out.retain(|p| p.name != name); + let key = rage_formats::names::parse(&name.to_ascii_lowercase()); + let (bone, kind) = index.placements.get(&key).cloned().unwrap_or_default(); + out.push(ModPart { name, vpath: vpath.clone(), bone, kind }); + } + out.sort_by(|a, b| a.name.cmp(&b.name)); + out +} + +/// A readable name for a kind of mod part: `VMT_BUMPER_F` → `bumper f`. +pub fn kind_label(kind: &str) -> String { + kind.trim_start_matches("VMT_").to_ascii_lowercase().replace('_', " ") +} + +fn build(game_dir: &Path, keys: Option>) -> Index { + crate::progress::set("Finding the vehicle mod parts", 0, 0); + let mut rpfs = Vec::new(); + crate::detect::collect_rpfs(game_dir, &mut rpfs); + // Updates last, so their parts and placements win. + rpfs.sort_by_key(|p| p.strip_prefix(game_dir).is_ok_and(|r| r.starts_with("update"))); + let found: Vec = rpfs + .par_iter() + .map(|p| { + let rel = p.strip_prefix(game_dir).unwrap_or(p).to_string_lossy().replace('\\', "/"); + let (mut parts, mut placements) = (Vec::new(), Vec::new()); + let Ok(rpf) = Rpf7::open(p, keys.clone()) else { return (parts, placements) }; + vfs::walk( + &rpf, + Rpf7::ROOT, + &rel, + true, + &mut |a, id, path| { + let name = a.entry(id).name.to_ascii_lowercase(); + if name.ends_with(".yft") { + let lower = path.to_ascii_lowercase(); + let archive = lower.rsplit('/').nth(1).unwrap_or(""); + if let Some(vehicle) = archive.strip_suffix("_mods.rpf") { + parts.push((vehicle.to_owned(), path.to_owned())); + } + } else if name.starts_with("carcols") + && (name.ends_with(".meta") || name.ends_with(".ymt")) + && let Ok(xml) = + a.read(id).map_err(anyhow::Error::from).and_then(|d| crate::metadata::from_bytes(&d)) + { + placements.extend(read_placements(&xml.text)); + } + }, + &mut |_| {}, + ); + (parts, placements) + }) + .collect(); + let mut index = Index::default(); + for (parts, placements) in found { + for (vehicle, vpath) in parts { + index.parts.entry(vehicle).or_default().push(vpath); + } + index.placements.extend(placements); + } + crate::progress::clear(); + index +} + +/// The mod parts a `carcols` file places (its `visibleMods`): model name +/// hash, bone (a name, or `hash_XXXXXXXX`) and kind. +fn read_placements(xml: &str) -> Vec<(u32, Placement)> { + let tag = |s: &str, name: &str| -> Option { + let open = format!("<{name}>"); + let start = s.find(&open)? + open.len(); + let end = s[start..].find(&format!(""))? + start; + let v = s[start..end].trim(); + (!v.is_empty()).then(|| v.to_owned()) + }; + let mut out = Vec::new(); + let mut rest = xml; + while let Some(at) = rest.find("") { + let item = &rest[at..]; + // This item ends where the next one's model name begins. + let end = item[1..].find("").map_or(item.len(), |e| e + 1); + let item = &item[..end]; + if let Some(model) = tag(item, "modelName") { + out.push((rage_formats::names::parse(&model.to_ascii_lowercase()), (tag(item, "bone"), tag(item, "type")))); + } + rest = &rest[at + end..]; + } + out +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn reads_where_mod_parts_go() { + let xml = "sultan_hood_1\ + bonnetVMT_BONNETbonnet\ + chassisSultan_Wing_1\ + VMT_SPOILERbootx"; + let p = read_placements(xml); + let h = |n: &str| rage_core::hash::joaat(n); + assert_eq!(p[0], (h("sultan_hood_1"), (Some("bonnet".into()), Some("VMT_BONNET".into())))); + assert_eq!(p[1], (h("sultan_wing_1"), (Some("boot".into()), Some("VMT_SPOILER".into())))); + assert_eq!(p[2], (h("x"), (None, None))); + assert_eq!(read_placements(&format!("hash_{:08X}", h("a")))[0].0, h("a")); + assert_eq!(kind_label("VMT_BUMPER_F"), "bumper f"); + } +} diff --git a/crates/openrage-cli/src/cli.rs b/crates/openrage-cli/src/cli.rs index d6ae54e..5d8f485 100644 --- a/crates/openrage-cli/src/cli.rs +++ b/crates/openrage-cli/src/cli.rs @@ -94,8 +94,10 @@ pub(crate) enum Command { #[arg(long, conflicts_with_all = ["textures", "models", "audio", "animations", "meta", "text", "particles", "collisions", "paths", "scripts", "media"])] cutscenes: bool, /// With --textures: also rebuild every dictionary and check that it reads back identically. - /// With --models: write every GTA V Enhanced drawable (.ydr) anew with its own meshes and - /// check that it reads back identically. + /// With --models: write every GTA V Enhanced drawable (.ydr, .yft, .ydd) anew with its own + /// meshes and check that it reads back identically. + /// With --collisions: write every GTA V Enhanced collision (.ybn, and those of .ydr) anew + /// from its own triangles and check that it reads back the same. /// With --meta: convert every PSO file (.ymt, .ymf, .pso, …) to XML and back, and check /// that it comes out byte for byte the same or at least reads back to the same XML. /// GTA IV without --textures: rebuild the table of every .rpf package in memory and @@ -259,10 +261,14 @@ pub(crate) enum Command { #[arg(long, value_name = "TEXT", conflicts_with = "out")] import: Option, }, - /// Replace the meshes of a GTA V Enhanced drawable (.ydr) or vehicle body (.yft) with a - /// Wavefront OBJ model. The model's shaders and textures stay; OBJ materials go to its - /// shaders in order. Vehicles: OBJ parts named like a bone (`door_dside_f`, `bonnet`) move - /// with it, other parts with the body. + /// Replace the meshes of a GTA V Enhanced drawable (.ydr), fragment (.yft: vehicles, their + /// mod parts) or drawable dictionary (.ydd: peds, clothing) with a Wavefront OBJ model. The + /// model's shaders and textures stay; OBJ materials go to its shaders in order. Vehicles: OBJ + /// parts named like a bone (`door_dside_f`, `bonnet`) move with it, parts named after the + /// wheel (`wheel_lf`) replace its model, other parts move with the body. Dictionaries: parts + /// named after a drawable (`uppr_000_u`) replace it. Models blended between bones take the + /// weights of the original's nearest vertex. A collision file (.ybn) gets the OBJ as its + /// collision. ReplaceModel { /// The model in the game, e.g. `x64i.rpf/levels/gta5/props/…/prop_x.ydr` or /// `x64e.rpf/levels/gta5/vehicles.rpf/adder.yft`. @@ -284,6 +290,14 @@ pub(crate) enum Command { /// Keep the drawable's textures instead of embedding the ones the OBJ's materials name. #[arg(long)] no_textures: bool, + /// Drawable dictionaries (.ydd): the drawable (name or index) for the OBJ's parts that + /// are named after none. + #[arg(long)] + drawable: Option, + /// Drawables (.ydr): build the collision from this OBJ model instead of keeping the + /// original (OBJ materials named like a collision material, e.g. CONCRETE, get it). + #[arg(long, value_name = "OBJ")] + collision: Option, }, /// Show a model (.ydr, .yft, .ydd; GTA IV .wdr, .wft, .wdd) and optionally export it as glTF (.glb). Model { diff --git a/crates/openrage-cli/src/cmd/edit.rs b/crates/openrage-cli/src/cmd/edit.rs index a1b1566..bf1a3f8 100644 --- a/crates/openrage-cli/src/cmd/edit.rs +++ b/crates/openrage-cli/src/cmd/edit.rs @@ -200,6 +200,9 @@ pub(crate) struct ReplaceOptions<'a> { pub(crate) shader: Option, pub(crate) lods: &'a [PathBuf], pub(crate) textures: bool, + pub(crate) drawable: Option<&'a str>, + /// An OBJ model to build the collision from (`.ydr`); for a `.ybn` the OBJ itself is. + pub(crate) collision: Option<&'a Path>, } pub(crate) fn cmd_replace_model( @@ -215,18 +218,25 @@ pub(crate) fn cmd_replace_model( bail!("{vpath} is not a file inside an archive") }; let lower = vpath.to_ascii_lowercase(); - if !lower.ends_with(".ydr") && !lower.ends_with(".yft") { - bail!("{vpath} is not a drawable (.ydr) or fragment (.yft)"); + if lower.ends_with(".ybn") { + let template = rpf.read_resource(id)?; + let file = with_collision(game_dir, vpath, &template, false, obj, keys.clone())?; + return save_model(game_dir, vpath, obj, file, &o, keys); + } + if o.collision.is_some() && !lower.ends_with(".ydr") { + bail!("--collision is for drawables (.ydr); vehicles and other fragments keep theirs"); + } + if !lower.ends_with(".ydr") && !lower.ends_with(".yft") && !lower.ends_with(".ydd") { + bail!("{vpath} is not a drawable (.ydr), fragment (.yft) or drawable dictionary (.ydd)"); } if o.lods.len() > 3 { bail!("at most three further detail levels (--lod)"); } let template = rpf.read_resource(id)?; - let shaders = ydr_write::usable_shaders(&template)?; // Every level's OBJ, and the textures their materials name. let mut files = vec![obj.to_path_buf()]; files.extend(o.lods.iter().cloned()); - let mut levels_text = Vec::new(); + let mut levels = Vec::new(); let mut textures = std::collections::HashMap::new(); for f in &files { let text = fs::read_to_string(f).with_context(|| format!("reading {}", f.display()))?; @@ -254,55 +264,85 @@ pub(crate) fn cmd_replace_model( textures.insert(material, texture); } } - levels_text.push(text); - } - let mut fitter = - obj::Fitter::new(&shaders, o.shader, &textures)?.with_shader_info(ydr_write::shader_infos(&template)?); - // Vehicles: parts named like bones (`door_dside_f`, `bonnet`) move with them. - // Wheels have models of their own: parts named after them are left out. - if let Some(bones) = ydr_write::skinned_bones(&template)? { - let own = ydr_write::bones_with_own_models(&template); - fitter = fitter.with_bones(obj::Bones::new(bones).with_own_models(own)); - } - let mut levels = Vec::new(); - for text in &levels_text { - levels.push(fitter.level(obj::read(text)?)); - } - for (material, m) in &fitter.materials { - let texture = - m.texture.as_ref().map(|t| format!(", texture {} ({}×{})", t.name, t.width, t.height)).unwrap_or_default(); - outln!("material {material:<24} → shader {}{texture}", m.shader); - } - if !fitter.textures_kept.is_empty() { - outln!("kept the shader's own texture (it takes no other): {}", fitter.textures_kept.join(", ")); - } - if let Some(bones) = fitter.bones() { - for (part, bone) in &bones.matched { - outln!("part {part:<28} → bone {bone}"); + levels.push(obj::read(&text).with_context(|| format!("reading {}", f.display()))?); + } + // Vehicles: parts named like bones (`door_dside_f`, `bonnet`) move with them, + // parts named after the wheel (`wheel_lf`) replace its model. + // Drawable dictionaries: parts named after a drawable go to it. + let options = obj::ImportOptions { shader: o.shader, drawable: o.drawable }; + let imported = obj::import(&template, vpath, levels, &textures, options, || { + obj::find_texture_donor(game_dir, vpath, keys.clone()) + })?; + let several = imported.targets.len() > 1; + for t in &imported.targets { + if t.materials.is_empty() { + continue; } - if !bones.unmatched.is_empty() { - outln!("parts on the body ({}): {}", bones.body_name(), bones.unmatched.join(", ")); + let place = match t.place { + _ if !several => String::new(), + ydr_write::Place::Main => "body: ".to_owned(), + ydr_write::Place::Child(_) => format!("{} (own model): ", t.names.join(", ")), + ydr_write::Place::Entry(_) => format!("{}: ", t.names.join(", ")), + }; + for (material, m) in &t.materials { + let texture = m + .texture + .as_ref() + .map(|t| format!(", texture {} ({}×{})", t.name, t.width, t.height)) + .unwrap_or_default(); + outln!("{place}material {material:<24} → shader {}{texture}", m.shader); } - if !bones.left_out.is_empty() { - outln!("left out (the vehicle's own models stay): {}", bones.left_out.join(", ")); + if !t.textures_kept.is_empty() { + outln!("{place}kept the shader's own texture (it takes no other): {}", t.textures_kept.join(", ")); + } + if let Some(bones) = t.bones() { + for (part, bone) in &bones.matched { + outln!("part {part:<28} → bone {bone}"); + } + if !bones.unmatched.is_empty() { + outln!("parts on the body ({}): {}", bones.body_name(), bones.unmatched.join(", ")); + } + if !bones.left_out.is_empty() { + outln!("left out (the game draws the wheel's own model there): {}", bones.left_out.join(", ")); + } + } + if matches!(t.place, ydr_write::Place::Child(_)) { + outln!("parts {} → the model of {}", t.parts.join(", "), t.names.join(", ")); + } + if t.has_weights() { + outln!("{place}bone weights from the nearest vertex of the original mesh"); } } - let materials: Vec = fitter.materials.into_iter().map(|(_, m)| m).collect(); - let donor = (materials.iter().any(|m| m.texture.is_some()) && !ydr_write::can_donate_textures(&template)) - .then(|| obj::find_texture_donor(game_dir, vpath, keys.clone())) - .flatten(); - let level_refs: Vec<&[ydr_write::NewMesh]> = levels.iter().map(Vec::as_slice).collect(); - let file = ydr_write::replace_lods(&template, &level_refs, Some(&materials), donor.as_ref())?; - // What the game will read: check it reads back. - let check = ydr_write::read_back(&file)?; - let vertices: usize = check.meshes.iter().map(|m| m.positions.len()).sum(); - let triangles: usize = check.meshes.iter().map(|m| m.indices.len() / 3).sum(); - outln!( - "{} detail level(s); closest: {} meshes, {vertices} vertices, {triangles} triangles ({})", - levels.len(), - check.meshes.len(), - human(file.len() as u64) - ); + if !imported.unplaced.is_empty() { + outln!("left out (named after no drawable; --drawable picks one for them): {}", imported.unplaced.join(", ")); + } + let file = imported.file; + let back = rage_resource::Resource::from_rsc7(&file)?; + for t in imported.targets.iter().filter(|t| !t.materials.is_empty()) { + let check = ydr_write::read_at(&back, t.place)?; + let vertices: usize = check.meshes.iter().map(|m| m.positions.len()).sum(); + let triangles: usize = check.meshes.iter().map(|m| m.indices.len() / 3).sum(); + let what = + if several { format!("{}: ", t.names.first().map_or("body", String::as_str)) } else { String::new() }; + outln!("{what}closest level: {} meshes, {vertices} vertices, {triangles} triangles", check.meshes.len()); + } + outln!("{} detail level(s), {}", imported.levels, human(file.len() as u64)); + let file = match o.collision { + Some(col) => with_collision(game_dir, vpath, &back, true, col, keys.clone())?, + None => file, + }; + save_model(game_dir, vpath, obj, file, &o, keys) +} + +/// `file` (the model built from `obj`) to `--out` and/or the mods folder. +fn save_model( + game_dir: &Path, + vpath: &str, + obj: &Path, + file: Vec, + o: &ReplaceOptions, + keys: Option>, +) -> Result<()> { if let Some(out) = o.out { fs::write(out, &file).with_context(|| format!("writing {}", out.display()))?; outln!("Saved {}", out.display()); @@ -314,6 +354,41 @@ pub(crate) fn cmd_replace_model( Ok(()) } +/// `res` (a `.ybn`, or a `.ydr` with `ydr`) with its collision built from +/// the OBJ file `col`. +fn with_collision( + game_dir: &Path, + vpath: &str, + res: &rage_resource::Resource, + ydr: bool, + col: &Path, + keys: Option>, +) -> Result> { + use rage_formats::ybn_write; + let text = fs::read_to_string(col).with_context(|| format!("reading {}", col.display()))?; + let meshes = openrage_app::obj::read(&text).with_context(|| format!("reading {}", col.display()))?; + let names = openrage_app::models::collision_material_names(game_dir, keys.clone()); + let (mesh, matched) = openrage_app::obj::collision_mesh(&meshes, names); + for (material, name) in &matched { + match name { + Some(n) => outln!("collision material {material:<20} → {n}"), + None => outln!("collision material {material:<20} → the original's first (no such collision material)"), + } + } + let donor = (!ybn_write::can_donate(res, ydr)) + .then(|| openrage_app::obj::find_collision_donor(game_dir, vpath, keys)) + .flatten(); + let file = ybn_write::replace_collision(res, ydr, &mesh, donor.as_ref().map(|(r, y)| (r, *y)))?; + let back = rage_resource::Resource::from_rsc7(&file)?; + let at = ybn_write::collision_of(&back, ydr)?; + for b in ybn_write::bvh_bounds(&back, at) { + ybn_write::check_bvh(&back, b).context("the written collision")?; + } + let (_, stats) = rage_formats::ybn::parse_at(&back, at).context("the written collision does not read back")?; + outln!("collision: {} triangles, {} vertices", stats.triangles, stats.vertices); + Ok(file) +} + pub(crate) fn cmd_put(game_dir: &Path, file: &Path, target: &str, keys: Option>) -> Result<()> { let data = fs::read(file).with_context(|| format!("reading {}", file.display()))?; let name = file.file_name().context("file has no name")?.to_string_lossy(); diff --git a/crates/openrage-cli/src/cmd/verify.rs b/crates/openrage-cli/src/cmd/verify.rs index 8a7bd45..b36a2e4 100644 --- a/crates/openrage-cli/src/cmd/verify.rs +++ b/crates/openrage-cli/src/cmd/verify.rs @@ -391,6 +391,161 @@ pub(crate) fn cmd_verify_paths(game_dir: &Path, within: &str, keys: Option rage_formats::ybn_write::CollisionMesh { + let mut out = rage_formats::ybn_write::CollisionMesh::default(); + for m in &d.meshes { + let material = d + .shaders + .get(m.shader as usize) + .map_or(0, |s| s.name_hash.wrapping_sub(rage_formats::ybn::MATERIAL_BASE) as u8); + let base = out.positions.len() as u32; + out.positions.extend_from_slice(&m.positions); + out.indices.extend(m.indices.iter().map(|i| i + base)); + out.materials.extend(std::iter::repeat_n(Some(material), m.indices.len() / 3)); + } + out +} + +/// Checks the game's collision hierarchies against the writer's reading of +/// them, then writes every Enhanced `.ybn` and drawable collision anew from +/// its own triangles (`ybn_write`) and compares what the reader gets back. +pub(crate) fn cmd_verify_collision_writer(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { + use rage_formats::{drawable, ybn, ybn_write}; + let starts = archive_roots(game_dir, within, keys.clone())?; + let started = Instant::now(); + // Per material type: triangles and area. + // Triangles that lie on the coarser vertex grid of the one new bound can collapse + // (slivers), so triangles may get fewer, never more; the area stays. + let totals = |d: &drawable::Drawable| -> std::collections::BTreeMap { + let mut t = std::collections::BTreeMap::new(); + for m in &d.meshes { + let e = t.entry(d.shaders[m.shader as usize].name_hash).or_insert((0usize, 0f64)); + for c in m.indices.as_chunks::<3>().0 { + let [a, b, c] = c.map(|i| m.positions[i as usize]); + let (u, v) = ([b[0] - a[0], b[1] - a[1], b[2] - a[2]], [c[0] - a[0], c[1] - a[1], c[2] - a[2]]); + let n = [u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]]; + let area = 0.5 * ((n[0] * n[0] + n[1] * n[1] + n[2] * n[2]) as f64).sqrt(); + e.0 += 1; + e.1 += area; + } + } + t + }; + // (game hierarchies checked, written anew, skipped: no triangle mesh to copy / too large) + // Collisions of boxes and spheres only borrow the structure of a triangle mesh. + let donor = openrage_app::obj::find_collision_donor(game_dir, within, keys.clone()); + let donor = donor.as_ref().map(|(r, y)| (r, *y)); + let check = |res: &rage_resource::Resource, ydr: bool, s: &mut (usize, usize, usize)| -> Result<()> { + let root = ybn_write::collision_of(res, ydr)?; + for b in ybn_write::bvh_bounds(res, root) { + ybn_write::check_bvh(res, b).context("the game's own hierarchy")?; + s.0 += 1; + } + let (before, _) = ybn::parse_at(res, root)?; + let mesh = collision_mesh(&before); + if mesh.indices.len() / 3 > ybn_write::MAX_TRIANGLES || mesh.indices.is_empty() { + s.2 += 1; + return Ok(()); + } + let file = ybn_write::replace_collision(res, ydr, &mesh, donor)?; + let back = rage_resource::Resource::from_rsc7(&file)?; + let at = ybn_write::collision_of(&back, ydr)?; + for b in ybn_write::bvh_bounds(&back, at) { + ybn_write::check_bvh(&back, b).context("the written hierarchy")?; + } + let (after, _) = ybn::parse_at(&back, at)?; + let (x, y) = (totals(&before), totals(&after)); + if x.len() != y.len() { + bail!("materials {:?} written as {:?}", x.keys().collect::>(), y.keys().collect::>()); + } + for ((m, a), (n, b)) in x.iter().zip(&y) { + if m != n || b.0 > a.0 || (a.1 - b.1).abs() > 0.01 * a.1 + 0.05 { + bail!( + "material {m:x}: {} triangles, area {:.2} written as {} triangles, area {:.2}", + a.0, + a.1, + b.0, + b.1 + ); + } + } + let slack: Vec = (0..3).map(|k| (before.bounds_max[k] - before.bounds_min[k]) / 30000.0 + 1e-3).collect(); + if (0..3).any(|k| { + (before.bounds_min[k] - after.bounds_min[k]).abs() > slack[k] + || (before.bounds_max[k] - after.bounds_max[k]).abs() > slack[k] + }) { + bail!( + "box {:?}..{:?} written as {:?}..{:?}", + before.bounds_min, + before.bounds_max, + after.bounds_min, + after.bounds_max + ); + } + if ydr { + let (a, b) = (drawable::parse_ydr(res)?, drawable::parse_ydr(&back)?); + if a.meshes.len() != b.meshes.len() { + bail!("the drawable's meshes changed"); + } + } + s.1 += 1; + Ok(()) + }; + type Counts = (usize, (usize, usize, usize), Vec); + let all: Vec = starts + .par_iter() + .map(|(prefix, rpf, dir)| { + let (mut files, mut s, mut errors, mut nested) = (0, (0, 0, 0), Vec::new(), Vec::new()); + vfs::walk( + rpf, + *dir, + prefix, + true, + &mut |a, id, p| { + let name = a.entry(id).name.to_ascii_lowercase(); + let ydr = name.ends_with(".ydr"); + if !ydr && !name.ends_with(".ybn") { + return; + } + let Ok(res) = a.read_resource(id) else { return }; + if ydr + && (res.version != drawable::VERSION_YDR_ENHANCED + || ybn_write::collision_of(&res, true).is_err()) + { + return; + } + files += 1; + if let Err(e) = check(&res, ydr, &mut s) { + errors.push(format!("{p}: {e:#}")); + } + }, + &mut |e| nested.push(e.to_string()), + ); + errors.extend(nested); + (files, s, errors) + }) + .collect(); + let sum = |f: fn(&Counts) -> usize| all.iter().map(f).sum::(); + let errors: Vec<&String> = all.iter().flat_map(|x| &x.2).collect(); + outln!( + "{} collisions ({} game hierarchies as expected), {} written anew and read back the same, {} skipped (no triangles, or over {}), {} errors ({:.1}s)", + sum(|x| x.0), + sum(|x| x.1.0), + sum(|x| x.1.1), + sum(|x| x.1.2), + rage_formats::ybn_write::MAX_TRIANGLES, + errors.len(), + started.elapsed().as_secs_f32() + ); + for e in errors.iter().take(30) { + outln!(" {e}"); + } + if errors.is_empty() { Ok(()) } else { bail!("{} collisions failed", errors.len()) } +} + pub(crate) fn cmd_verify_collisions(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); @@ -571,143 +726,232 @@ pub(crate) fn cmd_verify_text(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { use rage_formats::{drawable, ydr_write}; + use ydr_write::Place; let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); - let check = |res: &rage_resource::Resource| -> Result { + // The bone with the most weight, per vertex. + let main_bones = |m: &drawable::Mesh| -> Vec { + m.bone_indices + .iter() + .zip(&m.bone_weights) + .map(|(b, w)| b[(0..4).fold(0, |k, i| if w[i] > w[k] { i } else { k })]) + .collect() + }; + let single_bone = |m: &drawable::Mesh| m.bone_weights.iter().all(|w| w.iter().filter(|&&x| x > 0.0).count() == 1); + let byte = |w: f32| (w * 255.0).round() as u8; + // Places written (0: nothing to write) and child models / dictionary drawables among them. + let check = |res: &rage_resource::Resource, name: &str| -> Result<(usize, usize, usize)> { if res.version != drawable::VERSION_YDR_ENHANCED && res.version != drawable::VERSION_YFT_ENHANCED { - return Ok(false); + return Ok((0, 0, 0)); } - let before = if res.version == drawable::VERSION_YFT_ENHANCED { - drawable::parse_yft(res)? + let places: Vec = if name.ends_with(".ydd") { + (0..ydr_write::entry_hashes(res)?.len()).map(Place::Entry).collect() } else { - drawable::parse_ydr(res)? + std::iter::once(Place::Main).chain((0..ydr_write::child_models(res).len()).map(Place::Child)).collect() }; - let usable = ydr_write::usable_shaders(res)?; - let skinned = ydr_write::skinned_bones(res)?.is_some(); - // The bone with the most weight, per vertex. - let main_bones = |m: &drawable::Mesh| -> Vec { - m.bone_indices + let mut chosen: Vec<(Place, Vec)> = Vec::new(); + for place in places { + let before = ydr_write::read_at(res, place)?; + let usable = ydr_write::usable_shaders_at(res, place).with_context(|| format!("{place:?}"))?; + let skinned = ydr_write::is_skinned_at(res, place)?; + let meshes: Vec = before + .meshes .iter() - .zip(&m.bone_weights) - .map(|(b, w)| b[(0..4).fold(0, |k, i| if w[i] > w[k] { i } else { k })]) - .collect() - }; - let meshes: Vec = before - .meshes + .filter(|m| usable.contains(&m.shader) && !m.indices.is_empty() && m.bone_indices.is_empty() != skinned) + .map(|m| { + // Vertices on one bone each (vehicles) as the OBJ import gives them; + // blended ones (peds) with all their bones and weights. + let (bones, blend) = if m.bone_indices.is_empty() { + (Vec::new(), Vec::new()) + } else if single_bone(m) { + (main_bones(m), Vec::new()) + } else { + let blend = m + .bone_indices + .iter() + .zip(&m.bone_weights) + .map(|(b, w)| ydr_write::Blend { bones: *b, weights: *w }) + .collect(); + (Vec::new(), blend) + }; + ydr_write::NewMesh { + shader: m.shader, + positions: m.positions.clone(), + normals: m.normals.clone(), + uvs: m.uvs.clone(), + colors: m.colors.clone(), + indices: m.indices.clone(), + bones, + blend, + } + }) + .collect(); + if !meshes.is_empty() { + chosen.push((place, meshes)); + } + } + if chosen.is_empty() { + return Ok((0, 0, 0)); + } + let lods: Vec<[&[ydr_write::NewMesh]; 1]> = chosen.iter().map(|(_, m)| [m.as_slice()]).collect(); + let parts: Vec = chosen .iter() - .filter(|m| usable.contains(&m.shader) && !m.indices.is_empty() && m.bone_indices.is_empty() != skinned) - .map(|m| ydr_write::NewMesh { - shader: m.shader, - positions: m.positions.clone(), - normals: m.normals.clone(), - uvs: m.uvs.clone(), - colors: m.colors.clone(), - indices: m.indices.clone(), - bones: main_bones(m), - }) + .zip(&lods) + .map(|((place, _), l)| ydr_write::Part { place: *place, lods: l, materials: None }) .collect(); - if meshes.is_empty() { - return Ok(false); - } - let file = ydr_write::replace_meshes(res, &meshes)?; - let after = ydr_write::read_back(&file)?; - if after.meshes.len() != meshes.len() { - bail!("{} meshes written, {} read back", meshes.len(), after.meshes.len()); + let file = ydr_write::replace_parts(res, &parts, None)?; + let after_res = rage_resource::Resource::from_rsc7(&file)?; + // What the game gets reads back as a whole. + if name.ends_with(".ydd") { + drawable::parse_ydd(&after_res)?; + } else { + ydr_write::read_back(&file)?; } - for (i, (a, m)) in after.meshes.iter().zip(&meshes).enumerate() { - // Bit for bit: some of the game's vertices hold NaN, which never equals itself. - let same = - |x: &[f32], y: &[f32]| x.len() == y.len() && x.iter().zip(y).all(|(p, q)| p.to_bits() == q.to_bits()); - if !same(a.positions.as_flattened(), m.positions.as_flattened()) - || a.indices != m.indices - || a.shader != m.shader - { - bail!("mesh {i}: geometry differs after writing"); + for (place, meshes) in &chosen { + let after = ydr_write::read_at(&after_res, *place)?; + if after.meshes.len() != meshes.len() { + bail!("{place:?}: {} meshes written, {} read back", meshes.len(), after.meshes.len()); } - if !m.uvs.is_empty() && !same(a.uvs.as_flattened(), m.uvs.as_flattened()) { - bail!("mesh {i}: texture coordinates differ after writing"); - } - let close = |x: &[[f32; 3]], y: &[[f32; 3]]| { - x.len() == y.len() && x.iter().zip(y).all(|(p, q)| (0..3).all(|k| (p[k] - q[k]).abs() < 0.01)) - }; - if !m.normals.is_empty() && !close(&a.normals, &m.normals) { - bail!("mesh {i}: normals differ after writing"); - } - if !m.colors.is_empty() && a.colors.first() != m.colors.first() { - bail!("mesh {i}: colours differ after writing"); - } - if main_bones(a) != m.bones { - bail!("mesh {i}: vertices move with other bones after writing"); + for (i, (a, m)) in after.meshes.iter().zip(meshes).enumerate() { + // Bit for bit: some of the game's vertices hold NaN, which never equals itself. + let same = |x: &[f32], y: &[f32]| { + x.len() == y.len() && x.iter().zip(y).all(|(p, q)| p.to_bits() == q.to_bits()) + }; + if !same(a.positions.as_flattened(), m.positions.as_flattened()) + || a.indices != m.indices + || a.shader != m.shader + { + bail!("{place:?} mesh {i}: geometry differs after writing"); + } + if !m.uvs.is_empty() && !same(a.uvs.as_flattened(), m.uvs.as_flattened()) { + bail!("{place:?} mesh {i}: texture coordinates differ after writing"); + } + let close = |x: &[[f32; 3]], y: &[[f32; 3]]| { + x.len() == y.len() && x.iter().zip(y).all(|(p, q)| (0..3).all(|k| (p[k] - q[k]).abs() < 0.01)) + }; + if !m.normals.is_empty() && !close(&a.normals, &m.normals) { + bail!("{place:?} mesh {i}: normals differ after writing"); + } + if !m.colors.is_empty() && a.colors.first() != m.colors.first() { + bail!("{place:?} mesh {i}: colours differ after writing"); + } + if m.blend.is_empty() { + if main_bones(a) != m.bones { + bail!("{place:?} mesh {i}: vertices move with other bones after writing"); + } + } else { + let got = a.bone_indices.iter().zip(&a.bone_weights).map(|(b, w)| (*b, w.map(byte))); + if got.ne(m.blend.iter().map(|bl| (bl.bones, bl.weights.map(byte)))) { + bail!("{place:?} mesh {i}: bones or weights differ after writing"); + } + } } } + let children = chosen.iter().filter(|(p, _)| matches!(p, Place::Child(_))).count(); + let entries = chosen.iter().filter(|(p, _)| matches!(p, Place::Entry(_))).count(); + let written = (chosen.len(), children, entries); + // Materials: a shader copy per mesh shader, with a texture where the - // model has an embedded dictionary to put it in. + // place's shader group has an embedded dictionary to put it in. // (A model with an empty embedded dictionary borrows the structure from another one when // importing; here only models with embedded textures get one.) - let embedded = ydr_write::can_donate_textures(res); - let mut materials: Vec = Vec::new(); - let mut with_materials = meshes.clone(); - for m in &mut with_materials { - let k = match materials.iter().position(|mat| mat.shader == m.shader) { - Some(k) => k, - None => { - let texture = embedded - .then(|| { - ydr_write::texture_from_rgba( - &format!("openrage_check_{}", materials.len()), - 2, - 2, - &[200; 16], - ) - }) - .transpose()?; - materials.push(ydr_write::NewMaterial { shader: m.shader, texture }); - materials.len() - 1 - } - }; - m.shader = k as u16; + let owner = |p: Place| if matches!(p, Place::Child(_)) { Place::Main } else { p }; + let mut materials: Vec> = Vec::new(); + let mut with_materials = Vec::new(); + for (place, meshes) in &chosen { + let embedded = ydr_write::read_at(res, owner(*place))?.textures.is_some_and(|t| !t.textures.is_empty()); + let mut mats: Vec = Vec::new(); + let mut meshes = meshes.clone(); + for m in &mut meshes { + let k = match mats.iter().position(|mat| mat.shader == m.shader) { + Some(k) => k, + None => { + let texture = embedded + .then(|| { + ydr_write::texture_from_rgba( + &format!("openrage_check_{}", mats.len()), + 2, + 2, + &[200; 16], + ) + }) + .transpose()?; + mats.push(ydr_write::NewMaterial { shader: m.shader, texture }); + mats.len() - 1 + } + }; + m.shader = k as u16; + } + materials.push(mats); + with_materials.push(meshes); } - let shaders_before = before.shaders.len(); - let file = match ydr_write::replace_with_materials(res, &with_materials, &materials, None) { + let lods: Vec<[&[ydr_write::NewMesh]; 1]> = with_materials.iter().map(|m| [m.as_slice()]).collect(); + let parts: Vec = chosen + .iter() + .zip(&lods) + .zip(&materials) + .map(|(((place, _), l), mats)| ydr_write::Part { place: *place, lods: l, materials: Some(mats) }) + .collect(); + let file = match ydr_write::replace_parts(res, &parts, None) { Ok(f) => f, // Shaders without a colour slot cannot take a texture: fine, skip that part. - Err(e) if e.to_string().contains("colour") => return Ok(true), + Err(e) if e.to_string().contains("colour") => return Ok(written), Err(e) => return Err(e.into()), }; - let after = ydr_write::read_back(&file)?; - if after.shaders.len() != shaders_before + materials.len() { - bail!("materials: {} shaders, expected {}", after.shaders.len(), shaders_before + materials.len()); - } - for (k, mat) in materials.iter().enumerate() { - if let Some(t) = &mat.texture { - if !after.shaders[shaders_before + k].textures.contains(&t.name) { - bail!("material {k}: its shader does not use {}", t.name); + let after_res = rage_resource::Resource::from_rsc7(&file)?; + // Where each part's copies start: after the group's shaders and the copies of earlier parts. + let mut next: Vec<(Place, usize)> = Vec::new(); + for (((place, _), mats), meshes) in chosen.iter().zip(&materials).zip(&with_materials) { + let o = owner(*place); + let first = match next.iter_mut().find(|(p, _)| *p == o) { + Some((_, n)) => n, + None => { + next.push((o, ydr_write::read_at(res, o)?.shaders.len())); + &mut next.last_mut().expect("pushed").1 } - let found = after.textures.as_ref().and_then(|d| d.textures.iter().find(|x| x.name == t.name)); - if found.and_then(|x| x.to_rgba()).as_deref() != Some(&[200u8; 16][..]) { - bail!("material {k}: texture {} not embedded intact", t.name); + }; + let start = *first; + *first += mats.len(); + let group = ydr_write::read_at(&after_res, o)?; + for (k, mat) in mats.iter().enumerate() { + let Some(shader) = group.shaders.get(start + k) else { + bail!("{place:?} materials: {} shaders, copy {} missing", group.shaders.len(), start + k); + }; + if let Some(t) = &mat.texture { + if !shader.textures.contains(&t.name) { + bail!("{place:?} material {k}: its shader does not use {}", t.name); + } + let found = group.textures.as_ref().and_then(|d| d.textures.iter().find(|x| x.name == t.name)); + if found.and_then(|x| x.to_rgba()).as_deref() != Some(&[200u8; 16][..]) { + bail!("{place:?} material {k}: texture {} not embedded intact", t.name); + } } } + let after = ydr_write::read_at(&after_res, *place)?; + if after.meshes.iter().map(|m| m.shader as usize).ne(meshes.iter().map(|m| start + m.shader as usize)) { + bail!("{place:?} materials: meshes do not use their shader copies"); + } } - if after - .meshes - .iter() - .map(|m| m.shader as usize) - .ne((0..with_materials.len()).map(|i| shaders_before + with_materials[i].shader as usize)) - { - bail!("materials: meshes do not use their shader copies"); + for (o, n) in &next { + let got = ydr_write::read_at(&after_res, *o)?.shaders.len(); + if got != *n { + bail!("{o:?} materials: {got} shaders, expected {n}"); + } } - Ok(true) + Ok(written) }; - let results: Vec<(usize, usize, Vec)> = starts + type Counts = (usize, usize, usize, usize, Vec); + let results: Vec = starts .par_iter() .map(|(prefix, rpf, dir)| { - let (mut seen, mut written, mut errors, mut nested) = (0, 0, Vec::new(), Vec::new()); + let (mut seen, mut written, mut children, mut entries) = (0, 0, 0, 0); + let (mut errors, mut nested) = (Vec::new(), Vec::new()); vfs::walk( rpf, *dir, @@ -715,33 +959,41 @@ pub(crate) fn cmd_verify_model_writer(game_dir: &Path, within: &str, keys: Optio true, &mut |a, id, p| { let name = a.entry(id).name.to_ascii_lowercase(); - if !name.ends_with(".ydr") && !name.ends_with(".yft") { + if !name.ends_with(".ydr") && !name.ends_with(".yft") && !name.ends_with(".ydd") { return; } seen += 1; - match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| check(&r)) { - Ok(true) => written += 1, - Ok(false) => {} + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| check(&r, &name)) { + Ok((0, _, _)) => {} + Ok((_, c, e)) => { + written += 1; + children += c; + entries += e; + } Err(e) => errors.push(format!("{p}: {e:#}")), } }, &mut |e| nested.push(e.to_string()), ); errors.extend(nested); - (seen, written, errors) + (seen, written, children, entries, errors) }) .collect(); - let (seen, written) = results.iter().fold((0, 0), |(s, w), r| (s + r.0, w + r.1)); - let errors: Vec<&String> = results.iter().flat_map(|r| &r.2).collect(); + let sum = |f: fn(&Counts) -> usize| results.iter().map(f).sum::(); + let errors: Vec<&String> = results.iter().flat_map(|r| &r.4).collect(); outln!( - "{seen} drawables, {written} written anew and read back identically, {} errors ({:.1}s)", + "{} models, {} written anew and read back identically ({} fragment child models, {} dictionary drawables among them), {} errors ({:.1}s)", + sum(|r| r.0), + sum(|r| r.1), + sum(|r| r.2), + sum(|r| r.3), errors.len(), started.elapsed().as_secs_f32() ); for e in errors.iter().take(30) { outln!(" {e}"); } - if errors.is_empty() { Ok(()) } else { bail!("{} drawables failed", errors.len()) } + if errors.is_empty() { Ok(()) } else { bail!("{} models failed", errors.len()) } } pub(crate) fn cmd_verify_meta(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { diff --git a/crates/openrage-cli/src/main.rs b/crates/openrage-cli/src/main.rs index 340f4d3..71e6c5d 100644 --- a/crates/openrage-cli/src/main.rs +++ b/crates/openrage-cli/src/main.rs @@ -181,6 +181,9 @@ fn run() -> Result<()> { Command::Verify { path, scripts: true, .. } => cmd_verify_scripts(&game_dir, &path, keys), Command::Verify { path, paths: true, .. } => cmd_verify_paths(&game_dir, &path, keys), Command::Verify { path, collisions: true, .. } if gta4 => cmd_verify_gta4_collisions(&game_dir, &path), + Command::Verify { path, collisions: true, rebuild: true, .. } => { + cmd_verify_collision_writer(&game_dir, &path, keys) + } Command::Verify { path, collisions: true, .. } => cmd_verify_collisions(&game_dir, &path, keys), Command::Verify { path, particles: true, .. } => cmd_verify_particles(&game_dir, &path, keys), Command::Verify { path, text: true, .. } if gta4 => cmd_verify_gta4_text(&game_dir, &path), @@ -218,8 +221,16 @@ fn run() -> Result<()> { cmd_model(&game_dir, &path, outfit, view, keys) } Command::Clips { path, clip } => cmd_clips(&game_dir, &path, clip.as_deref(), keys), - Command::ReplaceModel { path, obj, out, mods, shader, lod, no_textures } => { - let options = ReplaceOptions { out: out.as_deref(), mods, shader, lods: &lod, textures: !no_textures }; + Command::ReplaceModel { path, obj, out, mods, shader, lod, no_textures, drawable, collision } => { + let options = ReplaceOptions { + out: out.as_deref(), + mods, + shader, + lods: &lod, + textures: !no_textures, + drawable: drawable.as_deref(), + collision: collision.as_deref(), + }; cmd_replace_model(&game_dir, &path, &obj, options, keys) } Command::World { x, y, z, radius } => { diff --git a/crates/rage-formats/src/lib.rs b/crates/rage-formats/src/lib.rs index 2c65c59..2a524b6 100644 --- a/crates/rage-formats/src/lib.rs +++ b/crates/rage-formats/src/lib.rs @@ -37,6 +37,7 @@ pub mod wpl; pub mod wtd_write; pub mod xml; pub mod ybn; +pub mod ybn_write; pub mod ydr_write; pub mod ypt; pub mod ysc; diff --git a/crates/rage-formats/src/ybn_write.rs b/crates/rage-formats/src/ybn_write.rs new file mode 100644 index 0000000..0ec2e7f --- /dev/null +++ b/crates/rage-formats/src/ybn_write.rs @@ -0,0 +1,688 @@ +//! Writing collisions of GTA V Enhanced: a triangle mesh as a bound with a +//! bounding volume hierarchy (`phBoundBVH`, type 8), in place of the +//! collision of a `.ybn` or of a drawable (`.ydr`, at `0xC8`). +//! +//! Like the model writer, nothing of the structures is invented: the new +//! bound is a copy of a BVH bound of the template (or of a donor), with new +//! vertices, polygons, materials and hierarchy. Layout (measured on the +//! game's files, see also [`crate::ybn`]): +//! +//! * bound (0x150): `0x14` sphere radius, `0x20` box max, `0x30` box min, +//! `0x40` box centre, `0x50` sphere centre; geometry: `0x84` vertex count, +//! `0x88` polygons, `0x90` quantum, `0xA0` centre, `0xB0` vertices (3 × i16), +//! `0xD0`/`0xD4` vertex and polygon counts, `0xF0` materials (8 bytes, the +//! type first), `0x118` material index per polygon, `0x120` material count, +//! `0x130` the hierarchy; +//! * polygon (16 bytes): its area (f32; the low 3 bits of the first byte are +//! the polygon type, 0 = triangle), three vertex indices (u16), and per edge +//! (corners k, k+1) the polygon on its other side (i16, −1: none); +//! * hierarchy (0x80): `0x00` nodes, count and capacity (u32); `0x20` box min, +//! `0x30` max, `0x40` centre, `0x50` 1 / quantum, `0x60` quantum (box size +//! / 65534); `0x70` subtree headers, count and capacity (u16); +//! * node (16 bytes): quantized box (6 × i16, around the centre), then for a +//! leaf its first polygon and polygon count (at most 4; leaves cover the +//! polygons in order), for an inner node the size of its subtree (its left +//! child follows it, the right one follows the left subtree) and 0; +//! * subtree header (16 bytes): quantized box, first node and the node after +//! the subtree: every subtree of at most 128 nodes whose parent is larger, +//! in the order they are finished (as Bullet's quantized BVH does). +//! +//! A composite (type 10) keeps one child, the new bound: `0x70` children, +//! `0x78`/`0x80` transforms, `0x88` boxes, `0x90`/`0x98` flags, `0xA0`/`0xA2` +//! counts, `0xA8` its own hierarchy (none for one child). + +use rage_resource::builder::{BlockId, Builder, Segment}; +use rage_resource::{Resource, ResourceError}; + +use crate::ybn::kind; + +const SYS: u64 = 0x5000_0000; +const GFX: u64 = 0x6000_0000; +const BVH_BOUND_SIZE: usize = 0x150; +const BVH_SIZE: usize = 0x80; +/// Most polygons in a leaf. +const LEAF_ITEMS: usize = 4; +/// Most nodes of a subtree with a header of its own (2048 bytes). +const SUBTREE_NODES: usize = 128; +/// Most vertices and polygons of one bound (indices are 15 bits). +pub const MAX_TRIANGLES: usize = 0x7FFF; + +fn bad(msg: impl Into) -> ResourceError { + ResourceError::Format(msg.into()) +} + +/// A collision mesh to write. +#[derive(Debug, Clone, Default, PartialEq)] +pub struct CollisionMesh { + pub positions: Vec<[f32; 3]>, + /// Three per triangle. + pub indices: Vec, + /// The material type of each triangle (an index into the game's + /// `materials.dat`; `None`: the template's first material), or empty: + /// all the template's first. + pub materials: Vec>, +} + +/// Where a resource keeps its collision: a `.ybn`'s root, a drawable's `0xC8`. +pub fn collision_of(res: &Resource, ydr: bool) -> Result { + if !ydr { + return Ok(SYS); + } + let at = res.u64(SYS + 0xC8)?; + if !(SYS..GFX).contains(&at) { + return Err(bad("the drawable has no collision")); + } + Ok(at) +} + +/// The first BVH bound below `at` (itself or a composite's child). +fn find_bvh(res: &Resource, at: u64, depth: usize) -> Option { + match res.u8(at + 0x10).ok()? { + kind::BVH => Some(at), + kind::COMPOSITE if depth < 4 => { + let children = res.u64(at + 0x70).ok()?; + (0..res.u16(at + 0xA0).ok()? as u64) + .filter_map(|i| res.u64(children + i * 8).ok().filter(|&c| (SYS..GFX).contains(&c))) + .find_map(|c| find_bvh(res, c, depth + 1)) + } + _ => None, + } +} + +/// Whether a resource (`.ybn`, or `.ydr` with `ydr`) has a BVH bound to lend +/// its structure ([`replace_collision`]'s donor). +pub fn can_donate(res: &Resource, ydr: bool) -> bool { + collision_of(res, ydr).ok().and_then(|at| find_bvh(res, at, 0)).is_some() +} + +/// The template's file with its collision replaced by `mesh` (`ydr`: the +/// template is a drawable). The structures are copied from a BVH bound of the +/// template, else of `donor` (a `.ybn`, or a `.ydr` with `donor_ydr`). +pub fn replace_collision( + template: &Resource, + ydr: bool, + mesh: &CollisionMesh, + donor: Option<(&Resource, bool)>, +) -> Result, ResourceError> { + let root = collision_of(template, ydr)?; + let n = mesh.positions.len(); + if mesh.indices.is_empty() || !mesh.indices.len().is_multiple_of(3) { + return Err(bad("the collision has no triangles")); + } + if mesh.indices.iter().any(|&i| i as usize >= n) { + return Err(bad("the collision has triangles pointing at missing vertices")); + } + if !mesh.materials.is_empty() && mesh.materials.len() != mesh.indices.len() / 3 { + return Err(bad("the collision has a material list of the wrong length")); + } + if mesh.positions.iter().flatten().any(|v| !v.is_finite()) { + return Err(bad("the collision has positions that are not numbers")); + } + // The structure to copy. + let (src, src_at) = match find_bvh(template, root, 0) { + Some(at) => (template, at), + None => { + let (d, d_ydr) = donor.ok_or_else(|| { + bad("the original collision has no triangle mesh to copy the structure from (give a donor)") + })?; + let at = collision_of(d, d_ydr).ok().and_then(|r| find_bvh(d, r, 0)); + (d, at.ok_or_else(|| bad("the donor has no triangle mesh collision"))?) + } + }; + let bound_bytes = src.bytes(src_at, BVH_BOUND_SIZE)?.to_vec(); + let bvh_at = src.u64(src_at + 0x130)?; + let bvh_bytes = src.bytes(bvh_at, BVH_SIZE)?.to_vec(); + let material_bytes = { + let m = src.u64(src_at + 0xF0)?; + if m != 0 { src.bytes(m, 8)?.to_vec() } else { vec![0; 8] } + }; + let default_material = material_bytes[0]; + + let built = build_geometry(mesh, default_material)?; + + let mut b = Builder::new(); + let sys = b.add(Segment::System, template.system.clone()); + if !template.graphics.is_empty() { + b.add(Segment::Graphics, template.graphics.clone()); + } + b.add_pages_info(sys, 0x08); + let bound = write_bvh_bound(&mut b, &built, bound_bytes, bvh_bytes, &material_bytes); + + let root_kind = template.u8(root + 0x10)?; + let at = (root - SYS) as usize; + if root_kind == kind::COMPOSITE { + // One child: the new bound, without moving it. + let flags_at = template.u64(root + 0x90)?; + let flags = if flags_at != 0 { template.bytes(flags_at, 8)?.to_vec() } else { vec![0; 8] }; + let t_at = template.u64(root + 0x78)?; + let mut transform = if t_at != 0 { template.bytes(t_at, 64)?.to_vec() } else { vec![0; 64] }; + for (k, v) in [1.0f32, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0].iter().enumerate() { + // Columns of three; the w of each column holds other data. + let at = (k / 3) * 16 + (k % 3) * 4; + transform[at..at + 4].copy_from_slice(&v.to_le_bytes()); + } + let boxes_at = template.u64(root + 0x88)?; + let mut aabb = if boxes_at != 0 { template.bytes(boxes_at, 32)?.to_vec() } else { vec![0; 32] }; + put_vec3(&mut aabb, 0, built.min); + put_vec3(&mut aabb, 16, built.max); + let children = b.add(Segment::System, vec![0u8; 16]); + b.pointer(children, 0, bound, 0); + let transform = b.add(Segment::System, transform); + let aabb = b.add(Segment::System, aabb); + let flags = b.add(Segment::System, [flags, vec![0; 8]].concat()); + b.pointer(sys, at + 0x70, children, 0); + b.pointer(sys, at + 0x78, transform, 0); + b.pointer(sys, at + 0x80, transform, 0); + b.pointer(sys, at + 0x88, aabb, 0); + b.pointer(sys, at + 0x90, flags, 0); + b.pointer(sys, at + 0x98, flags, 0); + let d = b.data_mut(sys); + put_u16(d, at + 0xA0, 1); + put_u16(d, at + 0xA2, 1); + d[at + 0xA8..at + 0xB0].fill(0); + put_bound_box(d, at, &built); + } else if ydr { + b.pointer(sys, 0xC8, bound, 0); + } else { + return Err(bad("the collision file's root is no composite: it cannot get a new bound")); + } + b.build(template.version) +} + +/// Vertices, polygons and hierarchy of a mesh, in the bound's order. +struct Built { + min: [f32; 3], + max: [f32; 3], + quantum: [f32; 3], + centre: [f32; 3], + vertices: Vec<[i16; 3]>, + /// (corners, area, neighbours, material index) + polygons: Vec<([u16; 3], f32, [i16; 3], u8)>, + materials: Vec, + nodes: Vec, + subtrees: Vec<(usize, usize)>, + bvh_quantum: [f32; 3], +} + +#[derive(Debug, Clone, Copy)] +struct Node { + min: [f32; 3], + max: [f32; 3], + /// Leaf: first polygon and count; inner: subtree size and 0. + item: usize, + count: usize, +} + +fn sub(a: [f32; 3], b: [f32; 3]) -> [f32; 3] { + [a[0] - b[0], a[1] - b[1], a[2] - b[2]] +} + +fn cross(a: [f32; 3], b: [f32; 3]) -> [f32; 3] { + [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]] +} + +fn build_geometry(mesh: &CollisionMesh, default_material: u8) -> Result { + let tris: Vec<[usize; 3]> = + mesh.indices.as_chunks::<3>().0.iter().map(|t| [t[0] as usize, t[1] as usize, t[2] as usize]).collect(); + if tris.len() > MAX_TRIANGLES { + return Err(bad(format!("the collision has {} triangles; at most {MAX_TRIANGLES}", tris.len()))); + } + let (mut min, mut max) = ([f32::MAX; 3], [f32::MIN; 3]); + for t in &tris { + for &i in t { + for k in 0..3 { + min[k] = min[k].min(mesh.positions[i][k]); + max[k] = max[k].max(mesh.positions[i][k]); + } + } + } + let centre: [f32; 3] = std::array::from_fn(|k| (min[k] + max[k]) / 2.0); + let quantum: [f32; 3] = std::array::from_fn(|k| ((max[k] - min[k]) / 65534.0).max(1e-6)); + // Vertices once per quantized place, so neighbours share them. + let mut vertices: Vec<[i16; 3]> = Vec::new(); + let mut seen: std::collections::HashMap<[i16; 3], u16> = std::collections::HashMap::new(); + let mut corner = |p: [f32; 3]| -> Result { + let q: [i16; 3] = + std::array::from_fn(|k| ((p[k] - centre[k]) / quantum[k]).round().clamp(-32767.0, 32767.0) as i16); + if let Some(&i) = seen.get(&q) { + return Ok(i); + } + if vertices.len() >= MAX_TRIANGLES { + return Err(bad(format!("the collision has more than {MAX_TRIANGLES} vertices"))); + } + vertices.push(q); + seen.insert(q, vertices.len() as u16 - 1); + Ok(vertices.len() as u16 - 1) + }; + let mut polys: Vec<[u16; 3]> = Vec::with_capacity(tris.len()); + for t in &tris { + polys.push([corner(mesh.positions[t[0]])?, corner(mesh.positions[t[1]])?, corner(mesh.positions[t[2]])?]); + } + let dequant = |v: [i16; 3]| -> [f32; 3] { std::array::from_fn(|k| v[k] as f32 * quantum[k] + centre[k]) }; + // Material types in use, each once. + let mut materials: Vec = Vec::new(); + let poly_material: Vec = (0..tris.len()) + .map(|i| { + let m = mesh.materials.get(i).copied().flatten().unwrap_or(default_material); + match materials.iter().position(|&x| x == m) { + Some(k) => k as u8, + None => { + materials.push(m); + materials.len() as u8 - 1 + } + } + }) + .collect(); + if materials.len() > 255 { + return Err(bad("the collision uses more than 255 materials")); + } + // The hierarchy over polygon boxes; it gives the polygons' order. + let boxes: Vec<([f32; 3], [f32; 3])> = polys + .iter() + .map(|p| { + let c = p.map(|i| dequant(vertices[i as usize])); + ( + std::array::from_fn(|k| c[0][k].min(c[1][k]).min(c[2][k])), + std::array::from_fn(|k| c[0][k].max(c[1][k]).max(c[2][k])), + ) + }) + .collect(); + let mut order: Vec = (0..polys.len()).collect(); + let mut nodes = Vec::new(); + let mut subtrees = Vec::new(); + build_nodes(&boxes, &mut order, 0, &mut nodes, &mut subtrees); + if nodes.len() <= SUBTREE_NODES { + subtrees = vec![(0, nodes.len())]; + } + if nodes.len() > 0x7FFF { + return Err(bad("the collision's hierarchy is too large")); + } + // Polygons in leaf order, with their neighbours. + let ordered: Vec<[u16; 3]> = order.iter().map(|&i| polys[i]).collect(); + let mut edges: std::collections::HashMap<(u16, u16), Vec> = std::collections::HashMap::new(); + for (i, p) in ordered.iter().enumerate() { + for k in 0..3 { + let (a, b) = (p[k], p[(k + 1) % 3]); + edges.entry((a.min(b), a.max(b))).or_default().push(i); + } + } + let polygons = ordered + .iter() + .enumerate() + .map(|(i, p)| { + let c = p.map(|v| dequant(vertices[v as usize])); + let n = cross(sub(c[1], c[0]), sub(c[2], c[0])); + let area = 0.5 * (n[0] * n[0] + n[1] * n[1] + n[2] * n[2]).sqrt(); + let neighbours: [i16; 3] = std::array::from_fn(|k| { + let (a, b) = (p[k], p[(k + 1) % 3]); + edges[&(a.min(b), a.max(b))].iter().find(|&&j| j != i).map_or(-1, |&j| j as i16) + }); + (*p, area, neighbours, poly_material[order[i]]) + }) + .collect(); + let bvh_quantum: [f32; 3] = std::array::from_fn(|k| ((max[k] - min[k]) / 65534.0).max(1e-6)); + Ok(Built { min, max, quantum, centre, vertices, polygons, materials, nodes, subtrees, bvh_quantum }) +} + +/// Builds the nodes of `order` (polygon indices, reordered in place to leaf +/// order; `first` is where they start among all polygons), depth first. +/// Returns the index of the subtree's root. +fn build_nodes( + boxes: &[([f32; 3], [f32; 3])], + order: &mut [usize], + first: usize, + nodes: &mut Vec, + subtrees: &mut Vec<(usize, usize)>, +) -> usize { + let (mut min, mut max) = ([f32::MAX; 3], [f32::MIN; 3]); + for &i in order.iter() { + for k in 0..3 { + min[k] = min[k].min(boxes[i].0[k]); + max[k] = max[k].max(boxes[i].1[k]); + } + } + let at = nodes.len(); + if order.len() <= LEAF_ITEMS { + nodes.push(Node { min, max, item: first, count: order.len() }); + return at; + } + nodes.push(Node { min, max, item: 0, count: 0 }); + // Split at the middle along the longest axis of the centres. + let centre = |i: usize, k: usize| (boxes[i].0[k] + boxes[i].1[k]) / 2.0; + let (mut lo, mut hi) = ([f32::MAX; 3], [f32::MIN; 3]); + for &i in order.iter() { + for k in 0..3 { + lo[k] = lo[k].min(centre(i, k)); + hi[k] = hi[k].max(centre(i, k)); + } + } + let axis = (0..3).max_by(|&a, &b| (hi[a] - lo[a]).total_cmp(&(hi[b] - lo[b]))).unwrap_or(0); + order.sort_by(|&a, &b| centre(a, axis).total_cmp(¢re(b, axis))); + let half = order.len() / 2; + let (left, right) = order.split_at_mut(half); + let l = build_nodes(boxes, left, first, nodes, subtrees); + let r = build_nodes(boxes, right, first + half, nodes, subtrees); + let size = nodes.len() - at; + nodes[at].item = size; + // Subtrees small enough under a node too large get headers. + if size > SUBTREE_NODES { + for child in [l, r] { + let child_size = if nodes[child].count > 0 { 1 } else { nodes[child].item }; + if child_size <= SUBTREE_NODES { + subtrees.push((child, child + child_size)); + } + } + } + at +} + +fn put_u16(d: &mut [u8], at: usize, v: u16) { + d[at..at + 2].copy_from_slice(&v.to_le_bytes()); +} +fn put_u32(d: &mut [u8], at: usize, v: u32) { + d[at..at + 4].copy_from_slice(&v.to_le_bytes()); +} +fn put_f32(d: &mut [u8], at: usize, v: f32) { + d[at..at + 4].copy_from_slice(&v.to_le_bytes()); +} +fn put_vec3(d: &mut [u8], at: usize, v: [f32; 3]) { + for (k, x) in v.iter().enumerate() { + put_f32(d, at + k * 4, *x); + } +} + +/// A bound's box, box centre, sphere centre and radius. +fn put_bound_box(d: &mut [u8], at: usize, b: &Built) { + let centre: [f32; 3] = std::array::from_fn(|k| (b.min[k] + b.max[k]) / 2.0); + let half = sub(b.max, centre); + put_vec3(d, at + 0x20, b.max); + put_vec3(d, at + 0x30, b.min); + put_vec3(d, at + 0x40, centre); + put_vec3(d, at + 0x50, centre); + put_f32(d, at + 0x14, (half[0] * half[0] + half[1] * half[1] + half[2] * half[2]).sqrt()); +} + +fn write_bvh_bound(b: &mut Builder, g: &Built, mut bound: Vec, mut bvh: Vec, material: &[u8]) -> BlockId { + let verts: Vec = g.vertices.iter().flat_map(|v| v.iter().flat_map(|x| x.to_le_bytes())).collect(); + let mut polys = Vec::with_capacity(g.polygons.len() * 16); + for (corners, area, neighbours, _) in &g.polygons { + let mut p = [0u8; 16]; + put_f32(&mut p, 0, *area); + p[0] &= !7; // triangle + for k in 0..3 { + put_u16(&mut p, 4 + k * 2, corners[k]); + p[10 + k * 2..12 + k * 2].copy_from_slice(&neighbours[k].to_le_bytes()); + } + polys.extend_from_slice(&p); + } + let poly_materials: Vec = g.polygons.iter().map(|p| p.3).collect(); + let materials: Vec = g + .materials + .iter() + .flat_map(|&m| { + let mut x = material.to_vec(); + x[0] = m; + x + }) + .collect(); + + // Hierarchy. + let bq = g.bvh_quantum; + let bc: [f32; 3] = std::array::from_fn(|k| (g.min[k] + g.max[k]) / 2.0); + let quant = |v: [f32; 3], up: bool| -> [i16; 3] { + std::array::from_fn(|k| { + let x = (v[k] - bc[k]) / bq[k]; + (if up { x.ceil() } else { x.floor() }).clamp(-32767.0, 32767.0) as i16 + }) + }; + let mut nodes = Vec::with_capacity(g.nodes.len() * 16); + for n in &g.nodes { + for v in quant(n.min, false).into_iter().chain(quant(n.max, true)) { + nodes.extend_from_slice(&v.to_le_bytes()); + } + nodes.extend_from_slice(&(n.item as u16).to_le_bytes()); + nodes.extend_from_slice(&(n.count as u16).to_le_bytes()); + } + let mut trees = Vec::with_capacity(g.subtrees.len() * 16); + for &(start, end) in &g.subtrees { + let n = g.nodes[start]; + for v in quant(n.min, false).into_iter().chain(quant(n.max, true)) { + trees.extend_from_slice(&v.to_le_bytes()); + } + trees.extend_from_slice(&(start as u16).to_le_bytes()); + trees.extend_from_slice(&(end as u16).to_le_bytes()); + } + put_vec3(&mut bvh, 0x20, g.min); + put_vec3(&mut bvh, 0x30, g.max); + put_vec3(&mut bvh, 0x40, bc); + put_vec3(&mut bvh, 0x50, std::array::from_fn(|k| 1.0 / bq[k])); + put_vec3(&mut bvh, 0x60, bq); + put_u32(&mut bvh, 0x08, g.nodes.len() as u32); + put_u32(&mut bvh, 0x0C, g.nodes.len() as u32); + put_u16(&mut bvh, 0x78, g.subtrees.len() as u16); + put_u16(&mut bvh, 0x7A, g.subtrees.len() as u16); + + put_bound_box(&mut bound, 0, g); + bound[0x70..0x80].fill(0); // no shrunk vertices + put_u32(&mut bound, 0x84, g.vertices.len() as u32); + put_vec3(&mut bound, 0x90, g.quantum); + put_vec3(&mut bound, 0xA0, g.centre); + bound[0xB8..0xD0].fill(0); // no vertex colours, octants + put_u32(&mut bound, 0xD0, g.vertices.len() as u32); + put_u32(&mut bound, 0xD4, g.polygons.len() as u32); + bound[0xF8..0x100].fill(0); // no material colours + bound[0x120] = g.materials.len() as u8; + bound[0x121] = 0; + + let pad = |mut v: Vec| { + v.resize(v.len().div_ceil(16).max(1) * 16, 0); + v + }; + let verts = b.add(Segment::System, pad(verts)); + let polys = b.add(Segment::System, pad(polys)); + let materials = b.add(Segment::System, pad(materials)); + let poly_materials = b.add(Segment::System, pad(poly_materials)); + let nodes = b.add(Segment::System, pad(nodes)); + let trees = b.add(Segment::System, pad(trees)); + let bvh = b.add(Segment::System, bvh); + b.pointer(bvh, 0x00, nodes, 0); + b.pointer(bvh, 0x70, trees, 0); + let bound = b.add(Segment::System, bound); + b.pointer(bound, 0x88, polys, 0); + b.pointer(bound, 0xB0, verts, 0); + b.pointer(bound, 0xF0, materials, 0); + b.pointer(bound, 0x118, poly_materials, 0); + b.pointer(bound, 0x130, bvh, 0); + bound +} + +/// Checks the hierarchy of the BVH bound at `at` as the game builds them +/// (see the module): leaves of at most four polygons covering all of them in +/// order, subtree sizes that add up, boxes around their polygons, and the +/// subtree headers. Run on the game's own files too, to check this reading. +pub fn check_bvh(res: &Resource, at: u64) -> Result<(), ResourceError> { + let bvh = res.u64(at + 0x130)?; + let polys = res.u32(at + 0xD4)? as usize; + let nodes_at = res.u64(bvh)?; + let count = res.u32(bvh + 8)? as usize; + let f = |o: u64| -> Result<[f32; 3], ResourceError> { + Ok([0, 4, 8].map(|k| f32::from_bits(res.u32(bvh + o + k).unwrap_or(0)))) + }; + let (centre, quantum) = (f(0x40)?, f(0x60)?); + let raw = res.bytes(nodes_at, count * 16)?; + let node = |i: usize| -> ([i16; 6], usize, usize) { + let b = &raw[i * 16..i * 16 + 16]; + let s = |k: usize| i16::from_le_bytes([b[k], b[k + 1]]); + ([s(0), s(2), s(4), s(6), s(8), s(10)], s(12) as u16 as usize, s(14) as u16 as usize) + }; + // Sizes and leaf order, depth first. + let mut next = 0usize; + let mut stack = vec![(0usize, count)]; + while let Some((i, end)) = stack.pop() { + if i >= end || i >= count { + return Err(bad(format!("node {i} lies outside its parent"))); + } + let (_, item, n) = node(i); + if n > 0 { + if n > LEAF_ITEMS || item != next || end != i + 1 { + return Err(bad(format!("leaf {i}: polygons {item}+{n}, expected {next}, in a subtree to {end}"))); + } + next += n; + continue; + } + if i + item != end || item < 3 { + return Err(bad(format!("node {i}: subtree of {item} nodes, its place ends at {end}"))); + } + let (_, litem, ln) = node(i + 1); + let left = if ln > 0 { 1 } else { litem }; + // Right first on the stack, so the left is checked first. + stack.push((i + 1 + left, end)); + stack.push((i + 1, i + 1 + left)); + } + if next != polys { + return Err(bad(format!("leaves cover {next} of {polys} polygons"))); + } + // Leaf boxes around their polygons' vertices. + let verts_at = res.u64(at + 0xB0)?; + let vq = [0, 4, 8].map(|k| f32::from_bits(res.u32(at + 0x90 + k).unwrap_or(0))); + let vc = [0, 4, 8].map(|k| f32::from_bits(res.u32(at + 0xA0 + k).unwrap_or(0))); + let polys_at = res.u64(at + 0x88)?; + for i in 0..count { + let (q, item, n) = node(i); + if n == 0 { + continue; + } + let lo: [f32; 3] = std::array::from_fn(|k| q[k] as f32 * quantum[k] + centre[k]); + let hi: [f32; 3] = std::array::from_fn(|k| q[k + 3] as f32 * quantum[k] + centre[k]); + for p in item..item + n { + let b = res.bytes(polys_at + p as u64 * 16, 16)?; + if b[0] & 7 != 0 { + continue; // boxes and spheres reach out by a radius + } + for o in [4, 6, 8] { + let v = u16::from_le_bytes([b[o], b[o + 1]]) & 0x7FFF; + let c = res.bytes(verts_at + v as u64 * 6, 6)?; + for k in 0..3 { + let x = i16::from_le_bytes([c[k * 2], c[k * 2 + 1]]) as f32 * vq[k] + vc[k]; + let slack = quantum[k] * 2.0 + 1e-3; + if x < lo[k] - slack || x > hi[k] + slack { + return Err(bad(format!("polygon {p} lies outside leaf {i}"))); + } + } + } + } + } + // Subtree headers: Bullet's rule. + let mut want = Vec::new(); + fn headers(node: &dyn Fn(usize) -> ([i16; 6], usize, usize), i: usize, out: &mut Vec<(usize, usize)>) -> usize { + let (_, item, n) = node(i); + if n > 0 { + return 1; + } + let l = headers(node, i + 1, out); + let r = headers(node, i + 1 + l, out); + if item > SUBTREE_NODES { + for (c, size) in [(i + 1, l), (i + 1 + l, r)] { + if size <= SUBTREE_NODES { + out.push((c, c + size)); + } + } + } + item + } + let total = headers(&node, 0, &mut want); + if total <= SUBTREE_NODES { + want = vec![(0, total)]; + } + let trees_at = res.u64(bvh + 0x70)?; + let trees = res.u16(bvh + 0x78)? as usize; + let got: Vec<(usize, usize)> = (0..trees) + .map(|t| { + let b = res.bytes(trees_at + t as u64 * 16, 16)?; + Ok((u16::from_le_bytes([b[12], b[13]]) as usize, u16::from_le_bytes([b[14], b[15]]) as usize)) + }) + .collect::>()?; + if got != want { + return Err(bad(format!("{} subtree headers, expected {}", got.len(), want.len()))); + } + Ok(()) +} + +/// Every BVH bound below `at`, for [`check_bvh`]. +pub fn bvh_bounds(res: &Resource, at: u64) -> Vec { + let mut out = Vec::new(); + let mut stack = vec![(at, 0)]; + while let Some((b, depth)) = stack.pop() { + match res.u8(b + 0x10) { + Ok(kind::BVH) => out.push(b), + Ok(kind::COMPOSITE) if depth < 4 => { + let (Ok(children), Ok(n)) = (res.u64(b + 0x70), res.u16(b + 0xA0)) else { continue }; + for i in 0..n as u64 { + if let Ok(c) = res.u64(children + i * 8) + && (SYS..GFX).contains(&c) + { + stack.push((c, depth + 1)); + } + } + } + _ => {} + } + } + out +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn builds_hierarchies_the_game_way() { + // A grid of 40 × 40 squares (3200 triangles). + let n = 40; + let mut mesh = CollisionMesh::default(); + for y in 0..=n { + for x in 0..=n { + mesh.positions.push([x as f32, y as f32, ((x * y) % 7) as f32 * 0.1]); + } + } + for y in 0..n { + for x in 0..n { + let i = (y * (n + 1) + x) as u32; + let w = n as u32 + 1; + mesh.indices.extend([i, i + 1, i + w + 1, i, i + w + 1, i + w]); + mesh.materials.extend([Some((x % 3) as u8), Some(9)]); + } + } + let g = build_geometry(&mesh, 0).unwrap(); + assert_eq!(g.polygons.len(), 3200); + assert_eq!(g.vertices.len(), 41 * 41, "shared corners once"); + assert_eq!(g.materials.len(), 4); + // Inside triangles have three neighbours, sharing the edge. + let inner = g.polygons.iter().filter(|p| p.2.iter().all(|&e| e >= 0)).count(); + assert!(inner > 3000, "{inner}"); + for (i, p) in g.polygons.iter().enumerate() { + for k in 0..3 { + if p.2[k] >= 0 { + let q = &g.polygons[p.2[k] as usize]; + assert!(q.0.contains(&p.0[k]) && q.0.contains(&p.0[(k + 1) % 3]), "edge {k} of {i}"); + } + } + } + // Leaves cover the polygons in order; sizes add up. + let mut next = 0; + for n in &g.nodes { + if n.count > 0 { + assert_eq!(n.item, next); + assert!(n.count <= LEAF_ITEMS); + next += n.count; + } + } + assert_eq!(next, 3200); + assert_eq!(g.nodes[0].item, g.nodes.len()); + assert!(g.subtrees.iter().all(|&(a, b)| b - a <= SUBTREE_NODES)); + assert!(!g.subtrees.is_empty()); + let too_many = + CollisionMesh { positions: vec![[0.0; 3]; 3], indices: [0, 1, 2].repeat(40000), ..Default::default() }; + assert!(build_geometry(&too_many, 0).is_err()); + } +} diff --git a/crates/rage-formats/src/ydr_write.rs b/crates/rage-formats/src/ydr_write.rs index ca4edea..b6ac4bf 100644 --- a/crates/rage-formats/src/ydr_write.rs +++ b/crates/rage-formats/src/ydr_write.rs @@ -192,6 +192,17 @@ pub struct NewMesh { /// for templates whose meshes are skinned (vehicles); empty: the first /// bone. Ignored for templates with fixed meshes. pub bones: Vec, + /// Per vertex, up to four bones it is blended between (peds, clothing), + /// or empty (then `bones`). Ignored for templates with fixed meshes. + pub blend: Vec, +} + +/// A vertex blended between up to four bones of the skeleton (indices into +/// it), with their weights (summing to 1; unused bones get 0). +#[derive(Debug, Clone, Copy, PartialEq, Default)] +pub struct Blend { + pub bones: [u16; 4], + pub weights: [f32; 4], } fn bad(msg: impl Into) -> ResourceError { @@ -265,12 +276,129 @@ fn read_layout(res: &Resource, decl: u64, stride: usize) -> Result Vec { + let Ok(children) = child_drawables(template) else { return Vec::new() }; + let Ok(main) = drawable_root(template) else { return Vec::new() }; + let skeleton = crate::drawable::read_drawable(template, main, true).ok().and_then(|d| d.skeleton); + let world = skeleton.as_ref().map(|s| s.world_transforms()).unwrap_or_default(); + children + .into_iter() + .map(|(_, tag)| { + let bone = skeleton.as_ref().and_then(|s| s.find_tag(tag)); + ChildModel { + bone: bone + .and_then(|k| skeleton.as_ref().map(|s| s.bones[k].name.clone())) + .unwrap_or_else(|| format!("part_{tag:04x}")), + transform: bone.and_then(|k| world.get(k).copied()).unwrap_or(crate::math::IDENTITY), + } + }) + .collect() +} + +/// (drawable, bone tag) of every fragment child with a model, each drawable once. +fn child_drawables(res: &Resource) -> Result, ResourceError> { + if res.version != VERSION_YFT_ENHANCED { + return Ok(Vec::new()); + } + let group = res.u64(SYS + 0xF0)?; + if group == 0 { + return Ok(Vec::new()); + } + let Some(lod) = (0..3).map(|i| res.u64(group + 0x10 + i * 8)).find_map(|p| p.ok().filter(|&p| p != 0)) else { + return Ok(Vec::new()); + }; + let list = res.u64(lod + 0xD0)?; + let mut out: Vec<(u64, u16)> = Vec::new(); + for i in 0..res.u8(lod + 0x11E)? as u64 { + let child = res.u64(list + i * 8)?; + if child == 0 { + continue; + } + let drawable = res.u64(child + 0xA0)?; + if drawable != 0 && res.u64(drawable + 0x50)? != 0 && !out.iter().any(|(d, _)| *d == drawable) { + out.push((drawable, res.u16(child + 0x12)?)); + } + } + Ok(out) +} + +/// The drawables of a `.ydd`: (name hash, drawable). +fn entries(res: &Resource) -> Result, ResourceError> { + let hashes = res.u64(SYS + 0x20)?; + let list = res.u64(SYS + 0x30)?; + let count = res.u16(SYS + 0x38)? as u64; + if list == 0 || count > 4096 { + return Err(bad("not a drawable dictionary")); + } + (0..count) + .map(|i| { + let d = res.u64(list + i * 8)?; + if !(SYS..GFX).contains(&d) { + return Err(bad("the dictionary has a drawable outside system memory")); + } + Ok((if hashes != 0 { res.u32(hashes + i * 4)? } else { 0 }, d)) + }) + .collect() +} + +/// The name hashes of a `.ydd`'s drawables, in order ([`Place::Entry`]). +pub fn entry_hashes(template: &Resource) -> Result, ResourceError> { + check_template(template)?; + Ok(entries(template)?.into_iter().map(|(h, _)| h).collect()) +} + +/// The drawable structure of a place. +fn drawable_at(res: &Resource, place: Place) -> Result { + match place { + Place::Main => drawable_root(res), + Place::Child(i) => child_drawables(res)? + .get(i) + .map(|(d, _)| *d) + .ok_or_else(|| bad(format!("the fragment has no child model {i}"))), + Place::Entry(i) => { + entries(res)?.get(i).map(|(_, d)| *d).ok_or_else(|| bad(format!("the dictionary has no drawable {i}"))) + } + } +} + +/// The shader group a place's meshes use: a fragment child's is the main +/// drawable's. +fn group_at(res: &Resource, place: Place) -> Result { + let owner = if matches!(place, Place::Child(_)) { drawable_root(res)? } else { drawable_at(res, place)? }; + res.u64(owner + 0x10) +} + /// The template's geometries, one per shader index (the first found). /// Fixed (unskinned) geometries when the template has any; otherwise the /// skinned ones (vehicles: the whole body is one skinned model, every vertex /// moving with one bone). -fn template_geometries(res: &Resource) -> Result, ResourceError> { - let root = drawable_root(res)?; +fn template_geometries(res: &Resource, root: u64) -> Result, ResourceError> { let mut fixed: Vec<(u16, TemplateGeometry)> = Vec::new(); let mut skinned: Vec<(u16, TemplateGeometry)> = Vec::new(); for lod in 0..4 { @@ -327,8 +455,15 @@ fn template_geometries(res: &Resource) -> Result, R /// The shader indices of the template that meshes can use. pub fn usable_shaders(template: &Resource) -> Result, ResourceError> { + usable_shaders_at(template, Place::Main) +} + +/// The shader indices meshes at `place` can use (a fragment child's are +/// indices into the main drawable's shaders). +pub fn usable_shaders_at(template: &Resource, place: Place) -> Result, ResourceError> { check_template(template)?; - let mut s: Vec = template_geometries(template)?.into_iter().map(|(s, _)| s).collect(); + let mut s: Vec = + template_geometries(template, drawable_at(template, place)?)?.into_iter().map(|(s, _)| s).collect(); s.sort_unstable(); Ok(s) } @@ -347,13 +482,23 @@ pub struct ShaderInfo { /// The shaders meshes can use ([`usable_shaders`]), with their colour /// texture and whether a material's texture can be bound to a copy. pub fn shader_infos(template: &Resource) -> Result, ResourceError> { - let usable = usable_shaders(template)?; - let drawable = if template.version == VERSION_YFT_ENHANCED { - crate::drawable::parse_yft(template)? + shader_infos_at(template, Place::Main) +} + +/// Like [`shader_infos`], for the meshes at `place`. +pub fn shader_infos_at(template: &Resource, place: Place) -> Result, ResourceError> { + let usable = usable_shaders_at(template, place)?; + let group = group_at(template, place)?; + let shaders = if group != 0 { + crate::drawable::read_drawable( + template, + if matches!(place, Place::Child(_)) { drawable_root(template)? } else { drawable_at(template, place)? }, + true, + )? + .shaders } else { - crate::drawable::parse_ydr(template)? + Vec::new() }; - let group = template.u64(drawable_root(template)? + 0x10)?; let list = if group != 0 { template.u64(group + 0x10)? } else { 0 }; let mut out = Vec::new(); for index in usable { @@ -364,7 +509,7 @@ pub fn shader_infos(template: &Resource) -> Result, ResourceErro .u64(ptr + 0x10) .is_ok_and(|refs| refs != 0 && template.u64(refs + slot as u64 * 8).is_ok_and(|r| r != 0)) }); - let texture = drawable.shaders.get(index as usize).and_then(|s| s.base_texture()).map(str::to_owned); + let texture = shaders.get(index as usize).and_then(|s| s.base_texture()).map(str::to_owned); out.push(ShaderInfo { index, texture, takes_texture }); } Ok(out) @@ -375,13 +520,21 @@ pub fn shader_infos(template: &Resource) -> Result, ResourceErro /// for templates with fixed meshes. pub fn skinned_bones(template: &Resource) -> Result>, ResourceError> { check_template(template)?; - if !template_geometries(template)?.iter().any(|(_, t)| t.bones.is_some()) { + let root = drawable_root(template)?; + if !template_geometries(template, root)?.iter().any(|(_, t)| t.bones.is_some()) { return Ok(None); } - let d = crate::drawable::read_drawable(template, drawable_root(template)?, true)?; + let d = crate::drawable::read_drawable(template, root, true)?; Ok(d.skeleton.map(|s| s.bones.into_iter().map(|b| b.name).collect())) } +/// Whether the meshes at `place` are skinned: their vertices carry bones +/// ([`NewMesh::bones`], [`NewMesh::blend`]). +pub fn is_skinned_at(template: &Resource, place: Place) -> Result { + check_template(template)?; + Ok(template_geometries(template, drawable_at(template, place)?)?.iter().any(|(_, t)| t.bones.is_some())) +} + /// The bones of a fragment that have a model of their own (vehicle wheels, /// drawn by the fragment's children); empty for drawables. Meshes put on /// them would be drawn twice. @@ -442,6 +595,13 @@ pub fn bones_with_own_models(template: &Resource) -> Vec { out } +/// Reads the drawable at `place` of an Enhanced resource (a fragment +/// child's meshes in the space of its bone, without shaders of its own). +pub fn read_at(res: &Resource, place: Place) -> Result { + check_template(res)?; + crate::drawable::read_drawable(res, drawable_at(res, place)?, true) +} + /// Reads a written file back as the game would: a `.ydr`'s drawable or a /// `.yft`'s main drawable. pub fn read_back(file: &[u8]) -> Result { @@ -591,9 +751,14 @@ fn encode(format: u8, v: [f32; 4], out: &mut [u8]) { } /// The vertices of a mesh in a template layout. -/// `blend`: per vertex, the index into the template geometry's bone table -/// (skinned templates). -fn vertex_data(m: &NewMesh, layout: &Layout, stride: usize, blend: &[u8]) -> Result, ResourceError> { +/// `blend`: per vertex, the blend weights and indices into the geometry's +/// bone table (skinned templates). +fn vertex_data( + m: &NewMesh, + layout: &Layout, + stride: usize, + blend: &[([f32; 4], [u8; 4])], +) -> Result, ResourceError> { let n = m.positions.len(); let normals = if m.normals.len() == n { m.normals.clone() } else { smooth_normals(m) }; let needs_tangents = layout.slots.iter().any(|&(s, _, _)| (8..12).contains(&s)); @@ -609,11 +774,9 @@ fn vertex_data(m: &NewMesh, layout: &Layout, stride: usize, blend: &[u8]) -> Res 0..=3 => [p[0], p[1], p[2], 1.0], 4..=7 => [nv[0], nv[1], nv[2], 0.0], 8..=11 => tangents[i], - // One bone per vertex, with all the weight. The game keeps the - // first blend weight and index in the third byte. - 16..=19 => [0.0, 0.0, 1.0, 0.0], - 20..=23 => match blend.get(i) { - Some(&b) => [0.0, 0.0, f32::from(b), 0.0], + 16..=23 => match blend.get(i) { + Some((w, _)) if slot < 20 => *w, + Some((_, b)) => b.map(f32::from), None => return Err(bad("the template's vertices carry bone weights (skinned)")), }, 24 => m.colors.get(i).copied().unwrap_or([1.0; 4]), @@ -664,7 +827,7 @@ fn put_box(d: &mut [u8], at: usize, (min, max): ([f32; 3], [f32; 3])) { /// `.ydr`, read with [`Resource`]). Every mesh uses one of the template's /// shaders ([`usable_shaders`]); the result has one detail level. pub fn replace_meshes(template: &Resource, meshes: &[NewMesh]) -> Result, ResourceError> { - build(template, &[meshes], None, None) + build(template, &[Part { place: Place::Main, lods: &[meshes], materials: None }], None) } /// Like [`replace_meshes`], but every mesh's `shader` is an index into @@ -678,7 +841,7 @@ pub fn replace_with_materials( materials: &[NewMaterial], donor: Option<&Resource>, ) -> Result, ResourceError> { - build(template, &[meshes], Some(materials), donor) + build(template, &[Part { place: Place::Main, lods: &[meshes], materials: Some(materials) }], donor) } /// Like [`replace_with_materials`] (or [`replace_meshes`] without @@ -692,7 +855,26 @@ pub fn replace_lods( materials: Option<&[NewMaterial]>, donor: Option<&Resource>, ) -> Result, ResourceError> { - build(template, lods, materials, donor) + build(template, &[Part { place: Place::Main, lods, materials }], donor) +} + +/// New meshes for one place of the template ([`replace_parts`]). +#[derive(Debug, Clone, Copy)] +pub struct Part<'a> { + pub place: Place, + /// One to four detail levels, as in [`replace_lods`]. + pub lods: &'a [&'a [NewMesh]], + /// With materials, every mesh's `shader` is an index into them (see + /// [`replace_with_materials`]); without, a template shader index. + pub materials: Option<&'a [NewMaterial]>, +} + +/// Like [`replace_lods`] for several places of one file at once: a vehicle's +/// body and its wheel ([`Place::Child`]), drawables of a `.ydd` +/// ([`Place::Entry`]). Places not given keep their meshes; each place at +/// most once. +pub fn replace_parts(template: &Resource, parts: &[Part], donor: Option<&Resource>) -> Result, ResourceError> { + build(template, parts, donor) } /// Whether `res` (an Enhanced drawable, fragment or texture dictionary) has a texture @@ -712,49 +894,93 @@ fn texture_templates(res: &Resource) -> Option<(Vec, Vec)> { } else { return None; }; + texture_templates_in(res, root) +} + +/// The first texture structure and the root of the embedded dictionary at `root`. +fn texture_templates_in(res: &Resource, root: u64) -> Option<(Vec, Vec)> { let count = res.u16(root + 0x38).ok()?; if count == 0 { return None; } - let first = res.u64(res.u64(root + 0x30).ok()?).ok()?; - let texture = res.bytes(first, DictLayout::Enhanced.texture_size()).ok()?.to_vec(); + // The first texture there is (some dictionaries list empty entries). + let list = res.u64(root + 0x30).ok()?; + let texture = (0..count as u64) + .filter_map(|i| res.u64(list + i * 8).ok().filter(|&t| (SYS..GFX).contains(&t))) + .find_map(|t| res.bytes(t, DictLayout::Enhanced.texture_size()).ok())? + .to_vec(); let root = res.bytes(root, DICTIONARY_ROOT_SIZE).ok()?.to_vec(); Some((root, texture)) } -fn build( - template: &Resource, - lods: &[&[NewMesh]], - materials: Option<&[NewMaterial]>, - donor: Option<&Resource>, -) -> Result, ResourceError> { - check_template(template)?; +/// A part, checked and with what writing it needs. +struct Prepared<'a> { + part: &'a Part<'a>, + root: u64, + geometries: Vec<(u16, TemplateGeometry)>, + /// The shader group its meshes use, and where its material copies start in it. + group: u64, + first_material: u16, + /// Keeps its levels as a fragment does (main drawable of a `.yft`, a child). + fragment: bool, +} + +impl Prepared<'_> { + /// The template shader a mesh is drawn with (its vertex layout). + fn source(&self, m: &NewMesh) -> u16 { + match self.part.materials { + Some(mats) => mats[m.shader as usize].shader, + None => m.shader, + } + } + + fn template_of(&self, m: &NewMesh) -> &TemplateGeometry { + let s = self.source(m); + &self.geometries.iter().find(|(x, _)| *x == s).expect("checked").1 + } + + /// The shader index the mesh gets in the file. + fn output_shader(&self, m: &NewMesh) -> u16 { + if self.part.materials.is_some() { self.first_material + m.shader } else { m.shader } + } +} + +fn check_part(template: &Resource, part: &Part) -> Result<(u64, Vec<(u16, TemplateGeometry)>), ResourceError> { + let lods = part.lods; + let at = |what: String| match part.place { + Place::Main => what, + Place::Child(i) => format!("child model {i}: {what}"), + Place::Entry(i) => format!("drawable {i}: {what}"), + }; if lods.is_empty() || lods.len() > 4 || lods.iter().any(|l| l.is_empty()) { - return Err(bad("give one to four detail levels, each with meshes")); + return Err(bad(at("give one to four detail levels, each with meshes".into()))); } - let geometries = template_geometries(template)?; + let root = drawable_at(template, part.place)?; + let geometries = template_geometries(template, root)?; let usable: Vec = geometries.iter().map(|(s, _)| *s).collect(); - if let Some(mats) = materials { + if let Some(mats) = part.materials { for (k, mat) in mats.iter().enumerate() { if !usable.contains(&mat.shader) { - return Err(bad(format!("material {k} uses shader {}, the template only has {usable:?}", mat.shader))); + return Err(bad(at(format!( + "material {k} uses shader {}, the template only has {usable:?}", + mat.shader + )))); } } } - // The template shader each mesh is drawn with (its vertex layout). let source = |m: &NewMesh| -> Option { - match materials { + match part.materials { Some(mats) => mats.get(m.shader as usize).map(|mat| mat.shader), None => Some(m.shader), } }; for (level, meshes) in lods.iter().enumerate() { for (i, m) in meshes.iter().enumerate() { - let what = format!("level {level}, mesh {i}"); + let what = at(format!("level {level}, mesh {i}")); let n = m.positions.len(); match source(m) { Some(s) if usable.contains(&s) => {} - _ if materials.is_some() => { + _ if part.materials.is_some() => { return Err(bad(format!("{what} uses material {}, which does not exist", m.shader))); } _ => return Err(bad(format!("{what} uses shader {}, the template only has {usable:?}", m.shader))), @@ -772,6 +998,7 @@ fn build( || (!m.uvs.is_empty() && m.uvs.len() != n) || (!m.colors.is_empty() && m.colors.len() != n) || (!m.bones.is_empty() && m.bones.len() != n) + || (!m.blend.is_empty() && m.blend.len() != n) { return Err(bad(format!("{what} has per-vertex data of the wrong length"))); } @@ -780,7 +1007,43 @@ fn build( } } } - let template_of = |shader: u16| &geometries.iter().find(|(s, _)| *s == shader).expect("checked").1; + Ok((root, geometries)) +} + +fn build(template: &Resource, parts: &[Part], donor: Option<&Resource>) -> Result, ResourceError> { + check_template(template)?; + if parts.is_empty() { + return Err(bad("nothing to write")); + } + for (i, p) in parts.iter().enumerate() { + if parts[..i].iter().any(|q| q.place == p.place) { + return Err(bad(format!("{:?} is given twice", p.place))); + } + } + // Material copies go to the end of each shader group, part after part. + let mut groups: Vec<(u64, Vec)> = Vec::new(); + let mut prepared = Vec::new(); + for part in parts { + let (root, geometries) = check_part(template, part)?; + let group = group_at(template, part.place)?; + let mut first_material = 0; + if let Some(mats) = part.materials { + if group == 0 { + return Err(bad("the template has no shader group")); + } + let k = match groups.iter().position(|(g, _)| *g == group) { + Some(k) => k, + None => { + groups.push((group, Vec::new())); + groups.len() - 1 + } + }; + first_material = template.u16(group + 0x18)? + groups[k].1.len() as u16; + groups[k].1.extend_from_slice(mats); + } + let fragment = template.version == VERSION_YFT_ENHANCED && !matches!(part.place, Place::Entry(_)); + prepared.push(Prepared { part, root, geometries, group, first_material, fragment }); + } let mut b = Builder::new(); // The template stays where it was: first block of each segment, offset 0. @@ -788,27 +1051,27 @@ fn build( if !template.graphics.is_empty() { b.add(Segment::Graphics, template.graphics.clone()); } + b.add_pages_info(sys, 0x08); + for (group, mats) in &groups { + add_materials(&mut b, sys, template, *group, mats, donor)?; + } + for p in &prepared { + debug_assert!(p.part.materials.is_none() || p.group != 0); + write_part(&mut b, sys, template, p)?; + } + b.build(template.version) +} + +/// Writes the levels of one part and points its drawable at them. +fn write_part(b: &mut Builder, sys: BlockId, template: &Resource, p: &Prepared) -> Result<(), ResourceError> { let copy = |addr: u64, len: usize| -> Result, ResourceError> { if !(SYS..GFX).contains(&addr) { return Err(bad("template structure outside system memory")); } Ok(template.bytes(addr, len)?.to_vec()) }; - b.add_pages_info(sys, 0x08); - - // Materials: one shader copy each (indices after the template's shaders). - // The drawable: the file's root, or a fragment's main drawable. - let root_addr = drawable_root(template)?; - let fragment = root_addr != SYS; - let group = template.u64(root_addr + 0x10)?; - let first_new = if group != 0 { template.u16(group + 0x18)? } else { 0 }; - if let Some(mats) = materials { - if group == 0 { - return Err(bad("the template has no shader group")); - } - add_materials(&mut b, sys, template, group, mats, donor)?; - } - let output_shader = |m: &NewMesh| if materials.is_some() { first_new + m.shader } else { m.shader }; + let lods = p.part.lods; + let root_addr = p.root; // The template's detail levels: model list, distance, render mask. let mut levels = Vec::new(); @@ -827,10 +1090,10 @@ fn build( let mut geometry_blocks: Vec = Vec::new(); let mut boxes = Vec::new(); for m in meshes.iter() { - let t = template_of(source(m).expect("checked")); - let blend = match &t.bones { - Some(table) => blend_indices(m, table)?, - None => Vec::new(), + let t = p.template_of(m); + let (blend, table) = match &t.bones { + Some(table) => blend_of(m, table)?, + None => (Vec::new(), None), }; let data = vertex_data(m, &t.layout, t.stride, &blend)?; let vdata = b.add(Segment::System, data); @@ -861,10 +1124,19 @@ fn build( put_u32(&mut g, 0x5C, (m.indices.len() / 3) as u32); put_u16(&mut g, 0x60, m.positions.len() as u16); put_u16(&mut g, 0x70, t.stride as u16); + if let Some(table) = &table { + put_u16(&mut g, 0x72, table.len() as u16); + } let g = b.add(Segment::System, g); b.pointer(g, 0x18, vb, 0); b.pointer(g, 0x38, ib, 0); b.pointer(g, 0x78, vdata, 0); + if let Some(table) = table { + let mut bytes: Vec = table.iter().flat_map(|k| k.to_le_bytes()).collect(); + bytes.resize(bytes.len().div_ceil(16) * 16, 0); + let table = b.add(Segment::System, bytes); + b.pointer(g, 0x68, table, 0); + } geometry_blocks.push(g); boxes.push(bounds(m.positions.iter())); } @@ -873,16 +1145,16 @@ fn build( // The model: the template's at this level (its flags), else the one // the first mesh's template geometry belongs to. + let first = p.template_of(&meshes[0]); let source_model = match levels.get(level) { Some(&(model, _, _)) if model != 0 => model, - _ => template_of(source(&meshes[0]).expect("checked")).model, + _ => first.model, }; let mut model = copy(source_model, MODEL_SIZE)?; // A model whose skinning differs from the geometries' (a skinned // level model with fixed geometries): the geometries' own model. - let skinned = template_of(source(&meshes[0]).expect("checked")).bones.is_some(); - if (template.u32(source_model + 0x28)? >> 8 & 0xFF != 0) != skinned { - model = copy(template_of(source(&meshes[0]).expect("checked")).model, MODEL_SIZE)?; + if (template.u32(source_model + 0x28)? >> 8 & 0xFF != 0) != first.bones.is_some() { + model = copy(first.model, MODEL_SIZE)?; } put_u16(&mut model, 0x10, n as u16); put_u16(&mut model, 0x12, n as u16); @@ -901,7 +1173,7 @@ fn build( let aabbs = b.add(Segment::System, aabbs); let mut shader_indices = vec![0u8; (2 * n).div_ceil(16) * 16]; for (i, m) in meshes.iter().enumerate() { - put_u16(&mut shader_indices, i * 2, output_shader(m)); + put_u16(&mut shader_indices, i * 2, p.output_shader(m)); } let shader_indices = b.add(Segment::System, shader_indices); let model = b.add(Segment::System, model); @@ -940,10 +1212,7 @@ fn build( .map(|p| dot(sub(*p, centre), sub(*p, centre)).sqrt()) .fold(0.0f32, f32::max); let root = (root_addr - SYS) as usize; - // A fragment keeps its levels: vehicles choose them by distance - // themselves (vehicles.meta), so every level the template has gets the - // furthest one given, and the distances and masks stay. - if fragment { + { let d = b.data_mut(sys); for (k, c) in centre.iter().enumerate() { put_f32(d, root + 0x20 + k * 4, *c); @@ -952,6 +1221,11 @@ fn build( } put_f32(d, root + 0x2C, radius); d[root + 0x50..root + 0x70].fill(0); + } + // A fragment keeps its levels: vehicles choose them by distance + // themselves (vehicles.meta), so every level the template has gets the + // furthest one given, and the distances and masks stay. + if p.fragment { let count = lists.len().max(template_levels); for k in 0..count { let list = lists[k.min(lists.len() - 1)]; @@ -960,17 +1234,10 @@ fn build( put_u32(b.data_mut(sys), root + 0x80 + k * 4, mask_of(0)); } } - return b.build(template.version); + return Ok(()); } { let d = b.data_mut(sys); - for (k, c) in centre.iter().enumerate() { - put_f32(d, root + 0x20 + k * 4, *c); - put_f32(d, root + 0x30 + k * 4, all.0[k]); - put_f32(d, root + 0x40 + k * 4, all.1[k]); - } - put_f32(d, root + 0x2C, radius); - d[root + 0x50..root + 0x70].fill(0); for (k, distance) in distances.iter().enumerate() { put_f32(d, root + 0x70 + k * 4, *distance); put_u32(d, root + 0x80 + k * 4, if k < lods.len() { mask_of(k) } else { 0 }); @@ -979,27 +1246,70 @@ fn build( for (k, list) in lists.into_iter().enumerate() { b.pointer(sys, root + 0x50 + k * 8, list, 0); } - b.build(template.version) + Ok(()) } -/// Per vertex, the index into a skinned template geometry's bone table of -/// the bone it moves with. -fn blend_indices(m: &NewMesh, table: &[u16]) -> Result, ResourceError> { - let first = table.first().copied().unwrap_or(0); - let mut cache: Vec<(u16, u8)> = Vec::new(); - (0..m.positions.len()) - .map(|i| { - let bone = m.bones.get(i).copied().unwrap_or(first); - if let Some(&(_, k)) = cache.iter().find(|(b, _)| *b == bone) { - return Ok(k); +/// Per vertex of a mesh at a skinned template geometry, its blend weights and +/// blend indices (into the geometry's bone table), and the bone table to +/// write when the template's lacks some of the bones (`None`: keep it). +/// Without [`NewMesh::blend`], every vertex has all its weight on its one +/// bone ([`NewMesh::bones`], else the table's first), in the third byte as +/// the game keeps it. +#[allow(clippy::type_complexity)] +fn blend_of( + m: &NewMesh, + template_table: &[u16], +) -> Result<(Vec<([f32; 4], [u8; 4])>, Option>), ResourceError> { + let first = template_table.first().copied().unwrap_or(0); + let blends: Vec = if m.blend.is_empty() { + (0..m.positions.len()) + .map(|i| Blend { + bones: [0, 0, m.bones.get(i).copied().unwrap_or(first), 0], + weights: [0.0, 0.0, 1.0, 0.0], + }) + .collect() + } else { + m.blend.clone() + }; + // Bones the vertices need; the template's table when it has them all. + // Unused slots (no weight) of a single-bone vertex point at a bone of the table. + let mut needed: Vec = Vec::new(); + for bl in &blends { + for (k, &bone) in bl.bones.iter().enumerate() { + if (bl.weights[k] > 0.0 || !m.blend.is_empty()) && !needed.contains(&bone) { + needed.push(bone); } - let k = table.iter().position(|&b| b == bone).and_then(|k| u8::try_from(k).ok()).ok_or_else(|| { - bad(format!("bone {bone} cannot be used: the template's geometry does not move with it")) - })?; - cache.push((bone, k)); - Ok(k) - }) - .collect() + } + } + let table: Option> = if needed.iter().all(|b| template_table.contains(b)) { + None + } else { + if needed.len() > 255 { + return Err(bad(format!("a mesh moves with {} bones; at most 255", needed.len()))); + } + Some(needed) + }; + let in_table: &[u16] = table.as_deref().unwrap_or(template_table); + let mut cache: Vec<(u16, u8)> = Vec::new(); + let mut index = |bone: u16| -> u8 { + if let Some(&(_, k)) = cache.iter().find(|(b, _)| *b == bone) { + return k; + } + let k = in_table.iter().position(|&b| b == bone).unwrap_or(0) as u8; + cache.push((bone, k)); + k + }; + let out = + blends + .iter() + .map(|bl| { + let idx: [u8; 4] = std::array::from_fn(|k| { + if bl.weights[k] > 0.0 || !m.blend.is_empty() { index(bl.bones[k]) } else { 0 } + }); + (bl.weights, idx) + }) + .collect(); + Ok((out, table)) } /// The colour texture slot of a template shader: its index into the texture @@ -1089,10 +1399,13 @@ fn add_textures( textures: Vec<(Texture, BlockId)>, donor: Option<&Resource>, ) -> Result<(), ResourceError> { - let (root_template, texture_template) = - texture_templates(template) - .or_else(|| donor.and_then(texture_templates)) - .ok_or_else(|| bad("no texture structure to copy: the model has no embedded textures (give a donor)"))?; + let own = template.u64(group + 0x08)?; + let (root_template, texture_template) = (own != 0) + .then(|| texture_templates_in(template, own)) + .flatten() + .or_else(|| texture_templates(template)) + .or_else(|| donor.and_then(texture_templates)) + .ok_or_else(|| bad("no texture structure to copy: the model has no embedded textures (give a donor)"))?; // (hash, existing pointer or new block) enum Entry { Old(u64), @@ -1306,6 +1619,7 @@ pub(crate) mod tests { colors: Vec::new(), indices: vec![0, 1, 2, 0, 2, 3], bones: Vec::new(), + blend: Vec::new(), } } diff --git a/plugins/examples/obj-tools/plugin.toml b/plugins/examples/obj-tools/plugin.toml index 00b3bc6..42ee279 100644 --- a/plugins/examples/obj-tools/plugin.toml +++ b/plugins/examples/obj-tools/plugin.toml @@ -3,7 +3,7 @@ id = "obj-tools" name = "OBJ tools" version = "0.1.0" api = "0.3" -description = "Shows Wavefront OBJ models in the 3D view, exports the game's models as OBJ with their textures (PNG) and replaces a model's meshes with an OBJ (GTA V Enhanced .ydr, and vehicle bodies .yft)." +description = "Shows Wavefront OBJ models in the 3D view, exports the game's models as OBJ with their textures (PNG) and replaces a model's meshes with an OBJ (GTA V Enhanced .ydr, vehicles and their parts .yft with their wheels, drawable dictionaries .ydd)." authors = ["OpenRAGE contributors"] license = "MIT OR Apache-2.0" homepage = "https://github.com/Two-Play/openrage" @@ -31,7 +31,7 @@ batch = true id = "replace" title = "Replace with OBJ…" kind = "modify" -extensions = ["ydr", "yft"] +extensions = ["ydr", "yft", "ydd"] # The OBJ, and optionally its .mtl and the PNG textures it names. pick = ["obj", "mtl", "png"] pick-title = "Choose the OBJ model (and its .mtl and PNG textures)" diff --git a/site/content/cli.md b/site/content/cli.md index 32742b3..c3925ff 100644 --- a/site/content/cli.md +++ b/site/content/cli.md @@ -117,7 +117,11 @@ openrage mkdir x64e.rpf/my_folder openrage replace-model x64i.rpf/…/prop_x.ydr model.obj --mods # new geometry for an Enhanced .ydr (preview) openrage replace-model x64i.rpf/…/prop_x.ydr model.obj --out new.ydr --shader 0 openrage replace-model x64i.rpf/…/prop_x.ydr hi.obj --lod med.obj --lod low.obj --mods # with detail levels -openrage replace-model x64e.rpf/levels/gta5/vehicles.rpf/adder.yft car.obj --mods # a vehicle body: parts named like bones move with them +openrage replace-model x64e.rpf/levels/gta5/vehicles.rpf/adder.yft car.obj --mods # a vehicle: parts named like bones move with them, `wheel_lf` replaces the wheel +openrage replace-model …/a_m_y_hipster_01.ydd ped.obj --mods # a dictionary: parts named after drawables (uppr_000_u) replace them +openrage replace-model …/a_m_y_hipster_01.ydd shirt.obj --drawable uppr_000_r --out new.ydd # the whole OBJ on one drawable +openrage replace-model …/prop_x.ydr model.obj --collision col.obj --mods # with a collision built from col.obj +openrage replace-model …/hei_ch3_12_0.ybn col.obj --out new.ybn # a collision file from an OBJ openrage oiv info mod.oiv # what a package would change openrage oiv install mod.oiv # install into the mods folder openrage oiv list / oiv uninstall "Name 1.0" [-y] # installed packages, uninstall @@ -172,7 +176,8 @@ openrage licenses --all # every license text openrage verify # decode every entry of every archive openrage verify --textures [--rebuild] # decode (and rebuild) every texture dictionary openrage verify --models # parse every model of the game -openrage verify --models --rebuild # write every Enhanced .ydr anew with its meshes, read back identical +openrage verify --models --rebuild # write every Enhanced .ydr, .yft (with wheels) and .ydd anew, read back identical +openrage verify --collisions --rebuild # write every Enhanced collision (.ybn, in .ydr) anew from its triangles openrage verify --audio # decode every sound of the game openrage verify --animations # parse every clip dictionary, evaluate all frames openrage verify --meta # convert every metadata file of the game diff --git a/site/content/modding.md b/site/content/modding.md index 1690141..1805634 100644 --- a/site/content/modding.md +++ b/site/content/modding.md @@ -68,12 +68,12 @@ other texture, mesh, shader and bone unchanged. GTA V Legacy uses the same struc ## Models (preview) -A drawable (`.ydr`) or a vehicle body (`.yft`) of GTA V Enhanced can get new geometry and textures from a Wavefront -OBJ file: +A drawable (`.ydr`), a vehicle with its wheels or one of its mod parts (`.yft`) and the drawables of a dictionary +(`.ydd`: peds, clothing) of GTA V Enhanced can get new geometry and textures from a Wavefront OBJ file: - **In the explorer:** turn on the *OBJ tools* plugin (it comes with OpenRAGE, **Settings → Plugins**), unlock - editing, right-click the `.ydr` or `.yft` → **Replace with OBJ…** and choose the OBJ together with its `.mtl` and PNG - textures. The change goes into the `mods` folder and is one entry in **History**. *OBJ tools* also exports models as + editing, right-click the `.ydr`, `.yft` or `.ydd` → **Replace with OBJ…** and choose the OBJ together with its + `.mtl` and PNG textures. The change goes into the `mods` folder and is one entry in **History**. *OBJ tools* also exports models as OBJ with their textures, so you can export, edit (e.g. in Blender) and bring them back. - **From the command line:** `openrage replace-model x64i.rpf/levels/gta5/props/…/prop_x.ydr model.obj --mods` (it finds the `.mtl` and textures next to the OBJ), or `openrage plugin run obj-tools replace .ydr --pick @@ -98,10 +98,20 @@ How it works: - OBJ is converted from Y-up to the game's Z-up; missing normals are computed, tangents always. Meshes over 65,535 vertices are split. `--mods` puts the result into the `mods` folder in place of the original (undo with **Undo** / `openrage undo`), `--out` writes the file elsewhere. -- Not yet: GTA V Legacy, `.ydd`, peds and other models blended between bones, and collisions (the original collision - stays). The written drawables and vehicles read back identically in OpenRAGE (`openrage verify --models --rebuild` - rewrites every `.ydr` and `.yft` of the game, also with shader copies and embedded textures); please report how - they behave in the game. +- **Collisions:** `--collision col.obj` builds a drawable's (`.ydr`) collision from an OBJ model instead of keeping + the original, and `replace-model …/x.ybn col.obj` replaces a collision file's. Every triangle goes into one + triangle mesh with a bounding volume hierarchy, built the way the game's own are (up to 32,767 triangles; vertices on a grid of 1/65,534 of the collision's size, + under a centimetre for a 600 m map collision). An OBJ + material named after a collision material of the game's `materials.dat` (`CONCRETE`, `WOOD_HIGH_DENSITY`, …, any + case) gets it; others get the original collision's first material. The new collision replaces all parts of the + original (also its boxes and spheres); it keeps its flags. Vehicles and other fragments (`.yft`) keep their + collision: theirs is split over the physics parts with their masses and joints. + `openrage verify --collisions --rebuild` writes every collision of the game anew from its own triangles and checks + the result, and first checks the game's own hierarchies against how OpenRAGE reads them. +- Not yet: GTA V Legacy. The written drawables, vehicles with their + wheels and dictionaries read back identically in OpenRAGE (`openrage verify --models --rebuild` rewrites every + `.ydr`, `.yft` with its wheel models and every drawable of every `.ydd` of the game, with all bone weights, also with + shader copies and embedded textures); please report how they behave in the game. ### Vehicles @@ -111,13 +121,31 @@ The import keeps that: - **Parts by name:** an OBJ object or group (`o`, `g`) named like a bone goes on that bone, e.g. `door_dside_f`, `door_pside_f`, `bonnet`, `boot`, `bumper_f`. Blender's `.001` and the numbers *OBJ tools* adds (`bonnet_6`) are ignored. Everything else goes on the body (`bodyshell`). `replace-model` lists which part went where. -- **Wheels** are models of their own: parts named after a wheel bone (`wheel_lf` …) are left out, and the original - wheels stay. +- **Wheels** are models of their own. A part named after the wheel bone that has the vehicle's wheel model (usually + `wheel_lf`) replaces that model: it is moved into the bone's space, and the game copies it to every wheel bone + (turned around on the right). Parts named after the other wheel bones (`wheel_rf`, `wheel_lr` …, which *OBJ tools* + exports as copies) are left out. A vehicle with a rear wheel model of its own (`wheel_lr`) gets that one replaced + the same way. The wheel's collision and the radius the game drives it with stay. - **Export, edit, import:** *OBJ tools* exports a vehicle with one object per bone, so an export can be edited in Blender and brought back with every door still opening. -- The skeleton, physics, damage, the wheels and the vehicle's detail levels stay; every level shows the new body. +- The skeleton, physics, damage and the vehicle's detail levels stay; every level shows the new body (and wheel). +- **Mod parts** (`sultan_hood_1.yft` in `sultan_mods.rpf`) are fragments of their own, in the space of the bone they + go on: import onto them like any `.yft`. They have no textures of their own, so the shared vehicle textures + (`vehshare.ytd`) lend the texture structure. - `openrage replace-model x64e.rpf/levels/gta5/vehicles.rpf/adder.yft car.obj --mods`. +### Peds and clothing + +- **Drawable dictionaries (`.ydd`):** parts named after a drawable (`uppr_000_u`, as *OBJ tools* exports them) + replace that drawable; the others keep theirs. `--drawable uppr_000_u` (name or index) puts the parts named after + none on that drawable. +- **Bone weights:** peds and clothing are blended between bones, but OBJ has no place for weights. Every new vertex + takes the bones and weights of the nearest vertex of the original drawable, so a changed shirt keeps moving with + the body where it lies close to the original; parts far from any original vertex follow the nearest one and can + look stiff. Exported and re-imported unchanged, every vertex keeps its weights (a vertex on a seam may take those + of the other side). +- `openrage replace-model …/a_m_y_hipster_01.ydd ped.obj --mods`. + ## Text files and game text - Text files open in the text editor. After unlocking, **Save** (Ctrl+S) writes them into `mods`, keeping encoding, diff --git a/site/content/plugins.md b/site/content/plugins.md index 662616d..198fa61 100644 --- a/site/content/plugins.md +++ b/site/content/plugins.md @@ -323,7 +323,7 @@ Y up (OBJ, glTF) need `(x, y, z) → (x, z, −y)` and `v → 1 − v` on the wa `name.mtl` and one PNG per texture. It only calls `load-model` and `load-texture`, so it works for every game OpenRAGE reads. - **Preview** of `.obj` files in the 3D view: the plugin returns a `model` view. -- **Replace with OBJ…** on a GTA V Enhanced `.ydr` or vehicle `.yft` (a `modify` action with `pick = ["obj"]`): reads the chosen OBJ, +- **Replace with OBJ…** on a GTA V Enhanced `.ydr`, `.yft` or `.ydd` (a `modify` action with `pick = ["obj"]`): reads the chosen OBJ, calls `build-model` with the drawable as the template and writes the result with `write-mod-file`. This is why it asks for `write-mods`. diff --git a/site/content/viewers.md b/site/content/viewers.md index f889419..67c4e9b 100644 --- a/site/content/viewers.md +++ b/site/content/viewers.md @@ -39,6 +39,10 @@ rotate, scroll to zoom. ### Complete models - **Vehicles** come with their wheels on every wheel bone and their liveries. +- **Vehicle mods** (tuning parts: bonnets, bumpers, spoilers, …) from the vehicle's `_mods.rpf` archives are + listed under **Parts** as *Mods: bonnet*, *Mods: spoiler* …, hidden at first, each on the bone the game's + `carcols` files put it on. Showing one does not hide the original part it replaces; hide that yourself. The parts + also open on their own (`sultan_hood_1.yft`). - **Peds** are put together from their components (head, hair, upper body, legs, accessories), the first variant of each. - **Textures** come from the model itself, the `.ytd` next to it (`adder.ytd`, `adder+hi.ytd`) and, for vehicles, `vehshare.ytd`. @@ -61,10 +65,6 @@ software fallback. **Export glTF…** writes a binary glTF 2.0 file (`.glb`) with one node per shown part and the textures embedded. Blender and most other 3D tools open it directly. -### Not yet - -Vehicle mods and tuning parts. - ## Animations Clip dictionaries (`.ycd`) show what they animate (peds, vehicles, objects) and a list of fitting models, ranked by the From 1c1b43db4628db8312313d3cb120721918bd1a91 Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 23:17:55 +0100 Subject: [PATCH 6/8] openFormats: export and import OpenIV's text formats (#142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * openFormats: export and import OpenIV's text formats - rage_formats::openformats: GTA V drawables, fragments, drawable dictionaries and texture dictionaries (Legacy and Enhanced) as .odr, .oft, .odd, .otd with .mesh, .skel, .otx and DDS, in the layout of OpenIV's own exports (a prop matches OpenIV's files line for line); reads them back - openrage_app::openformats: import onto the game file the files came from: meshes and detail levels through the model writer, embedded textures by name (new ydr_write::replace_embedded_textures), .otd onto .ytd; shaders, skeleton, physics and parts stay, and what differs there is reported - CLI: export-openformats, import-openformats (--out / --mods), verify --models --openformats (text round trip of every model and .ytd, Enhanced models imported back onto themselves) - Explorer: Export openFormats… and, in edit mode, Import openFormats… in the context menu (mods folder, undo) - Docs: viewers, modding, CLI, README plugins line Co-Authored-By: Claude Opus 5.5 * openFormats: fixes from the whole-game check - texture usage 0 and other codes without a name survive (.otx `UNKNOWN`, `USAGE_`) - texture file names keep every name apart and come back exactly (other characters as %xx), e.g. `font_?` and `font_!` - models on a rotated root bone stay in place when imported - half-float infinities in vertex data compare equal; broken embedded dictionaries export what can be read - DDS: arrays of 2D textures keep their size (DX10 array size) - verify --openformats lists failures by kind Co-Authored-By: Claude Opus 5.5 * Docs: openFormats whole-game check numbers Co-Authored-By: Claude Opus 5.5 * verify --openformats: files of one archive on every core Archives are still read in parallel; the work per file goes through a short queue to one worker per core, so one big archive (all vehicles are in one) no longer leaves the others idle: the vehicles take 64 s instead of 14 min. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- README.md | 2 +- crates/openrage-app/src/lib.rs | 1 + crates/openrage-app/src/openformats.rs | 465 +++++++++++++++ crates/openrage-cli/src/cli.rs | 31 + crates/openrage-cli/src/cmd/mod.rs | 2 + crates/openrage-cli/src/cmd/openformats.rs | 328 +++++++++++ crates/openrage-cli/src/main.rs | 5 + crates/openrage-gui/src/callbacks.rs | 11 + crates/openrage-gui/src/main.rs | 1 + crates/openrage-gui/src/navigate.rs | 6 + crates/openrage-gui/src/openformats_ui.rs | 80 +++ crates/openrage-gui/ui/app.slint | 15 + crates/rage-formats/src/dds.rs | 32 +- crates/rage-formats/src/lib.rs | 1 + .../rage-formats/src/openformats/compare.rs | 145 +++++ crates/rage-formats/src/openformats/mod.rs | 550 ++++++++++++++++++ crates/rage-formats/src/openformats/parse.rs | 300 ++++++++++ crates/rage-formats/src/openformats/read.rs | 425 ++++++++++++++ crates/rage-formats/src/openformats/tests.rs | 341 +++++++++++ crates/rage-formats/src/openformats/text.rs | 173 ++++++ crates/rage-formats/src/openformats/write.rs | 370 ++++++++++++ crates/rage-formats/src/ydr_write.rs | 26 + site/content/cli.md | 3 + site/content/modding.md | 36 ++ site/content/viewers.md | 8 + 25 files changed, 3352 insertions(+), 5 deletions(-) create mode 100644 crates/openrage-app/src/openformats.rs create mode 100644 crates/openrage-cli/src/cmd/openformats.rs create mode 100644 crates/openrage-gui/src/openformats_ui.rs create mode 100644 crates/rage-formats/src/openformats/compare.rs create mode 100644 crates/rage-formats/src/openformats/mod.rs create mode 100644 crates/rage-formats/src/openformats/parse.rs create mode 100644 crates/rage-formats/src/openformats/read.rs create mode 100644 crates/rage-formats/src/openformats/tests.rs create mode 100644 crates/rage-formats/src/openformats/text.rs create mode 100644 crates/rage-formats/src/openformats/write.rs diff --git a/README.md b/README.md index bb40d62..bbcceac 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ More screenshots and all features: **[two-play.github.io/openrage](https://two-p | **GTA VI** | 🔜 next: as fast as possible once it comes to PC | – | | **GTA IV** (Complete Edition) | ✅ read (IMG3, RPF2, RPF3), key from your own `GTAIV.exe` | ◐ textures · models · collisions · animations · text · scripts · maps in 3D · cutscenes (played with their cast, camera, subtitles and particle effects) · particle effect lists (`.wpfl`) · editing `.img`, `.rpf`, placement files, loose files and textures (`.wtd`, inside `.wdr`) (update folder, or the game files with originals kept) | -**Plugins** (API 0.3, preview): sandboxed WebAssembly plugins add file types, previews (text, tree, table, image, 3D model), tool windows of their own (Tools menu), export and batch actions with access to the game's models and textures, and changes to game files through the `mods` folder (with undo), for every game. ✅ explorer (file list, preview, context menu, Settings → Plugins) and command line (`openrage plugin`), four example plugins included (OBJ export and import, a number and hash converter among them) · plugin packages (`.orp`) with install/uninstall in the explorer and the CLI · models into game formats (`build-model`) · 🔜 openFormats. [Writing plugins](https://two-play.github.io/openrage/plugins/) +**Plugins** (API 0.3, preview): sandboxed WebAssembly plugins add file types, previews (text, tree, table, image, 3D model), tool windows of their own (Tools menu), export and batch actions with access to the game's models and textures, and changes to game files through the `mods` folder (with undo), for every game. ✅ explorer (file list, preview, context menu, Settings → Plugins) and command line (`openrage plugin`), four example plugins included (OBJ export and import, a number and hash converter among them) · plugin packages (`.orp`) with install/uninstall in the explorer and the CLI · models into game formats (`build-model`) · ✅ openFormats: OpenIV's text formats (`.odr`, `.oft`, `.odd`, `.otd` with `.mesh`, `.skel`, DDS) exported and imported back (preview). [Writing plugins](https://two-play.github.io/openrage/plugins/) ## Installation diff --git a/crates/openrage-app/src/lib.rs b/crates/openrage-app/src/lib.rs index 0c4b07d..d670f98 100644 --- a/crates/openrage-app/src/lib.rs +++ b/crates/openrage-app/src/lib.rs @@ -24,6 +24,7 @@ pub mod models; pub mod natives; pub mod obj; pub mod oiv; +pub mod openformats; pub mod palette; pub mod paths; pub mod plugins; diff --git a/crates/openrage-app/src/openformats.rs b/crates/openrage-app/src/openformats.rs new file mode 100644 index 0000000..018b02b --- /dev/null +++ b/crates/openrage-app/src/openformats.rs @@ -0,0 +1,465 @@ +//! OpenIV's openFormats for game files: exporting drawables, fragments, +//! drawable dictionaries and texture dictionaries as text files with DDS +//! textures, and importing them back onto the game file they came from. +//! +//! Importing fits the files onto the original (the template), like +//! replacing a model with an OBJ: the model keeps its shaders, skeleton, +//! physics and parts, and gets the meshes and detail levels of the files +//! (written by [`ydr_write`]) and their embedded textures. Texture +//! dictionaries get the textures of the `.otd`. What the writer cannot +//! change (shader parameters, the skeleton) is reported as a note when the +//! files differ from the game file there. + +use std::path::{Path, PathBuf}; + +use anyhow::{Context, Result, bail}; +use rage_formats::drawable::{Bone, Skeleton}; +use rage_formats::math; +use rage_formats::openformats::{self as of, ExportedFile, OfDrawable, OfGeometry, Source, component}; +use rage_formats::texture::Texture; +use rage_formats::ydr_write::{self, NewMesh}; +use rage_resource::{Resource, ResourceError}; + +/// The kinds of game files with an openFormats counterpart. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Kind { + /// `.ydr` ↔ `.odr` + Drawable, + /// `.yft` ↔ `.oft` + Fragment, + /// `.ydd` ↔ `.odd` + Dictionary, + /// `.ytd` ↔ `.otd` + Textures, +} + +impl Kind { + /// The kind of a game file, by its name. + pub fn of_game_file(name: &str) -> Option { + let ext = name.rsplit_once('.')?.1.to_ascii_lowercase(); + Some(match ext.as_str() { + "ydr" => Self::Drawable, + "yft" => Self::Fragment, + "ydd" => Self::Dictionary, + "ytd" => Self::Textures, + _ => return None, + }) + } + + /// The extension of the main openFormats file. + pub fn open_ext(self) -> &'static str { + match self { + Self::Drawable => "odr", + Self::Fragment => "oft", + Self::Dictionary => "odd", + Self::Textures => "otd", + } + } + + /// Whether openFormats files can be imported onto files of this kind. + pub fn can_import(self) -> bool { + self != Self::Dictionary + } +} + +fn stem(name: &str) -> &str { + let name = name.rsplit(['/', '\\']).next().unwrap_or(name); + name.rsplit_once('.').map_or(name, |(s, _)| s) +} + +/// The openFormats files of a game file (`name`: its file name). +pub fn export(res: &Resource, name: &str) -> Result> { + let kind = Kind::of_game_file(name).with_context(|| format!("{name} has no openFormats counterpart"))?; + let stem = stem(name); + Ok(match kind { + Kind::Drawable => of::export_odr(&of::read_ydr(res, stem)?), + Kind::Fragment => of::export_oft(&of::read_yft(res, stem)?), + Kind::Dictionary => of::export_odd(stem, &of::read_ydd(res)?), + Kind::Textures => of::export_otd(stem, &of::read_ytd(res)?), + }) +} + +/// Writes exported files into `dir`; returns the path of the main file +/// (the last one). +pub fn write_files(dir: &Path, files: &[ExportedFile]) -> Result { + let mut main = None; + for f in files { + let path = dir.join(&f.path); + if let Some(parent) = path.parent() { + std::fs::create_dir_all(parent).with_context(|| format!("creating {}", parent.display()))?; + } + std::fs::write(&path, &f.data).with_context(|| format!("writing {}", path.display()))?; + main = Some(path); + } + main.context("nothing to export") +} + +/// A game file made from openFormats files. +#[derive(Debug)] +pub struct Imported { + /// The new game file (RSC7); `None` when the files are the game file's. + pub file: Option>, + /// What was taken over and what was kept, for people. + pub notes: Vec, +} + +/// Options for [`import_with`]. +#[derive(Debug, Clone, Copy, Default)] +pub struct ImportOptions { + /// Write the meshes anew even when they are the game file's. + pub always_rebuild_meshes: bool, +} + +/// Imports the openFormats file at `main` onto the game file `template` +/// (read from an entry with these page flags; `name` its file name). +pub fn import(template: &Resource, flags: (u32, u32), name: &str, main: &Path) -> Result { + let dir = main.parent().unwrap_or(Path::new(".")).to_path_buf(); + let src = move |p: &str| -> Result, ResourceError> { + let path = dir.join(p); + std::fs::read(&path).map_err(|e| ResourceError::Format(format!("{}: {e}", path.display()))) + }; + let file = main.file_name().context("no file name")?.to_string_lossy().into_owned(); + import_with(template, flags, name, &src, &file, ImportOptions::default()) +} + +/// Like [`import`], reading the files through `src` (`main`: the path of the +/// main file for it). +pub fn import_with( + template: &Resource, + flags: (u32, u32), + name: &str, + src: Source, + main: &str, + options: ImportOptions, +) -> Result { + let kind = Kind::of_game_file(name).with_context(|| format!("{name} has no openFormats counterpart"))?; + let ext = main.rsplit_once('.').map(|(_, e)| e.to_ascii_lowercase()).unwrap_or_default(); + if ext != kind.open_ext() { + bail!("a .{} file goes onto a .{}, not onto {name}", ext, game_ext(&ext).unwrap_or("?")); + } + match kind { + Kind::Drawable => { + let d = of::parse_odr(src, main)?; + import_drawable(template, of::read_ydr(template, stem(name))?, &d, options, Vec::new()) + } + Kind::Fragment => { + let f = of::parse_oft(src, main)?; + let t = of::read_yft(template, stem(name))?; + let mut notes = Vec::new(); + if !t.children.is_empty() || !f.children.is_empty() { + notes.push(format!( + "the fragment's {} parts (wheels, …) and its physics are kept from the game file", + t.children.len() + )); + } + import_drawable(template, t.drawable, &f.drawable, options, notes) + } + Kind::Textures => import_textures(template, flags, &of::parse_otd(src, main)?), + Kind::Dictionary => bail!("drawable dictionaries (.ydd) cannot be imported yet, only exported"), + } +} + +/// The game file extension an openFormats extension belongs to. +pub fn game_ext(open_ext: &str) -> Option<&'static str> { + Some(match open_ext.to_ascii_lowercase().as_str() { + "odr" => "ydr", + "oft" => "yft", + "odd" => "ydd", + "otd" => "ytd", + _ => return None, + }) +} + +fn import_textures(template: &Resource, flags: (u32, u32), textures: &[of::OfTexture]) -> Result { + use rage_formats::ytd_write::{Edit, apply}; + let dict = rage_formats::ytd::parse(template)?; + let mut edits = Vec::new(); + let mut notes = Vec::new(); + for t in textures { + let mut t = t.texture.clone(); + match dict.textures.iter().find(|o| of::same_texture_name(&o.name, &t.name)) { + Some(old) if same_texture(old, &t) => continue, + Some(old) => t.name = old.name.clone(), + None => notes.push(format!("added {}", t.name)), + } + edits.push(Edit::Set(t)); + } + for old in &dict.textures { + if !textures.iter().any(|t| of::same_texture_name(&old.name, &t.texture.name)) { + notes.push(format!("removed {}", old.name)); + edits.push(Edit::Remove(old.name.clone())); + } + } + if edits.is_empty() { + return Ok(Imported { file: None, notes: vec!["the textures are the game file's".into()] }); + } + let changed = edits.len(); + let r = apply(template, flags.0, flags.1, &dict, &edits)?; + notes.insert(0, format!("{changed} texture change(s)")); + Ok(Imported { file: Some(r.file), notes }) +} + +fn same_texture(a: &Texture, b: &Texture) -> bool { + (a.width, a.height, a.depth, a.levels, a.format, a.dimension) + == (b.width, b.height, b.depth, b.levels, b.format, b.dimension) + && a.data == b.data +} + +fn skeleton(s: &of::OfSkeleton) -> Skeleton { + Skeleton { + bones: s + .bones + .iter() + .map(|b| Bone { + name: b.name.clone(), + tag: b.tag, + parent: b.parent, + translation: b.translation, + rotation: b.rotation, + scale: b.scale, + }) + .collect(), + } +} + +/// Whether two values read from text and from the game are the same (the +/// text keeps seven significant digits). +fn close(a: f32, b: f32) -> bool { + a == b || (a - b).abs() <= 1e-5 + 1e-5 * a.abs().max(b.abs()) || (a.is_nan() && b.is_nan()) +} + +fn same_geometry(a: &OfGeometry, b: &OfGeometry) -> bool { + a.shader == b.shader + && a.decl == b.decl + && a.indices == b.indices + && a.attributes.len() == b.attributes.len() + && a.attributes.iter().zip(&b.attributes).all(|((ka, va), (kb, vb))| { + ka == kb && va.len() == vb.len() && va.iter().flatten().zip(vb.iter().flatten()).all(|(x, y)| close(*x, *y)) + }) +} + +/// Whether the files' detail levels are the game file's. +fn same_meshes(a: &OfDrawable, b: &OfDrawable) -> bool { + a.lods.iter().zip(&b.lods).all(|(la, lb)| { + la.models.len() == lb.models.len() + && la.models.iter().zip(&lb.models).all(|(ma, mb)| { + ma.bone == mb.bone + && ma.geometries.len() == mb.geometries.len() + && ma.geometries.iter().zip(&mb.geometries).all(|(x, y)| same_geometry(x, y)) + }) + }) +} + +fn import_drawable( + template: &Resource, + tpl: OfDrawable, + d: &OfDrawable, + options: ImportOptions, + mut notes: Vec, +) -> Result { + // Shaders: the files' shader i is the game file's shader of that name, + // the same index when the names agree. + let mut shader_map = Vec::new(); + for (i, s) in d.shaders.iter().enumerate() { + let index = match tpl.shaders.get(i) { + Some(t) if t.name.eq_ignore_ascii_case(&s.name) => i, + _ => tpl.shaders.iter().position(|t| t.name.eq_ignore_ascii_case(&s.name)).with_context(|| { + format!("shader {i} ({}.sps) is not one of the model's shaders; its shaders cannot be changed", s.name) + })?, + }; + let t = &tpl.shaders[index]; + let differs = s.params.len() != t.params.len() + || s.params.iter().any(|(n, v)| { + !t.params.iter().any(|(tn, tv)| { + tn.eq_ignore_ascii_case(n) + && match (v, tv) { + (of::OfValue::Texture(a), of::OfValue::Texture(b)) => a.eq_ignore_ascii_case(b), + (of::OfValue::Floats(a), of::OfValue::Floats(b)) => { + a.len() == b.len() && a.iter().zip(b).all(|(x, y)| close(*x, *y)) + } + _ => false, + } + }) + }); + if differs { + notes.push(format!("shader {i} ({}): changed parameters are not imported, the model's stay", s.name)); + } + shader_map.push(index as u16); + } + let file_skel = d.skeleton.as_ref(); + let tpl_skel = tpl.skeleton.as_ref(); + if let (Some(a), Some(b)) = (file_skel, tpl_skel) + && (a.bones.len() != b.bones.len() + || a.bones.iter().zip(&b.bones).any(|(x, y)| x.tag != y.tag || x.name != y.name)) + { + notes.push(format!("the skeleton is kept from the game file ({} bones)", b.bones.len())); + } + // A bone of the files' skeleton → the game file's (by tag, else name). + let bone_map = |i: usize| -> Option { + let (Some(fs), Some(ts)) = (file_skel, tpl_skel) else { return Some(i) }; + let b = fs.bones.get(i)?; + ts.bones + .iter() + .position(|t| t.tag == b.tag && t.name.eq_ignore_ascii_case(&b.name)) + .or_else(|| ts.bones.iter().position(|t| t.tag == b.tag)) + .or_else(|| ts.bones.iter().position(|t| t.name.eq_ignore_ascii_case(&b.name))) + }; + + let mut file = None; + if options.always_rebuild_meshes || !same_meshes(d, &tpl) { + file = Some(write_meshes(template, &tpl, d, &shader_map, &bone_map, &mut notes)?); + } else { + notes.push("the meshes are the game file's; they stay as they are".into()); + } + + // Embedded textures: changed and new ones go in by name. + let mut changed = Vec::new(); + for t in &d.textures { + let mut t = t.texture.clone(); + match tpl.textures.iter().find(|o| of::same_texture_name(&o.texture.name, &t.name)) { + Some(o) if same_texture(&o.texture, &t) => continue, + Some(o) => t.name = o.texture.name.clone(), + None => notes.push(format!("embedded texture {} added (no shader of the model uses it yet)", t.name)), + } + changed.push(t); + } + for o in &tpl.textures { + if !d.textures.iter().any(|t| of::same_texture_name(&o.texture.name, &t.texture.name)) { + notes.push(format!("embedded texture {} is kept (shaders use textures by name)", o.texture.name)); + } + } + if !changed.is_empty() { + let base = match &file { + Some(f) => Resource::from_rsc7(f)?, + None => template.clone(), + }; + notes.push(format!( + "embedded textures replaced: {}", + changed.iter().map(|t| t.name.as_str()).collect::>().join(", ") + )); + file = Some(ydr_write::replace_embedded_textures(&base, &changed)?); + } + if file.is_none() { + notes.push("nothing differs from the game file".into()); + } + Ok(Imported { file, notes }) +} + +/// The files' detail levels written onto the template. +fn write_meshes( + template: &Resource, + tpl: &OfDrawable, + d: &OfDrawable, + shader_map: &[u16], + bone_map: &dyn Fn(usize) -> Option, + notes: &mut Vec, +) -> Result> { + let skinned_template = ydr_write::skinned_bones(template)?.is_some(); + let world = tpl.skeleton.as_ref().map(|s| skeleton(s).world_transforms()).unwrap_or_default(); + let mut levels: Vec> = Vec::new(); + for (k, lod) in d.lods.iter().enumerate() { + if lod.models.is_empty() { + continue; + } + // The bone the game file's model of this level is attached to: the + // written model is a copy of it. + let target = tpl.lods.get(k).and_then(|l| l.models.first()).or_else(|| tpl.lods[0].models.first()); + let target_bone = target.map_or(0, |m| m.bone as usize); + let mut meshes = Vec::new(); + for m in &lod.models { + let bone = bone_map(m.bone as usize) + .with_context(|| format!("model on bone {}, which the game file's skeleton does not have", m.bone))?; + // Fixed models: from their bone's space to the target bone's. A + // model on bone 0 is in model space (as the game's models are read). + let space = |b: usize| if b == 0 { Some(&math::IDENTITY) } else { world.get(b) }; + let to_target = (!skinned_template && bone != target_bone) + .then(|| { + let (a, b) = (space(bone)?, space(target_bone)?); + Some(math::mul(&math::inverse_affine(b), a)) + }) + .flatten(); + for g in &m.geometries { + let shader = *shader_map + .get(g.shader as usize) + .with_context(|| format!("a geometry uses shader {}, which the files do not have", g.shader))?; + let xyz = |c: usize| -> Vec<[f32; 3]> { + g.attribute(c).map(|v| v.iter().map(|p| [p[0], p[1], p[2]]).collect()).unwrap_or_default() + }; + let mut mesh = NewMesh { + shader, + positions: xyz(component::POSITION), + normals: xyz(component::NORMAL), + uvs: g + .attribute(component::TEXCOORD0) + .map(|v| v.iter().map(|t| [t[0], t[1]]).collect()) + .unwrap_or_default(), + colors: g + .attribute(component::COLOUR0) + .map(|v| v.iter().map(|c| c.map(|x| x / 255.0)).collect()) + .unwrap_or_default(), + indices: g.indices.clone(), + bones: Vec::new(), + blend: Vec::new(), + }; + if let Some(t) = &to_target { + mesh.positions.iter_mut().for_each(|p| *p = math::transform_point(t, *p)); + mesh.normals.iter_mut().for_each(|n| *n = math::transform_dir(t, *n)); + } + if skinned_template { + mesh.bones = match (g.attribute(component::BLEND_INDICES), g.attribute(component::BLEND_WEIGHTS)) { + (Some(idx), Some(w)) => idx + .iter() + .zip(w) + .map(|(i, w)| { + let k = (0..4).max_by(|&a, &b| w[a].total_cmp(&w[b])).unwrap_or(0); + bone_map(i[k] as usize).map(|b| b as u16).with_context(|| { + format!( + "a vertex moves with bone {}, which the game file's skeleton does not have", + i[k] + ) + }) + }) + .collect::>()?, + _ => vec![bone as u16; mesh.positions.len()], + }; + // All four bones with their weights (peds, clothing). + if let (Some(idx), Some(w)) = + (g.attribute(component::BLEND_INDICES), g.attribute(component::BLEND_WEIGHTS)) + { + mesh.blend = idx + .iter() + .zip(w) + .map(|(i, w)| { + let mut b = ydr_write::Blend::default(); + for k in 0..4 { + if w[k] > 0.0 { + b.bones[k] = bone_map(i[k] as usize).unwrap_or(0) as u16; + b.weights[k] = w[k]; + } + } + let sum: f32 = b.weights.iter().sum(); + if sum > 0.0 { + b.weights.iter_mut().for_each(|x| *x /= sum); + } + b + }) + .collect(); + } + } + meshes.extend(crate::obj::split(mesh)); + } + } + levels.push(meshes); + } + if levels.is_empty() { + bail!("the files have no meshes"); + } + if levels.len() < d.lods.iter().rposition(|l| !l.models.is_empty()).map_or(0, |i| i + 1) { + notes.push("empty detail levels in between were left out".into()); + } + let refs: Vec<&[NewMesh]> = levels.iter().map(Vec::as_slice).collect(); + let file = ydr_write::replace_lods(template, &refs, None, None)?; + let vertices: usize = levels.iter().flatten().map(|m| m.positions.len()).sum(); + notes.push(format!("meshes written: {} detail level(s), {vertices} vertices", levels.len())); + Ok(file) +} diff --git a/crates/openrage-cli/src/cli.rs b/crates/openrage-cli/src/cli.rs index 5d8f485..13ea834 100644 --- a/crates/openrage-cli/src/cli.rs +++ b/crates/openrage-cli/src/cli.rs @@ -107,6 +107,12 @@ pub(crate) enum Command { /// as it should, undo the edit and check that the copy is the original again. #[arg(long)] rebuild: bool, + /// With --models: write every model (.ydr, .yft, .ydd) and texture dictionary (.ytd) as + /// OpenIV openFormats text and read it back, checking that nothing changes; GTA V + /// Enhanced drawables and fragments are also imported back onto themselves (meshes + /// written anew) and must read back as the original. + #[arg(long, requires = "models")] + openformats: bool, }, /// Convert a metadata file (.ymap, .ytyp, .ymt, .ymf, .cut, .pso) to XML. Xml { @@ -299,6 +305,31 @@ pub(crate) enum Command { #[arg(long, value_name = "OBJ")] collision: Option, }, + /// Export a model or texture dictionary as OpenIV openFormats text files: .ydr → .odr, + /// .yft → .oft, .ydd → .odd, .ytd → .otd, with meshes (.mesh), skeletons (.skel) and + /// textures (.otx + .dds) in a folder named after the file. + ExportOpenformats { + /// The file in the game, e.g. `x64i.rpf/levels/gta5/props/…/prop_x.ydr`. + path: String, + /// Folder to write into. + #[arg(short, long, default_value = ".")] + out: PathBuf, + }, + /// Import openFormats files (.odr, .oft, .otd) onto the game file they belong to: its + /// meshes, detail levels and embedded textures (dictionaries: textures) are replaced, its + /// shaders, skeleton and physics stay. GTA V Enhanced models; texture dictionaries of both. + ImportOpenformats { + /// The file in the game, e.g. `x64i.rpf/levels/gta5/props/…/prop_x.ydr`. + path: String, + /// The main openFormats file (`prop_x.odr`). + file: PathBuf, + /// Write the new game file to this file. + #[arg(short, long, required_unless_present = "mods")] + out: Option, + /// Put the new file into the mods folder in place of the original (can be undone). + #[arg(long, conflicts_with = "out")] + mods: bool, + }, /// Show a model (.ydr, .yft, .ydd; GTA IV .wdr, .wft, .wdd) and optionally export it as glTF (.glb). Model { /// Virtual path of the model. diff --git a/crates/openrage-cli/src/cmd/mod.rs b/crates/openrage-cli/src/cmd/mod.rs index fd59242..a7ebbe7 100644 --- a/crates/openrage-cli/src/cmd/mod.rs +++ b/crates/openrage-cli/src/cmd/mod.rs @@ -4,6 +4,7 @@ mod archive; mod asi; mod edit; mod oiv; +mod openformats; mod plugin; mod rdr2; mod search; @@ -16,6 +17,7 @@ pub(crate) use archive::*; pub(crate) use asi::*; pub(crate) use edit::*; pub(crate) use oiv::*; +pub(crate) use openformats::*; pub(crate) use plugin::*; pub(crate) use rdr2::*; pub(crate) use search::*; diff --git a/crates/openrage-cli/src/cmd/openformats.rs b/crates/openrage-cli/src/cmd/openformats.rs new file mode 100644 index 0000000..43b13b7 --- /dev/null +++ b/crates/openrage-cli/src/cmd/openformats.rs @@ -0,0 +1,328 @@ +//! `openrage export-openformats`, `import-openformats` and +//! `verify --models --openformats`: OpenIV's text formats. + +use std::collections::HashMap; + +use openrage_app::openformats::{self as ofs, ImportOptions, Kind}; +use rage_formats::openformats as of; +use rage_resource::{Resource, ResourceError}; + +use crate::*; + +/// A game file inside an archive: its resource and page flags. +fn read_game_file(game_dir: &Path, vpath: &str, keys: Option>) -> Result<(Resource, (u32, u32))> { + let Node::ArchiveFile(rpf, id) = rage_mods::resolve(game_dir, vpath, keys)?.0 else { + bail!("{vpath} is not a file inside an archive") + }; + let rage_rpf::EntryKind::Resource { system_flags, graphics_flags, .. } = rpf.entry(id).kind else { + bail!("{vpath} is not a resource") + }; + Ok((rpf.read_resource(id)?, (system_flags, graphics_flags))) +} + +fn file_name(vpath: &str) -> &str { + vpath.rsplit('/').next().unwrap_or(vpath) +} + +pub(crate) fn cmd_export_openformats( + game_dir: &Path, + vpath: &str, + out: &Path, + keys: Option>, +) -> Result<()> { + let (res, _) = read_game_file(game_dir, vpath, keys)?; + let files = ofs::export(&res, file_name(vpath))?; + let main = ofs::write_files(out, &files)?; + let bytes: usize = files.iter().map(|f| f.data.len()).sum(); + outln!("Exported {} files ({}) to {}", files.len(), human(bytes as u64), out.display()); + outln!("Main file: {}", main.display()); + Ok(()) +} + +pub(crate) fn cmd_import_openformats( + game_dir: &Path, + vpath: &str, + file: &Path, + out: Option<&Path>, + mods: bool, + keys: Option>, +) -> Result<()> { + let (res, flags) = read_game_file(game_dir, vpath, keys.clone())?; + let imported = ofs::import(&res, flags, file_name(vpath), file)?; + for n in &imported.notes { + outln!("{n}"); + } + let Some(data) = imported.file else { + outln!("Nothing to write: the files are the game file's."); + return Ok(()); + }; + if let Some(out) = out { + fs::write(out, &data).with_context(|| format!("writing {}", out.display()))?; + outln!("Saved {} ({})", out.display(), human(data.len() as u64)); + } + if mods { + let name = file.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default(); + cmd_edit(game_dir, vpath, Op::Set(data), &format!("Imported {name} into {vpath}"), keys)?; + } + Ok(()) +} + +/// Every model and texture dictionary of the game as openFormats text and +/// back: the text must read back as the same model. GTA V Enhanced drawables +/// and fragments are also imported back onto themselves (meshes written +/// anew), and what the game reads from the result must match the original. +pub(crate) fn cmd_verify_openformats(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { + use rage_formats::drawable; + #[derive(Default)] + struct Stats { + text: usize, + imported: usize, + bytes: usize, + /// Why a model could not be written back (the model writer's limits). + not_writable: HashMap, + errors: Vec, + } + let starts = archive_roots(game_dir, within, keys)?; + let started = Instant::now(); + let check = |res: &Resource, name: &str, flags: (u32, u32), s: &mut Stats| -> Result<()> { + let kind = Kind::of_game_file(name).expect("filtered"); + let files = ofs::export(res, name)?; + s.bytes += files.iter().map(|f| f.data.len()).sum::(); + let map: HashMap<&str, &[u8]> = files.iter().map(|f| (f.path.as_str(), f.data.as_slice())).collect(); + let src = |p: &str| -> Result, ResourceError> { + map.get(p).map(|d| d.to_vec()).ok_or_else(|| ResourceError::Format(format!("{p} was not written"))) + }; + let main = files.last().expect("main file").path.clone(); + let stem = name.rsplit_once('.').map_or(name, |(s, _)| s); + // Text round trip. + match kind { + Kind::Drawable => { + if let Some(d) = of::difference(&of::read_ydr(res, stem)?, &of::parse_odr(&src, &main)?) { + bail!("{d}"); + } + } + Kind::Fragment => { + let (a, b) = (of::read_yft(res, stem)?, of::parse_oft(&src, &main)?); + if a.children.len() != b.children.len() { + bail!("{} parts, {} read back", a.children.len(), b.children.len()); + } + for ((ta, da), (tb, db)) in std::iter::once((&0, &a.drawable)) + .chain(a.children.iter().map(|(t, d)| (t, d))) + .zip(std::iter::once((&0, &b.drawable)).chain(b.children.iter().map(|(t, d)| (t, d)))) + { + if ta != tb { + bail!("part on bone {ta} read back on bone {tb}"); + } + if let Some(d) = of::difference(da, db) { + bail!("{}: {d}", da.name); + } + } + } + Kind::Dictionary => { + let (a, b) = (of::read_ydd(res)?, of::parse_odd(&src, &main)?); + if a.len() != b.len() { + bail!("{} drawables, {} read back", a.len(), b.len()); + } + for (x, y) in a.iter().zip(&b) { + if let Some(d) = of::difference(x, y) { + bail!("{}: {d}", x.name); + } + } + } + Kind::Textures => { + let (a, b) = (of::read_ytd(res)?, of::parse_otd(&src, &main)?); + if a.len() != b.len() { + bail!("{} textures, {} read back", a.len(), b.len()); + } + for (x, y) in a.iter().zip(&b) { + if let Some(d) = of::texture_difference(&x.texture, &y.texture) { + bail!("{d}"); + } + } + } + } + s.text += 1; + // Back onto the game file. + let enhanced = res.version == drawable::VERSION_YDR_ENHANCED || res.version == drawable::VERSION_YFT_ENHANCED; + if !enhanced || !matches!(kind, Kind::Drawable | Kind::Fragment) { + return Ok(()); + } + let options = ImportOptions { always_rebuild_meshes: true }; + let imported = match ofs::import_with(res, flags, name, &src, &main, options) { + Ok(i) => i, + Err(e) => { + // The model writer's limits: grouped by reason. + let why = e.to_string(); + let key: String = why.split(|c: char| c.is_ascii_digit()).collect::>().join("#"); + let entry = s.not_writable.entry(key).or_insert((0, String::new())); + entry.0 += 1; + if entry.1.is_empty() { + entry.1 = format!("{name}: {why}"); + } + return Ok(()); + } + }; + let file = imported.file.context("nothing written")?; + let (before, after) = if res.version == drawable::VERSION_YFT_ENHANCED { + (drawable::parse_yft(res)?, rage_formats::ydr_write::read_back(&file)?) + } else { + (drawable::parse_ydr(res)?, rage_formats::ydr_write::read_back(&file)?) + }; + compare_read_back(&before, &after)?; + s.imported += 1; + Ok(()) + }; + // Archives are read in parallel, but one archive holds thousands of + // models (all vehicles are in one): the files go through a short queue + // to one worker per core, so a big archive does not leave the others idle. + type Job = (String, String, (u32, u32), Result); + let workers = std::thread::available_parallelism().map_or(4, |n| n.get()); + let (send, receive) = std::sync::mpsc::sync_channel::(workers * 2); + let receive = std::sync::Mutex::new(receive); + let all: Vec = std::thread::scope(|scope| { + let handles: Vec<_> = (0..workers) + .map(|_| { + scope.spawn(|| { + let mut s = Stats::default(); + loop { + let job = receive.lock().map_err(|_| ()).and_then(|r| r.recv().map_err(|_| ())); + let Ok((path, name, flags, res)) = job else { break }; + let result = + res.map_err(|e| anyhow::anyhow!(e)).and_then(|res| check(&res, &name, flags, &mut s)); + if let Err(e) = result { + s.errors.push(format!("{path}: {e:#}")); + } + } + s + }) + }) + .collect(); + let read_errors: Vec = starts + .par_iter() + .flat_map_iter(|(prefix, rpf, dir)| { + let mut nested = Vec::new(); + let send = send.clone(); + vfs::walk( + rpf, + *dir, + prefix, + true, + &mut |a, id, p| { + let entry = a.entry(id); + let rage_rpf::EntryKind::Resource { system_flags, graphics_flags, .. } = entry.kind else { + return; + }; + if Kind::of_game_file(&entry.name).is_none() { + return; + } + let res = a.read_resource(id).map_err(|e| e.to_string()); + let _ = send.send((p.to_owned(), entry.name.clone(), (system_flags, graphics_flags), res)); + }, + &mut |e| nested.push(e.to_string()), + ); + nested + }) + .collect(); + drop(send); + let mut all: Vec = handles.into_iter().map(|h| h.join().expect("verify worker")).collect(); + all.push(Stats { errors: read_errors, ..Default::default() }); + all + }); + let mut total = Stats::default(); + for s in all { + total.text += s.text; + total.imported += s.imported; + total.bytes += s.bytes; + total.errors.extend(s.errors); + for (k, (n, example)) in s.not_writable { + let e = total.not_writable.entry(k).or_insert((0, example)); + e.0 += n; + } + } + for e in total.errors.iter().take(50) { + outln!("FAIL {e}"); + } + // Kinds of failures (the message without the file and the numbers). + let mut kinds: HashMap = HashMap::new(); + for e in &total.errors { + let message = e.split_once(": ").map_or(e.as_str(), |(_, m)| m); + let message = message.rsplit_once(" differs ").map_or(message.to_owned(), |(_, m)| format!("differs {m}")); + let kind: String = message.split(|c: char| c.is_ascii_digit()).collect::>().join("#"); + *kinds.entry(kind).or_default() += 1; + } + let mut kinds: Vec<_> = kinds.into_iter().collect(); + kinds.sort_by_key(|(_, n)| std::cmp::Reverse(*n)); + for (kind, n) in kinds.iter().take(30) { + outln!("{n:>7}× {kind}"); + } + let mut reasons: Vec<_> = total.not_writable.values().collect(); + reasons.sort_by_key(|(n, _)| std::cmp::Reverse(*n)); + let skipped: usize = reasons.iter().map(|(n, _)| n).sum(); + for (n, example) in reasons.iter().take(20) { + outln!("not written back ({n}×), e.g. {example}"); + } + outln!( + "{} files as openFormats text and back ({}), {} Enhanced models imported back onto themselves, {skipped} beyond the model writer, {} errors ({:.1}s)", + total.text, + human(total.bytes as u64), + total.imported, + total.errors.len(), + started.elapsed().as_secs_f32() + ); + if !total.errors.is_empty() { + bail!("{} errors", total.errors.len()); + } + Ok(()) +} + +/// What the game reads from a model imported back onto itself must be the +/// original: the same meshes (to the text's precision), shaders, textures +/// and bones. +fn compare_read_back(a: &rage_formats::drawable::Drawable, b: &rage_formats::drawable::Drawable) -> Result<()> { + let close = + |x: f32, y: f32| x == y || (x - y).abs() <= 1e-4 + 1e-5 * x.abs().max(y.abs()) || (x.is_nan() && y.is_nan()); + let close_all = |x: &[f32], y: &[f32]| x.len() == y.len() && x.iter().zip(y).all(|(p, q)| close(*p, *q)); + if a.meshes.len() != b.meshes.len() { + bail!("{} meshes, {} after importing", a.meshes.len(), b.meshes.len()); + } + for (i, (x, y)) in a.meshes.iter().zip(&b.meshes).enumerate() { + if x.indices != y.indices || x.shader != y.shader { + bail!("mesh {i}: triangles or shader differ after importing"); + } + if !close_all(x.positions.as_flattened(), y.positions.as_flattened()) { + bail!("mesh {i}: positions differ after importing"); + } + if !x.uvs.is_empty() && !close_all(x.uvs.as_flattened(), y.uvs.as_flattened()) { + bail!("mesh {i}: texture coordinates differ after importing"); + } + let near = |p: &[[f32; 3]], q: &[[f32; 3]]| { + p.len() == q.len() + && p.iter().zip(q).all(|(u, v)| (0..3).all(|k| (u[k] - v[k]).abs() < 0.01 || u[k].is_nan())) + }; + if !x.normals.is_empty() && !near(&x.normals, &y.normals) { + bail!("mesh {i}: normals differ after importing"); + } + if !x.colors.is_empty() && !close_all(x.colors.as_flattened(), y.colors.as_flattened()) { + bail!("mesh {i}: colours differ after importing"); + } + } + let names = |d: &rage_formats::drawable::Drawable| -> Vec<(u32, Vec)> { + d.shaders.iter().map(|s| (s.name_hash, s.textures.clone())).collect() + }; + if names(a) != names(b) { + bail!("shaders differ after importing"); + } + let bones = |d: &rage_formats::drawable::Drawable| -> Vec<(String, u16, i16)> { + d.skeleton.iter().flat_map(|s| &s.bones).map(|b| (b.name.clone(), b.tag, b.parent)).collect() + }; + if bones(a) != bones(b) { + bail!("bones differ after importing"); + } + let textures = |d: &rage_formats::drawable::Drawable| -> Vec<(String, usize)> { + d.textures.iter().flat_map(|t| &t.textures).map(|t| (t.name.clone(), t.data.len())).collect() + }; + if textures(a) != textures(b) { + bail!("embedded textures differ after importing"); + } + Ok(()) +} diff --git a/crates/openrage-cli/src/main.rs b/crates/openrage-cli/src/main.rs index 71e6c5d..5fbedd6 100644 --- a/crates/openrage-cli/src/main.rs +++ b/crates/openrage-cli/src/main.rs @@ -173,6 +173,7 @@ fn run() -> Result<()> { Command::Extract { path, out, expand_archives } => cmd_extract(&game_dir, &path, &out, expand_archives, keys), Command::Find { pattern, r#in } => cmd_find(&game_dir, &r#in, &pattern, keys), Command::Verify { path, models: true, .. } if gta4 => cmd_verify_gta4_models(&game_dir, &path), + Command::Verify { path, models: true, openformats: true, .. } => cmd_verify_openformats(&game_dir, &path, keys), Command::Verify { path, models: true, rebuild: true, .. } => cmd_verify_model_writer(&game_dir, &path, keys), Command::Verify { path, models: true, .. } => cmd_verify_models(&game_dir, &path, keys), Command::Verify { path, audio: true, .. } => cmd_verify_audio(&game_dir, &path, keys), @@ -221,6 +222,10 @@ fn run() -> Result<()> { cmd_model(&game_dir, &path, outfit, view, keys) } Command::Clips { path, clip } => cmd_clips(&game_dir, &path, clip.as_deref(), keys), + Command::ExportOpenformats { path, out } => cmd_export_openformats(&game_dir, &path, &out, keys), + Command::ImportOpenformats { path, file, out, mods } => { + cmd_import_openformats(&game_dir, &path, &file, out.as_deref(), mods, keys) + } Command::ReplaceModel { path, obj, out, mods, shader, lod, no_textures, drawable, collision } => { let options = ReplaceOptions { out: out.as_deref(), diff --git a/crates/openrage-gui/src/callbacks.rs b/crates/openrage-gui/src/callbacks.rs index 681a7db..bb72f06 100644 --- a/crates/openrage-gui/src/callbacks.rs +++ b/crates/openrage-gui/src/callbacks.rs @@ -801,6 +801,17 @@ pub(crate) fn row_action(ui: &AppWindow, row: usize, action: &str) { ui.set_status("The model is still loading.".into()); } } + "openformats-export" => { + let vpath = with_app(|a| { + let listing = a.listing.as_ref()?; + let item = listing.items.get(*a.visible.get(row)?)?; + Some(item.vpath.clone().unwrap_or_else(|| browser::join(&listing.vpath, &item.name))) + }); + if let Some(vpath) = vpath { + openformats_ui::export(ui, vpath); + } + } + "openformats-import" => openformats_ui::import(ui), "png" => ui.invoke_save_png(), "replace" if ui.get_texture_mode() => ui.invoke_texture_replace(), "replace" => ui.invoke_archive_replace(), diff --git a/crates/openrage-gui/src/main.rs b/crates/openrage-gui/src/main.rs index ea78a64..de19007 100644 --- a/crates/openrage-gui/src/main.rs +++ b/crates/openrage-gui/src/main.rs @@ -21,6 +21,7 @@ mod history; mod model_ui; mod mods_ui; mod navigate; +mod openformats_ui; mod plugins; mod plugins_ui; mod preview; diff --git a/crates/openrage-gui/src/navigate.rs b/crates/openrage-gui/src/navigate.rs index 9543c16..b23c5d4 100644 --- a/crates/openrage-gui/src/navigate.rs +++ b/crates/openrage-gui/src/navigate.rs @@ -414,6 +414,12 @@ pub(crate) fn file_row(item: &Item) -> FileRow { can_open: is_openable(item), can_view: is_viewable(item), is_model: is_model_item(item), + is_openformats: item.kind == ItemKind::Resource + && item.mark != Some(Mark::Removed) + && openrage_app::openformats::Kind::of_game_file(&item.name).is_some(), + can_import_openformats: item.kind == ItemKind::Resource + && item.mark != Some(Mark::Removed) + && openrage_app::openformats::Kind::of_game_file(&item.name).is_some_and(|k| k.can_import()), can_edit_text: is_text_file(item), is_meta: is_meta_file(item), is_gfx: item.name.to_ascii_lowercase().ends_with(".gfx"), diff --git a/crates/openrage-gui/src/openformats_ui.rs b/crates/openrage-gui/src/openformats_ui.rs new file mode 100644 index 0000000..52168e2 --- /dev/null +++ b/crates/openrage-gui/src/openformats_ui.rs @@ -0,0 +1,80 @@ +//! Export openFormats… and Import openFormats… in the explorer's context menu. + +use openrage_app::openformats::{self as ofs, Kind}; +use rage_resource::Resource; + +use crate::*; + +/// A GTA V file inside an archive: its resource and page flags. +fn read_resource(vpath: &str) -> anyhow::Result<(Resource, (u32, u32))> { + let (game_dir, keys) = with_app(|a| (a.game_dir.clone(), a.keys.clone())); + let game_dir = game_dir.ok_or_else(|| anyhow::anyhow!("no game folder"))?; + let Node::ArchiveFile(rpf, id) = rage_mods::resolve(&game_dir, vpath, keys)?.0 else { + anyhow::bail!("openFormats are for GTA V files inside archives") + }; + let rage_rpf::EntryKind::Resource { system_flags, graphics_flags, .. } = rpf.entry(id).kind else { + anyhow::bail!("{vpath} is not a resource") + }; + Ok((rpf.read_resource(id)?, (system_flags, graphics_flags))) +} + +/// Asks for a folder and writes the file there as openFormats text files. +pub(crate) fn export(ui: &AppWindow, vpath: String) { + let name = vpath.rsplit('/').next().unwrap_or(&vpath).to_owned(); + let res = match read_resource(&vpath) { + Ok((r, _)) => r, + Err(e) => return show_error(ui, format!("Cannot read {name}: {e:#}")), + }; + let weak = ui.as_weak(); + std::thread::spawn(move || { + let Some(dir) = + rfd::FileDialog::new().set_title(format!("Export {name} as openFormats to folder")).pick_folder() + else { + return; + }; + let msg = match ofs::export(&res, &name).and_then(|files| Ok((ofs::write_files(&dir, &files)?, files.len()))) { + Ok((main, n)) => format!("Exported {n} files; open {} in OpenIV or a text editor", main.display()), + Err(e) => format!("Cannot export {name} as openFormats: {e:#}"), + }; + let _ = weak.upgrade_in_event_loop(move |ui| ui.set_status(msg.into())); + }); +} + +/// Asks for an openFormats file and puts the selected file, rebuilt from it, +/// into the mods folder (undoable, like Replace…). +pub(crate) fn import(ui: &AppWindow) { + let Some((vpath, name)) = selected_entry() else { return }; + let Some(kind) = Kind::of_game_file(&name).filter(|k| k.can_import()) else { + return show_error(ui, format!("openFormats cannot be imported onto {name}")); + }; + let template = match read_resource(&vpath) { + Ok(t) => t, + Err(e) => return show_error(ui, format!("Cannot read {name}: {e:#}")), + }; + let weak = ui.as_weak(); + std::thread::spawn(move || { + let ext = kind.open_ext(); + let Some(file) = rfd::FileDialog::new() + .set_title(format!("Import openFormats onto {name}")) + .add_filter(format!("openFormats (.{ext})"), &[ext]) + .pick_file() + else { + return; + }; + let result = ofs::import(&template.0, template.1, &name, &file); + let file_name = file.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default(); + let _ = weak.upgrade_in_event_loop(move |ui| match result { + Ok(imported) => match imported.file { + // What was taken over goes into the description (status and History). + Some(data) => run_archive_ops( + &ui, + vec![(vpath, OpTarget::Op(Op::Set(data)))], + format!("Imported {file_name} into {name} ({})", imported.notes.join("; ")), + Some(name), + ), + None => ui.set_status(format!("{file_name} is the same as {name}; nothing changed").into()), + }, + Err(e) => show_error(&ui, format!("Cannot import {file_name} onto {name}: {e:#}")), + }); + }); +} diff --git a/crates/openrage-gui/ui/app.slint b/crates/openrage-gui/ui/app.slint index 17b060d..eed0511 100644 --- a/crates/openrage-gui/ui/app.slint +++ b/crates/openrage-gui/ui/app.slint @@ -178,6 +178,10 @@ export struct FileRow { // Has a 3D or image view (model, texture). can-view: bool, is-model: bool, + // A GTA V model or texture dictionary: exportable as OpenIV openFormats text. + is-openformats: bool, + // … and openFormats files can be imported onto it (not drawable dictionaries). + can-import-openformats: bool, // A text file (opens in the text editor). can-edit-text: bool, // Binary metadata (.ymap, .ytyp, .ymt, …) shown as XML. @@ -553,6 +557,11 @@ component FileItem inherits Rectangle { icon: @image-url("icons/menu/export.svg"); activated => { root.action("gltf"); } } + if item.is-openformats: MenuItem { + title: @tr("Export openFormats…"); + icon: @image-url("icons/menu/export.svg"); + activated => { root.action("openformats-export"); } + } if root.texture-mode: MenuItem { title: @tr("Save PNG…"); icon: @image-url("icons/menu/image.svg"); @@ -565,6 +574,12 @@ component FileItem inherits Rectangle { enabled: root.can-edit; activated => { root.action("replace"); } } + if root.archive-mode && item.can-import-openformats: MenuItem { + title: @tr("Import openFormats…"); + icon: @image-url("icons/menu/replace.svg"); + enabled: root.can-edit; + activated => { root.action("openformats-import"); } + } if root.archive-mode: MenuItem { title: @tr("Rename…"); icon: @image-url("icons/menu/rename.svg"); diff --git a/crates/rage-formats/src/dds.rs b/crates/rage-formats/src/dds.rs index c8d007a..2f21a91 100644 --- a/crates/rage-formats/src/dds.rs +++ b/crates/rage-formats/src/dds.rs @@ -90,8 +90,11 @@ pub fn to_dds(tex: &Texture) -> Vec { h[6] = tex.levels.max(1); // h[7..18] reserved; pixel format at h[18..26] h[18] = 32; - let dx10 = legacy_pixel_format(tex.format).is_none(); - match legacy_pixel_format(tex.format) { + // Arrays of 2D textures need the DX10 header for their size. + let array = tex.dimension == Dimension::Texture2D && tex.depth > 1; + let legacy = legacy_pixel_format(tex.format).filter(|_| !array); + let dx10 = legacy.is_none(); + match legacy { Some((flags, cc, bits, masks)) => { h[19] = flags; h[20] = cc; @@ -118,7 +121,8 @@ pub fn to_dds(tex: &Texture) -> Vec { if dx10 { let resource_dimension = if tex.dimension == Dimension::Texture3D { 4 } else { 3 }; let misc = if tex.dimension == Dimension::Cube { 0x4 } else { 0 }; - for v in [tex.format.0, resource_dimension, misc, 1, 0] { + let array_size = if array { tex.depth } else { 1 }; + for v in [tex.format.0, resource_dimension, misc, array_size, 0] { out.extend_from_slice(&v.to_le_bytes()); } } @@ -139,6 +143,7 @@ pub fn from_dds(name: &str, file: &[u8]) -> Result { let masks = [h(22), h(23), h(24), h(25)]; let caps2 = h(27); let mut data_start = 128; + let mut array_size = 1; let mut dimension = if caps2 & DDSCAPS2_CUBEMAP_ALL != 0 { Dimension::Cube } else if caps2 & DDSCAPS2_VOLUME != 0 { @@ -162,6 +167,7 @@ pub fn from_dds(name: &str, file: &[u8]) -> Result { if x(2) & 0x4 != 0 { dimension = Dimension::Cube; } + array_size = x(3).max(1); Format(x(0)) } other => return Err(DdsError::UnsupportedFourCc(String::from_utf8_lossy(other).into_owned())), @@ -184,7 +190,7 @@ pub fn from_dds(name: &str, file: &[u8]) -> Result { let depth = match dimension { Dimension::Cube => 6, Dimension::Texture3D => h(5).max(1), - Dimension::Texture2D => 1, + Dimension::Texture2D => array_size, }; let tex = Texture { name: name.to_owned(), width, height, depth, levels, format, dimension, usage: 0, data: Vec::new() }; @@ -223,6 +229,24 @@ mod tests { assert_eq!(dds.len(), 128 + 20 + 24); } + #[test] + fn texture_arrays() { + let t = Texture { + name: "noise".into(), + width: 4, + height: 4, + depth: 3, + levels: 1, + format: Format::R8_UNORM, + dimension: Dimension::Texture2D, + usage: 0, + data: (0..48).collect(), + }; + let back = from_dds("noise", &to_dds(&t)).unwrap(); + assert_eq!((back.format, back.depth, back.dimension), (Format::R8_UNORM, 3, Dimension::Texture2D)); + assert_eq!(back.data, t.data); + } + #[test] fn dds_round_trip() { for format in [Format::BC1_UNORM, Format::BC7_UNORM, Format::B8G8R8A8_UNORM, Format::R8_UNORM] { diff --git a/crates/rage-formats/src/lib.rs b/crates/rage-formats/src/lib.rs index 2a524b6..0c22a27 100644 --- a/crates/rage-formats/src/lib.rs +++ b/crates/rage-formats/src/lib.rs @@ -23,6 +23,7 @@ pub mod media; pub mod meta; pub mod model_textures; pub mod names; +pub mod openformats; pub mod paths; pub mod pso; pub mod rbf; diff --git a/crates/rage-formats/src/openformats/compare.rs b/crates/rage-formats/src/openformats/compare.rs new file mode 100644 index 0000000..e96a87e --- /dev/null +++ b/crates/rage-formats/src/openformats/compare.rs @@ -0,0 +1,145 @@ +//! Comparing models, to check that writing and reading text keeps them. + +use super::*; + +/// Whether a number read back from text is the one written (seven +/// significant digits). +pub(crate) fn close(a: f32, b: f32) -> bool { + a.to_bits() == b.to_bits() || (a - b).abs() <= 1e-6 + 2e-6 * a.abs().max(b.abs()) || (a.is_nan() && b.is_nan()) +} + +fn close_all(a: &[f32], b: &[f32]) -> bool { + a.len() == b.len() && a.iter().zip(b).all(|(x, y)| close(*x, *y)) +} + +/// The first difference between a model and the same model written as text +/// and read back (`b`), if any. Bones may be in another order (the text +/// lists them as a tree); blend indices and bone references must follow. +pub fn difference(a: &OfDrawable, b: &OfDrawable) -> Option { + if a.shaders.len() != b.shaders.len() { + return Some(format!("{} shaders, {} read back", a.shaders.len(), b.shaders.len())); + } + for (i, (x, y)) in a.shaders.iter().zip(&b.shaders).enumerate() { + if !x.name.eq_ignore_ascii_case(&y.name) || x.params.len() != y.params.len() { + return Some(format!( + "shader {i}: {} with {} parameters, read back {} with {}", + x.name, + x.params.len(), + y.name, + y.params.len() + )); + } + for ((n, v), (m, w)) in x.params.iter().zip(&y.params) { + let same = n.eq_ignore_ascii_case(m) + && match (v, w) { + (OfValue::Texture(s), OfValue::Texture(t)) => s.eq_ignore_ascii_case(t), + (OfValue::Floats(s), OfValue::Floats(t)) => close_all(s, t), + _ => false, + }; + if !same { + return Some(format!("shader {i}: parameter {n} = {v:?} read back as {m} = {w:?}")); + } + } + } + let rank = a.skeleton.as_ref().map(write::bone_ranks).unwrap_or_default(); + let remap = |i: usize| rank.get(i).copied().unwrap_or(i); + match (&a.skeleton, &b.skeleton) { + (None, None) => {} + (Some(s), Some(t)) => { + if s.bones.len() != t.bones.len() || s.crc != t.crc { + return Some(format!("skeleton: {} bones, {} read back", s.bones.len(), t.bones.len())); + } + for (i, x) in s.bones.iter().enumerate() { + let y = &t.bones[remap(i)]; + let parent = usize::try_from(x.parent).ok().filter(|&p| p < i).map_or(-1, |p| remap(p) as i16); + let same = (x.name.is_empty() && y.name == "unnamed" || x.name == y.name) + && x.tag == y.tag + && x.flags & 0xFFF == y.flags + && parent == y.parent + && close_all(&x.rotation, &y.rotation) + && close_all(&x.translation, &y.translation) + && close_all(&x.scale, &y.scale); + if !same { + return Some(format!("bone {i} ({}) differs after reading back", x.name)); + } + } + } + _ => return Some("the skeleton is lost".into()), + } + if !close_all(&a.center, &b.center) + || !close(a.radius, b.radius) + || !close_all(&a.aabb_min, &b.aabb_min) + || !close_all(&a.aabb_max, &b.aabb_max) + { + return Some("bounds differ".into()); + } + for (k, (la, lb)) in a.lods.iter().zip(&b.lods).enumerate() { + let level = LOD_NAMES[k]; + if !close(la.distance, lb.distance) || la.models.len() != lb.models.len() { + return Some(format!("{level}: {} models, {} read back", la.models.len(), lb.models.len())); + } + for (i, (x, y)) in la.models.iter().zip(&lb.models).enumerate() { + if remap(x.bone as usize) != y.bone as usize + || (x.skinned, x.bone_count, x.mask) != (y.skinned, y.bone_count, y.mask) + || x.bounds.len() != y.bounds.len() + || x.geometries.len() != y.geometries.len() + { + return Some(format!("{level} model {i}: header differs after reading back")); + } + for ((p, q), (r, s)) in x.bounds.iter().zip(&y.bounds) { + if !close_all(p, r) || !close_all(q, s) { + return Some(format!("{level} model {i}: bounds differ")); + } + } + for (j, (g, h)) in x.geometries.iter().zip(&y.geometries).enumerate() { + let what = format!("{level} model {i} geometry {j}"); + if g.shader != h.shader || !g.decl.same_layout(h.decl) || g.indices != h.indices { + return Some(format!("{what}: shader, declaration or indices differ")); + } + for ((c, v), (d, w)) in g.attributes.iter().zip(&h.attributes) { + let widths = g.decl.components().find(|(k, _)| k == c).map_or(4, |(k, t)| VertexDecl::width(k, t)); + let same = c == d + && v.len() == w.len() + && v.iter().zip(w).all(|(p, q)| { + let p = + if *c == component::BLEND_INDICES { p.map(|b| remap(b as usize) as f32) } else { *p }; + close_all(&p[..widths], &q[..widths]) + }); + if !same { + return Some(format!("{what}: vertex component {c} differs after reading back")); + } + } + } + } + } + if a.textures.len() != b.textures.len() { + return Some(format!("{} embedded textures, {} read back", a.textures.len(), b.textures.len())); + } + for (x, y) in a.textures.iter().zip(&b.textures) { + if let Some(d) = texture_difference(&x.texture, &y.texture) { + return Some(d); + } + } + None +} + +/// The first difference between a texture and the same texture written as +/// DDS and read back. +pub fn texture_difference(x: &crate::texture::Texture, y: &crate::texture::Texture) -> Option { + let what = if !write::same_texture_name(&x.name, &y.name) { + format!("named {}", y.name) + } else if (x.width, x.height, x.depth, x.levels) != (y.width, y.height, y.depth, y.levels) { + format!("{}×{}×{} with {} levels", y.width, y.height, y.depth, y.levels) + } else if x.format != y.format { + format!("format {} instead of {}", y.format.name(), x.format.name()) + } else if x.dimension != y.dimension { + format!("{:?} instead of {:?}", y.dimension, x.dimension) + } else if x.usage != y.usage { + format!("usage {} instead of {}", y.usage, x.usage) + } else if x.data != y.data { + format!("{} bytes of pixels instead of {}", y.data.len(), x.data.len()) + } else { + return None; + }; + Some(format!("texture {} differs after reading back: {what}", x.name)) +} diff --git a/crates/rage-formats/src/openformats/mod.rs b/crates/rage-formats/src/openformats/mod.rs new file mode 100644 index 0000000..1ff0c17 --- /dev/null +++ b/crates/rage-formats/src/openformats/mod.rs @@ -0,0 +1,550 @@ +//! OpenIV's openFormats: GTA V models and textures as text files. +//! +//! OpenIV exports drawables (`.ydr` → `.odr`), fragments (`.yft` → `.oft`), +//! drawable dictionaries (`.ydd` → `.odd`) and texture dictionaries +//! (`.ytd` → `.otd`) as plain text, with the meshes, skeletons and textures +//! in a folder named after the file. The layout here follows OpenIV's own +//! exports (props and their `.mesh`, `.skel`, `.otd`/`.otx` files): +//! +//! * every file starts with `Version `, then a block in +//! braces; a line `Key values…` is a value, a line followed by `{ … }` a +//! block; paths are relative to the file and use backslashes; +//! * `.odr`: `Shaders` (one `.sps` block per shader with its +//! parameters: texture names and numbers), `Skeleton .skel` or +//! `null`, `LodGroup` (`High`/`Med`/`Low`/`Vlow` with their distance and +//! the `.mesh` files and the bone each is attached to, `Center`, `Radius`, +//! `AABBMin`, `AABBMax`), `Joints`, `Light`, `Bound`; +//! * `.mesh`: `Locked`, `Skinned`, `BoneCount`, `Mask`, `Bounds` (one +//! `Aabb` around everything when there are several geometries, then one +//! per geometry), `Geometries` with each `Geometry`'s `ShaderIndex`, +//! `Flags`, `VertexDeclaration`, `Indices { … }` (15 per line) and +//! `Vertices { … }`: one vertex per line, its components separated by +//! ` / ` in declaration order (position, blend weights, blend indices, +//! normal, colours, texture coordinates, tangent, binormal); +//! * `.skel`: `DataCRC`, `NumBones`, then the bone tree: `Bone ` +//! with `MirrorBoneId`, `Flags` (`ROT_X` … `TRANS_Z`), `RotationQuaternion`, +//! `LocalOffset`, `Scale` and `Children { … }`; +//! * `.otd`: the `.otx` file of every texture; `.otx`: `Image .dds`, +//! `Type`, `PixelFormat`, `Levels`, `Usage`, `UsageFlags`, `ExtraFlags`; +//! * `.odd`: the `.odr` file of every drawable. +//! +//! Vertex declarations are named by OpenIV with `N` (fixed) or `S` +//! (skinned) and a hash of the layout: [`VertexDecl::code`] knows the codes +//! seen in OpenIV's exports and writes other layouts as `N`/`S`, the +//! component flags and the 4-bit component types in hex (e.g. +//! `N40597755555555996996`), which OpenRAGE reads back but OpenIV may not. +//! +//! Not from OpenIV's exports, so modelled on the rest: the embedded texture +//! dictionary of a drawable (`TextureDictionary .otd` after the +//! shaders), and `.oft` files (the main drawable as a `Drawable` block with +//! the `.odr` contents, then a `Children` block with each part's `BoneTag` +//! and `Drawable`); the fragment's physics are not exported. Shader +//! parameters of GTA V Enhanced models are their textures only (their +//! numbers live in constant buffers that are not read yet). + +mod compare; +mod parse; +mod read; +mod text; +mod write; + +pub use compare::{difference, texture_difference}; +pub use parse::{Source, parse_odd, parse_odr, parse_oft, parse_otd}; +pub use read::{read_drawable_at, read_ydd, read_ydr, read_yft, read_ytd}; +pub use write::{ + ExportedFile, export_odd, export_odr, export_oft, export_otd, file_stem, name_of_file_stem, same_texture_name, +}; + +use crate::texture::Texture; + +/// Resource versions OpenIV writes into the text files' `Version` lines. +pub const VERSION_DRAWABLE: (u32, u32) = (165, 32); +pub const VERSION_SKELETON: (u32, u32) = (165, 30); +pub const VERSION_FRAGMENT: (u32, u32) = (162, 30); +pub const VERSION_TEXTURES: (u32, u32) = (13, 30); + +/// A drawable: shaders, skeleton, up to four detail levels. +#[derive(Debug, Clone, Default)] +pub struct OfDrawable { + /// The name the files are written under (without extension). + pub name: String, + pub shaders: Vec, + pub skeleton: Option, + /// High, medium, low and very low detail. + pub lods: [OfLod; 4], + pub center: [f32; 3], + pub radius: f32, + pub aabb_min: [f32; 3], + pub aabb_max: [f32; 3], + /// Textures embedded in the drawable. + pub textures: Vec, +} + +impl OfDrawable { + /// Every geometry of every model of every level. + pub fn geometries(&self) -> impl Iterator { + self.lods.iter().flat_map(|l| &l.models).flat_map(|m| &m.geometries) + } +} + +/// The names of the detail levels in `.odr` files. +pub const LOD_NAMES: [&str; 4] = ["High", "Med", "Low", "Vlow"]; + +#[derive(Debug, Clone)] +pub struct OfLod { + /// How far away the level is drawn (9998 when not set). + pub distance: f32, + pub models: Vec, +} + +impl Default for OfLod { + fn default() -> Self { + Self { distance: 9998.0, models: Vec::new() } + } +} + +/// A model: geometries drawn together, attached to one bone (or skinned). +#[derive(Debug, Clone, Default)] +pub struct OfModel { + /// The bone the model moves with (fixed models). + pub bone: u8, + pub skinned: bool, + /// Bones the model's vertices are skinned to. + pub bone_count: u8, + /// Render mask (`0xFF`: always). + pub mask: u8, + /// One box around all geometries when there are several, then one per geometry. + pub bounds: Vec<([f32; 3], [f32; 3])>, + pub geometries: Vec, +} + +/// Vertex components in declaration order, as GTA V Legacy numbers them. +pub mod component { + pub const POSITION: usize = 0; + pub const BLEND_WEIGHTS: usize = 1; + pub const BLEND_INDICES: usize = 2; + pub const NORMAL: usize = 3; + pub const COLOUR0: usize = 4; + pub const COLOUR1: usize = 5; + /// Texture coordinates 0–7 are components 6–13. + pub const TEXCOORD0: usize = 6; + pub const TANGENT: usize = 14; + pub const BINORMAL: usize = 15; +} + +/// The 4-bit component types of GTA V Legacy's vertex declarations, which +/// nearly every model uses: float3 positions and normals, bytes for blend +/// weights, indices and colours, float2 texture coordinates, float4 tangents. +pub const DEFAULT_TYPES: u64 = 0x7755_5555_5599_6996; + +/// A vertex declaration: which components the vertices have +/// (`flags`, bit per [`component`]) and how they are stored (`types`). +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct VertexDecl { + pub flags: u32, + pub types: u64, +} + +/// Declaration codes seen in OpenIV's exports (all with [`DEFAULT_TYPES`]). +const KNOWN_DECLS: &[(&str, u32)] = &[ + ("N209731BE", 0x0059), // position, normal, colour, uv + ("N51263BB5", 0x4059), // … tangent + ("S9445853F", 0x405F), // skinned, position, normal, colour, uv, tangent + ("SBED48839", 0x007F), // skinned, two colours, uv (ped_default) + ("SD7D22350", 0x407F), // … tangent (ped_hair_cutout_alpha) + ("S12D0183F", 0x40FF), // … two uv sets (ped) +]; + +impl VertexDecl { + /// The components present, in order, with their 4-bit type. + pub fn components(self) -> impl Iterator { + (0..16).filter(move |k| self.flags >> k & 1 != 0).map(move |k| (k, (self.types >> (k * 4) & 0xF) as u8)) + } + + pub fn has(self, component: usize) -> bool { + self.flags >> component & 1 != 0 + } + + pub fn skinned(self) -> bool { + self.has(component::BLEND_WEIGHTS) + } + + /// The types bits of the components present (others are irrelevant). + fn used_types(self) -> u64 { + self.components().fold(0, |acc, (k, t)| acc | (t as u64) << (k * 4)) + } + + /// The same components stored the same way (unused type bits aside). + pub fn same_layout(self, other: Self) -> bool { + self.flags == other.flags && self.used_types() == other.used_types() + } + + /// OpenIV's name of the declaration. + pub fn code(self) -> String { + let used = self.used_types(); + let default = self.components().fold(0u64, |acc, (k, _)| acc | (DEFAULT_TYPES >> (k * 4) & 0xF) << (k * 4)); + if used == default + && let Some((code, _)) = KNOWN_DECLS.iter().find(|(_, f)| *f == self.flags) + { + return (*code).to_owned(); + } + format!("{}{:04X}{:016X}", if self.skinned() { 'S' } else { 'N' }, self.flags, self.types) + } + + /// The declaration a code names ([`VertexDecl::code`]). + pub fn from_code(code: &str) -> Option { + if let Some((_, flags)) = KNOWN_DECLS.iter().find(|(c, _)| c.eq_ignore_ascii_case(code)) { + return Some(Self { flags: *flags, types: DEFAULT_TYPES }); + } + let hex = code.get(1..).filter(|h| h.len() == 20 && code.starts_with(['N', 'S', 'n', 's']))?; + Some(Self { flags: u32::from_str_radix(&hex[..4], 16).ok()?, types: u64::from_str_radix(&hex[4..], 16).ok()? }) + } + + /// How many numbers a component has in the text. + pub fn width(component: usize, ty: u8) -> usize { + match (component, ty) { + (component::BLEND_WEIGHTS | component::BLEND_INDICES | component::COLOUR0 | component::COLOUR1, _) => 4, + (_, 2) => 1, + (_, 1 | 5) => 2, + (_, 6) => 3, + _ => 4, + } + } + + /// Whether a component is written as whole numbers (bytes). + pub fn integral(component: usize) -> bool { + matches!(component, component::BLEND_INDICES | component::COLOUR0 | component::COLOUR1) + } +} + +/// A geometry: triangles of one shader. +#[derive(Debug, Clone)] +pub struct OfGeometry { + pub shader: u16, + pub decl: VertexDecl, + pub indices: Vec, + /// One list per component of the declaration, in its order; each with a + /// value per vertex. Blend indices are skeleton bone indices, colours and + /// blend indices 0–255, blend weights 0–1. + pub attributes: Vec<(usize, Vec<[f32; 4]>)>, +} + +impl OfGeometry { + pub fn vertex_count(&self) -> usize { + self.attributes.first().map_or(0, |(_, v)| v.len()) + } + + /// The values of a component, if the geometry has it. + pub fn attribute(&self, component: usize) -> Option<&[[f32; 4]]> { + self.attributes.iter().find(|(c, _)| *c == component).map(|(_, v)| v.as_slice()) + } +} + +/// A shader and its parameters. +#[derive(Debug, Clone, Default)] +pub struct OfShader { + /// Its name without `.sps`, e.g. `normal_spec`. + pub name: String, + pub params: Vec<(String, OfValue)>, +} + +impl OfShader { + /// The texture of the parameter `name` (case-insensitive). + pub fn texture(&self, name: &str) -> Option<&str> { + self.params.iter().find_map(|(n, v)| match v { + OfValue::Texture(t) if n.eq_ignore_ascii_case(name) => Some(t.as_str()), + _ => None, + }) + } + + /// All textures, in order. + pub fn textures(&self) -> impl Iterator { + self.params.iter().filter_map(|(n, v)| match v { + OfValue::Texture(t) => Some((n.as_str(), t.as_str())), + OfValue::Floats(_) => None, + }) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub enum OfValue { + Texture(String), + Floats(Vec), +} + +#[derive(Debug, Clone, Default)] +pub struct OfSkeleton { + pub crc: u32, + pub bones: Vec, +} + +#[derive(Debug, Clone, Default, PartialEq)] +pub struct OfBone { + pub name: String, + pub tag: u16, + pub mirror: u16, + /// Index of the parent, -1 for the root. + pub parent: i16, + /// `ROT_X` … (see [`BONE_FLAGS`]). + pub flags: u16, + pub rotation: [f32; 4], + pub translation: [f32; 3], + pub scale: [f32; 3], +} + +/// Bone flag names, by bit. +pub const BONE_FLAGS: &[(u16, &str)] = &[ + (0x1, "ROT_X"), + (0x2, "ROT_Y"), + (0x4, "ROT_Z"), + (0x8, "LIMIT_ROTATION"), + (0x10, "TRANS_X"), + (0x20, "TRANS_Y"), + (0x40, "TRANS_Z"), + (0x80, "LIMIT_TRANSLATION"), + (0x100, "SCALE_X"), + (0x200, "SCALE_Y"), + (0x400, "SCALE_Z"), + (0x800, "LIMIT_SCALE"), +]; + +/// A texture with what the `.otx` file says about it. +#[derive(Debug, Clone)] +pub struct OfTexture { + pub texture: Texture, +} + +/// A fragment: its main drawable and its parts (wheels, …) on bones. +#[derive(Debug, Clone, Default)] +pub struct OfFragment { + pub drawable: OfDrawable, + /// (bone tag, drawable) + pub children: Vec<(u16, OfDrawable)>, +} + +/// Texture usage names in `.otx` files, by the game's usage code. +pub(crate) const USAGES: &[(u8, &str)] = &[ + (0, "UNKNOWN"), + (1, "DEFAULT"), + (2, "TERRAIN"), + (3, "CLOUDDENSITY"), + (4, "CLOUDNORMAL"), + (5, "CABLE"), + (6, "FENCE"), + (8, "SCRIPT"), + (9, "WATERFLOW"), + (10, "WATERFOAM"), + (11, "WATERFOG"), + (12, "WATEROCEAN"), + (14, "FOAMOPACITY"), + (16, "DIFFUSEMIPSHARPEN"), + (18, "DIFFUSEDARK"), + (19, "DIFFUSEALPHAOPAQUE"), + (20, "DIFFUSE"), + (21, "DETAIL"), + (22, "NORMAL"), + (23, "SPECULAR"), + (24, "EMISSIVE"), + (25, "TINTPALETTE"), + (26, "SKIPPROCESSING"), +]; + +/// The name of a usage code in `.otx` files (`USAGE_` for codes without one). +pub(crate) fn usage_name(code: u8) -> String { + USAGES.iter().find(|(u, _)| *u == code).map_or_else(|| format!("USAGE_{code}"), |u| u.1.to_owned()) +} + +/// The usage code of a name in an `.otx` file. +pub(crate) fn usage_code(name: &str) -> Option { + match USAGES.iter().find(|(_, n)| n.eq_ignore_ascii_case(name)) { + Some((code, _)) => Some(*code), + None => name.get(6..).filter(|_| name.get(..6).is_some_and(|p| p.eq_ignore_ascii_case("USAGE_")))?.parse().ok(), + } +} + +/// Shader parameter names (the game stores their hashes) and how many +/// numbers each has; textures have 0. +pub(crate) const PARAMS: &[(&str, usize)] = &[ + ("DiffuseSampler", 0), + ("DiffuseSampler2", 0), + ("DiffuseSampler3", 0), + ("BumpSampler", 0), + ("BumpSampler2", 0), + ("SpecSampler", 0), + ("DetailSampler", 0), + ("DetailSampler2", 0), + ("EnvironmentSampler", 0), + ("DirtSampler", 0), + ("DamageSampler", 0), + ("DamageMaskSampler", 0), + ("DiffuseExtraSampler", 0), + ("DiffuseHfSampler", 0), + ("PlateBgSampler", 0), + ("PlateBgBumpSampler", 0), + ("FontSampler", 0), + ("FontNormalSampler", 0), + ("TintPaletteSampler", 0), + ("PaletteSampler", 0), + ("DistanceMapSampler", 0), + ("HeightSampler", 0), + ("LookupSampler", 0), + ("SnowSampler", 0), + ("StubbleSampler", 0), + ("WrinkleSampler_A", 0), + ("WrinkleSampler_B", 0), + ("WrinkleMaskSampler_0", 0), + ("WrinkleMaskSampler_1", 0), + ("WrinkleMaskSampler_2", 0), + ("WrinkleMaskSampler_3", 0), + ("WrinkleMaskSampler_4", 0), + ("WrinkleMaskSampler_5", 0), + ("TextureSampler_layer0", 0), + ("TextureSampler_layer1", 0), + ("TextureSampler_layer2", 0), + ("TextureSampler_layer3", 0), + ("BumpSampler_layer0", 0), + ("BumpSampler_layer1", 0), + ("BumpSampler_layer2", 0), + ("BumpSampler_layer3", 0), + ("HeightMapSamplerLayer0", 0), + ("HeightMapSamplerLayer1", 0), + ("HeightMapSamplerLayer2", 0), + ("HeightMapSamplerLayer3", 0), + ("ComboHeightSamplerFur", 0), + ("ComboHeightSamplerFur2", 0), + ("ComboHeightSamplerFur3", 0), + ("ComboHeightSamplerFur4", 0), + ("NoiseSampler", 0), + ("FlowSampler", 0), + ("FoamSampler", 0), + ("AnisoNoiseSpecSampler", 0), + ("StippleSampler", 0), + ("MaskSampler", 0), + ("DiffuseTex", 0), + ("BumpTex", 0), + ("SpecularTex", 0), + ("DetailTex", 0), + ("DirtTex", 0), + ("DamageTexture", 0), + ("DiffuseTex2", 0), + ("EnvironmentTex", 0), + ("Bumpiness", 1), + ("SpecularIntensityMult", 1), + ("SpecularFalloffMult", 1), + ("SpecularFresnel", 1), + ("SpecMapIntMask", 3), + ("ReflectivePower", 1), + ("DetailSettings", 4), + ("UseTessellation", 1), + ("HardAlphaBlend", 1), + ("WetnessMultiplier", 1), + ("EmissiveMultiplier", 1), + ("AlphaScale", 1), + ("AlphaTestValue", 1), + ("matDiffuseColor", 4), + ("matDiffuseColor2", 4), + ("DirtLevelMod", 1), + ("DirtColor", 3), + ("DirtDecalMask", 4), + ("EnvEffScale", 2), + ("EnvEffThickness", 1), + ("EnvEffTexTileUV", 1), + ("Specular2ColorIntensity", 1), + ("Specular2Factor", 1), + ("Specular2Color", 3), + ("Specular2Color_DirLerp", 4), + ("FresnelRolloff", 1), + ("ParallaxScaleBias", 1), + ("POMDisable", 1), + ("globalAnimUV0", 3), + ("globalAnimUV1", 3), + ("TintPaletteSelector", 2), + ("WindGlobalParams", 4), + ("umGlobalParams", 3), + ("umGlobalOverrideParams", 1), + ("ZShift", 1), + ("LetterIndex1", 4), + ("LetterIndex2", 4), + ("LetterSize", 2), + ("NumLetters", 1), + ("LicensePlateFontExtents", 4), + ("LicensePlateFontTint", 4), + ("FontNormalScale", 1), + ("DistEpsilonScaleMin", 4), + ("DistMapCenterVal", 4), + ("FillColor", 4), + ("StubbleControl", 4), + ("StubbleGrowth", 1), + ("DiffuseMod", 4), + ("NormalMapMult", 1), + ("DetailPower", 1), + ("DetailScale", 1), + ("DetailBumpiness", 1), + ("DetailOffset", 4), + ("DetailMapScale", 1), + ("NoiseSettings", 4), + ("RippleSpeed", 1), + ("RippleScale", 1), + ("RippleBumpiness", 1), + ("WaveOffset", 1), + ("WaveMovement", 1), + ("WaveSpeed", 1), + ("FogColor", 3), + ("SpecularColor", 3), + ("GlassColor", 4), + ("Selfillumcolor", 3), + ("ClothParameters", 4), + ("OrderNumber", 1), + ("UVScrollSpeed", 2), + ("ScanlineFilterParams", 4), + ("TextureAnimationParams", 4), + ("MaterialWetnessMultiplier", 1), + ("BrokenGlassTileScale", 1), + ("BrokenDiffuseColor", 4), + ("BrokenSpecularColor", 4), + ("CrackLevelMin", 1), + ("CrackLevelMax", 1), + ("CrackLevel_reciprocal", 1), + ("CrackEdgeBumpTileScale", 1), + ("CrackEdgeBumpAmount", 1), + ("CrackDecalBumpTileScale", 1), + ("CrackDecalBumpAmount", 1), + ("CrackDecalBumpAlphaThreshold", 1), + ("DecalTint", 4), + ("DamagedWheelOffsets", 4), + ("EnvironmentMapIntensity", 1), + ("WireframeColor", 4), +]; + +/// The name of a shader parameter hash: known names, else `hash_XXXXXXXX`. +pub(crate) fn param_name(hash: u32) -> (String, Option) { + use std::collections::HashMap; + use std::sync::OnceLock; + static TABLE: OnceLock> = OnceLock::new(); + let table = TABLE.get_or_init(|| PARAMS.iter().map(|&(n, w)| (rage_core::hash::joaat(n), (n, w))).collect()); + match table.get(&hash) { + Some(&(n, w)) => (n.to_owned(), Some(w)), + None => (format!("hash_{hash:08X}"), None), + } +} + +/// The hash of a parameter name as [`param_name`] writes it. +pub fn param_hash(name: &str) -> u32 { + match name.strip_prefix("hash_").and_then(|h| u32::from_str_radix(h, 16).ok()) { + Some(h) => h, + None => rage_core::hash::joaat(name), + } +} + +/// The hash of a shader name as written (`.sps` without the extension). +pub fn shader_hash(name: &str) -> u32 { + param_hash(name) +} + +/// The name a shader hash is written as. +pub(crate) fn shader_name(hash: u32) -> String { + crate::shaders::name(hash).map(str::to_owned).unwrap_or_else(|| format!("hash_{hash:08X}")) +} + +#[cfg(test)] +mod tests; diff --git a/crates/rage-formats/src/openformats/parse.rs b/crates/rage-formats/src/openformats/parse.rs new file mode 100644 index 0000000..8539f69 --- /dev/null +++ b/crates/rage-formats/src/openformats/parse.rs @@ -0,0 +1,300 @@ +//! Reading openFormats text files back into the model. + +use rage_resource::ResourceError; + +use super::text::{self, Node}; +use super::*; +use crate::drawable::bad; + +/// Reads a file of an export by its path (`/`-separated, relative to the +/// folder the export was written to). +pub type Source<'a> = &'a dyn Fn(&str) -> Result, ResourceError>; + +/// `dir` joined with a path as written in a file (`\` or `/`), `..` resolved. +pub(crate) fn resolve(dir: &str, path: &str) -> String { + let mut parts: Vec<&str> = dir.split('/').filter(|p| !p.is_empty()).collect(); + for p in path.split(['\\', '/']) { + match p { + "" | "." => {} + ".." => { + parts.pop(); + } + p => parts.push(p), + } + } + parts.join("/") +} + +fn dir_of(path: &str) -> &str { + path.rsplit_once('/').map_or("", |(d, _)| d) +} + +fn stem_of(path: &str) -> String { + let name = path.rsplit_once('/').map_or(path, |(_, n)| n); + name.rsplit_once('.').map_or(name, |(s, _)| s).to_owned() +} + +fn document(src: Source, path: &str) -> Result { + let data = src(path)?; + let text = String::from_utf8_lossy(&data); + text::parse(&text).map_err(|e| bad(format!("{path}: {e}"))) +} + +fn in_file(path: &str, r: Result) -> Result { + r.map_err(|e| match e { + ResourceError::Format(m) if !m.starts_with(path) => bad(format!("{path}: {m}")), + e => e, + }) +} + +/// A drawable from its `.odr` file. +pub fn parse_odr(src: Source, path: &str) -> Result { + let doc = document(src, path)?; + let mut d = in_file(path, drawable(src, dir_of(path), &doc.root))?; + d.name = stem_of(path); + Ok(d) +} + +/// A fragment from its `.oft` file. +pub fn parse_oft(src: Source, path: &str) -> Result { + let doc = document(src, path)?; + let dir = dir_of(path); + let main = doc.root.get("Drawable").ok_or_else(|| bad(format!("{path}: no Drawable block")))?; + let mut f = OfFragment { drawable: in_file(path, drawable(src, dir, main))?, children: Vec::new() }; + f.drawable.name = stem_of(path); + if let Some(children) = doc.root.get("Children") { + for (i, c) in children.all("Child").enumerate() { + let tag = in_file(path, c.get("BoneTag").ok_or_else(|| bad("a Child without BoneTag")))?; + let tag = in_file(path, tag.int())?; + let block = c.get("Drawable").ok_or_else(|| bad(format!("{path}: a Child without Drawable")))?; + let mut d = in_file(path, drawable(src, dir, block))?; + d.name = format!("{}_child{i}", f.drawable.name); + f.children.push((tag, d)); + } + } + Ok(f) +} + +/// The drawables of a drawable dictionary from its `.odd` file. +pub fn parse_odd(src: Source, path: &str) -> Result, ResourceError> { + let doc = document(src, path)?; + let mut out = Vec::new(); + for n in doc.root.children() { + if n.key().to_ascii_lowercase().ends_with(".odr") { + out.push(parse_odr(src, &resolve(dir_of(path), n.key()))?); + } + } + Ok(out) +} + +/// The textures of a texture dictionary from its `.otd` file. +pub fn parse_otd(src: Source, path: &str) -> Result, ResourceError> { + let doc = document(src, path)?; + let mut out = Vec::new(); + for n in doc.root.children() { + let otx = resolve(dir_of(path), n.key()); + let x = document(src, &otx)?; + let image = x.root.get("Image").ok_or_else(|| bad(format!("{otx}: no Image")))?; + let dds = resolve(dir_of(&otx), image.arg(0)?); + let mut texture = crate::dds::from_dds(&name_of_file_stem(&stem_of(&otx)), &src(&dds)?) + .map_err(|e| bad(format!("{dds}: {e}")))?; + if let Some(usage) = x.root.get("Usage").and_then(|u| u.args().first()) + && let Some(code) = usage_code(usage) + { + texture.usage = code; + } + out.push(OfTexture { texture }); + } + Ok(out) +} + +fn drawable(src: Source, dir: &str, node: &Node) -> Result { + let mut d = OfDrawable::default(); + if let Some(shaders) = node.get("Shaders") { + for s in shaders.children() { + let name = s.key(); + let name = name.strip_suffix(".sps").or_else(|| name.strip_suffix(".SPS")).unwrap_or(name); + d.shaders.push(OfShader { name: name.to_owned(), params: s.children().iter().map(param).collect() }); + } + } + if let Some(t) = node.get("TextureDictionary") + && let Some(p) = t.args().first().filter(|p| !p.eq_ignore_ascii_case("null")) + { + d.textures = parse_otd(src, &resolve(dir, p))?; + } + if let Some(s) = node.get("Skeleton") + && let Some(p) = s.args().first().filter(|p| !p.eq_ignore_ascii_case("null")) + { + let path = resolve(dir, p); + let doc = document(src, &path)?; + d.skeleton = Some(in_file(&path, skeleton(&doc.root))?); + } + let lods = node.get("LodGroup").ok_or_else(|| bad("no LodGroup"))?; + for (k, name) in LOD_NAMES.iter().enumerate() { + let Some(level) = lods.get(name) else { continue }; + if let Some(w) = level.args().first() { + d.lods[k].distance = text::parse_f32(w, level.line)?; + } + for m in level.children() { + if m.key().eq_ignore_ascii_case("none") || m.key().eq_ignore_ascii_case("null") { + continue; + } + let path = resolve(dir, m.key()); + let doc = document(src, &path)?; + let mut model = in_file(&path, mesh(&doc.root))?; + model.bone = match m.args().first() { + Some(b) => b.parse().map_err(|_| bad(format!("line {}: bad bone index {b}", m.line)))?, + None => 0, + }; + d.lods[k].models.push(model); + } + } + let v3 = |key: &str| lods.get(key).map(Node::vec3).transpose(); + d.center = v3("Center")?.unwrap_or_default(); + d.aabb_min = v3("AABBMin")?.unwrap_or_default(); + d.aabb_max = v3("AABBMax")?.unwrap_or_default(); + d.radius = lods.get("Radius").map(Node::float).transpose()?.unwrap_or_default(); + Ok(d) +} + +fn param(n: &Node) -> (String, OfValue) { + let name = n.key().to_owned(); + let texture = || { + let t = n.args().join(" "); + OfValue::Texture(if t.eq_ignore_ascii_case("null") || t == "*NULL*" { String::new() } else { t }) + }; + let value = match param_name(param_hash(&name)).1 { + Some(0) => texture(), + _ => match n.floats() { + Ok(v) if !v.is_empty() => OfValue::Floats(v), + _ => texture(), + }, + }; + (name, value) +} + +fn skeleton(root: &Node) -> Result { + let mut s = OfSkeleton { crc: root.get("DataCRC").map(Node::int).transpose()?.unwrap_or(0), bones: Vec::new() }; + fn bone(s: &mut OfSkeleton, n: &Node, parent: i16) -> Result<(), ResourceError> { + let index = s.bones.len(); + let tag = + n.args().get(1).map(|t| t.parse()).transpose().map_err(|_| bad(format!("line {}: bad tag", n.line)))?; + let v = |key: &str, len: usize, default: &[f32]| -> Result, ResourceError> { + match n.get(key) { + Some(k) => { + let v = k.floats()?; + if v.len() < len { + return Err(bad(format!("line {}: {key} needs {len} numbers", k.line))); + } + Ok(v) + } + None => Ok(default.to_vec()), + } + }; + let (r, t, sc) = ( + v("RotationQuaternion", 4, &[0.0, 0.0, 0.0, 1.0])?, + v("LocalOffset", 3, &[0.0; 3])?, + v("Scale", 3, &[1.0; 3])?, + ); + let flags = n.get("Flags").map_or(0, |f| { + f.args() + .iter() + .filter_map(|w| BONE_FLAGS.iter().find(|(_, n)| n.eq_ignore_ascii_case(w))) + .fold(0, |a, (b, _)| a | b) + }); + let tag = tag.unwrap_or(0); + s.bones.push(OfBone { + name: n.arg(0)?.to_owned(), + tag, + mirror: n.get("MirrorBoneId").map(Node::int).transpose()?.unwrap_or(tag), + parent, + flags, + rotation: [r[0], r[1], r[2], r[3]], + translation: [t[0], t[1], t[2]], + scale: [sc[0], sc[1], sc[2]], + }); + if let Some(children) = n.children().iter().find(|c| c.key().eq_ignore_ascii_case("Children")) { + for c in children.all("Bone") { + bone(s, c, index as i16)?; + } + } + Ok(()) + } + for b in root.all("Bone") { + bone(&mut s, b, -1)?; + } + Ok(s) +} + +fn mesh(root: &Node) -> Result { + let mut m = OfModel { + skinned: root.get("Skinned").map(Node::bool).transpose()?.unwrap_or(false), + bone_count: root.get("BoneCount").map(Node::int).transpose()?.unwrap_or(0), + mask: root.get("Mask").map(Node::int).transpose()?.unwrap_or(0xFF), + ..Default::default() + }; + if let Some(bounds) = root.get("Bounds") { + for b in bounds.all("Aabb") { + let get = |k: &str| b.get(k).ok_or_else(|| bad(format!("line {}: Aabb without {k}", b.line)))?.vec3(); + m.bounds.push((get("Min")?, get("Max")?)); + } + } + let geometries = root.get("Geometries").ok_or_else(|| bad("no Geometries"))?; + for g in geometries.all("Geometry") { + m.geometries.push(geometry(g)?); + } + Ok(m) +} + +fn geometry(g: &Node) -> Result { + let shader = g.get("ShaderIndex").ok_or_else(|| bad(format!("line {}: no ShaderIndex", g.line)))?.int()?; + let code = g.get("VertexDeclaration").ok_or_else(|| bad(format!("line {}: no VertexDeclaration", g.line)))?; + let decl = VertexDecl::from_code(code.arg(0)?) + .ok_or_else(|| bad(format!("line {}: vertex declaration {} is not known", code.line, code.args().join(" "))))?; + let indices_node = g.get("Indices").ok_or_else(|| bad(format!("line {}: no Indices", g.line)))?; + let mut indices = Vec::with_capacity(indices_node.int::().unwrap_or(0)); + for row in indices_node.children() { + for w in &row.words { + indices.push(w.parse().map_err(|_| bad(format!("line {}: {w} is not an index", row.line)))?); + } + } + let vertices = g.get("Vertices").ok_or_else(|| bad(format!("line {}: no Vertices", g.line)))?; + let components: Vec<(usize, u8)> = decl.components().collect(); + let mut attributes: Vec<(usize, Vec<[f32; 4]>)> = + components.iter().map(|&(k, _)| (k, Vec::with_capacity(vertices.children().len()))).collect(); + for v in vertices.children() { + let groups: Vec<&[String]> = v.words.split(|w| w == "/").collect(); + if groups.len() != components.len() { + return Err(bad(format!( + "line {}: {} vertex components, the declaration has {}", + v.line, + groups.len(), + components.len() + ))); + } + for (i, (&(k, ty), words)) in components.iter().zip(groups).enumerate() { + let width = VertexDecl::width(k, ty); + if words.len() != width { + return Err(bad(format!( + "line {}: component {} has {} numbers, not {width}", + v.line, + i + 1, + words.len() + ))); + } + let mut value = [0.0f32; 4]; + for (x, w) in value.iter_mut().zip(words) { + *x = text::parse_f32(w, v.line)?; + } + attributes[i].1.push(value); + } + } + let n = vertices.children().len(); + if let Some(&bad_index) = indices.iter().find(|&&i| i as usize >= n) { + return Err(bad(format!("line {}: index {bad_index} with {n} vertices", indices_node.line))); + } + if indices.len() % 3 != 0 { + return Err(bad(format!("line {}: {} indices are not whole triangles", indices_node.line, indices.len()))); + } + Ok(OfGeometry { shader, decl, indices, attributes }) +} diff --git a/crates/rage-formats/src/openformats/read.rs b/crates/rage-formats/src/openformats/read.rs new file mode 100644 index 0000000..2d86e2e --- /dev/null +++ b/crates/rage-formats/src/openformats/read.rs @@ -0,0 +1,425 @@ +//! Reading GTA V models and texture dictionaries into the openFormats model. + +use rage_resource::{Resource, ResourceError}; + +use super::*; +use crate::drawable::{Encoding, VERSION_YDR_LEGACY, VERSION_YFT_LEGACY, bad}; +use crate::ytd; + +const SYS: u64 = 0x5000_0000; + +fn enhanced(res: &Resource) -> Result { + use crate::drawable::{VERSION_YDR_ENHANCED, VERSION_YDR_ENHANCED_OLD, VERSION_YFT_ENHANCED}; + match res.version { + VERSION_YDR_ENHANCED | VERSION_YFT_ENHANCED | VERSION_YDR_ENHANCED_OLD => Ok(true), + VERSION_YDR_LEGACY | VERSION_YFT_LEGACY => Ok(false), + v => Err(bad(format!("resource version {v} is not a GTA V model"))), + } +} + +/// A `.ydr` file. +pub fn read_ydr(res: &Resource, name: &str) -> Result { + let mut d = read_drawable_at(res, SYS, enhanced(res)?)?; + d.name = name.to_owned(); + Ok(d) +} + +/// A `.yft` file: its main drawable and the parts that have models. +pub fn read_yft(res: &Resource, name: &str) -> Result { + let enhanced = enhanced(res)?; + let main = res.u64(SYS + 0x30)?; + if main == 0 { + return Err(bad("the fragment has no drawable")); + } + let mut drawable = read_drawable_at(res, main, enhanced)?; + drawable.name = name.to_owned(); + let mut out = OfFragment { drawable, children: Vec::new() }; + let group = res.u64(SYS + 0xF0)?; + if group == 0 { + return Ok(out); + } + let Some(lod) = (0..3).map(|i| res.u64(group + 0x10 + i * 8)).find_map(|p| p.ok().filter(|&p| p != 0)) else { + return Ok(out); + }; + let list = res.u64(lod + 0xD0)?; + let mut seen = Vec::new(); + for i in 0..res.u8(lod + 0x11E)? as u64 { + let child = res.u64(list + i * 8)?; + if child == 0 { + continue; + } + let ptr = res.u64(child + 0xA0)?; + if ptr == 0 || seen.contains(&ptr) || res.u64(ptr + 0x50)? == 0 { + continue; + } + seen.push(ptr); + let mut d = read_drawable_at(res, ptr, enhanced)?; + d.name = format!("{name}_child{}", out.children.len()); + out.children.push((res.u16(child + 0x12)?, d)); + } + Ok(out) +} + +/// A `.ydd` file: its drawables, named after their hashes where the name is known. +pub fn read_ydd(res: &Resource) -> Result, ResourceError> { + let enhanced = enhanced(res)?; + let hashes = res.u64(SYS + 0x20)?; + let list = res.u64(SYS + 0x30)?; + let mut out = Vec::new(); + for i in 0..(res.u16(SYS + 0x38)? as u64).min(4096) { + let hash = if hashes != 0 { res.u32(hashes + i * 4)? } else { 0 }; + let mut d = read_drawable_at(res, res.u64(list + i * 8)?, enhanced)?; + d.name = crate::names::value(hash); + out.push(d); + } + Ok(out) +} + +/// A `.ytd` file. +pub fn read_ytd(res: &Resource) -> Result, ResourceError> { + let dict = ytd::parse(res)?; + if let Some(e) = dict.errors.first() { + return Err(bad(format!("a texture cannot be read: {e}"))); + } + Ok(dict.textures.into_iter().map(|texture| OfTexture { texture }).collect()) +} + +fn vec3(res: &Resource, at: u64) -> Result<[f32; 3], ResourceError> { + Ok([f(res, at)?, f(res, at + 4)?, f(res, at + 8)?]) +} + +fn f(res: &Resource, at: u64) -> Result { + Ok(f32::from_bits(res.u32(at)?)) +} + +/// The drawable structure at `ptr` (a `.ydr`'s root, a fragment's drawable, …). +pub fn read_drawable_at(res: &Resource, ptr: u64, enhanced: bool) -> Result { + let mut d = OfDrawable { + center: vec3(res, ptr + 0x20)?, + radius: f(res, ptr + 0x2C)?, + aabb_min: vec3(res, ptr + 0x30)?, + aabb_max: vec3(res, ptr + 0x40)?, + ..Default::default() + }; + let group = res.u64(ptr + 0x10)?; + if group != 0 { + d.shaders = read_shaders(res, group, enhanced)?; + let txd = res.u64(group + 0x08)?; + // A few of the game's models have broken embedded dictionaries (the + // game does not use them either): what can be read is exported. + if txd != 0 + && let Ok(dict) = ytd::parse_at(res, txd, enhanced) + { + d.textures = dict.textures.into_iter().map(|texture| OfTexture { texture }).collect(); + } + } + let skel = res.u64(ptr + 0x18)?; + if skel != 0 { + d.skeleton = Some(read_skeleton(res, skel)?); + } + for (k, lod) in d.lods.iter_mut().enumerate() { + let k = k as u64; + lod.distance = f(res, ptr + 0x70 + k * 4)?; + let mask = (res.u32(ptr + 0x80 + k * 4)? >> 8 & 0xFF) as u8; + let list = res.u64(ptr + 0x50 + k * 8)?; + if list == 0 { + continue; + } + let models = res.u64(list)?; + for m in 0..res.u16(list + 8)? as u64 { + let model = res.u64(models + m * 8)?; + if model != 0 { + let mut model = read_model(res, model, enhanced)?; + model.mask = mask; + lod.models.push(model); + } + } + } + Ok(d) +} + +fn read_skeleton(res: &Resource, ptr: u64) -> Result { + let bones = res.u64(ptr + 0x20)?; + let count = res.u16(ptr + 0x5E)? as u64; + if bones == 0 || count > 2048 { + return Err(bad("invalid skeleton")); + } + let mut out = OfSkeleton { crc: res.u32(ptr + 0x58)?, bones: Vec::new() }; + for i in 0..count { + let b = bones + i * 0x50; + let name = res.u64(b + 0x38)?; + let tag = res.u16(b + 0x44)?; + out.bones.push(OfBone { + name: if name != 0 { res.string(name)? } else { String::new() }, + tag, + mirror: tag, + parent: res.u16(b + 0x32)? as i16, + flags: res.u16(b + 0x40)?, + rotation: [f(res, b)?, f(res, b + 4)?, f(res, b + 8)?, f(res, b + 12)?], + translation: vec3(res, b + 0x10)?, + scale: vec3(res, b + 0x20)?, + }); + } + Ok(out) +} + +fn read_model(res: &Resource, model: u64, enhanced: bool) -> Result { + let binding = res.u32(model + 0x28)?; + let skinned = binding >> 8 & 0xFF != 0; + let mut out = OfModel { + bone: if skinned { 0 } else { (binding >> 24) as u8 }, + skinned, + bone_count: (binding & 0xFF) as u8, + ..Default::default() + }; + let geoms = res.u64(model + 0x08)?; + let count = res.u16(model + 0x10)? as u64; + let mapping = res.u64(model + 0x20)?; + let boxes = res.u64(model + 0x18)?; + if boxes != 0 { + for i in 0..if count > 1 { count + 1 } else { count } { + out.bounds.push((vec3(res, boxes + i * 32)?, vec3(res, boxes + i * 32 + 16)?)); + } + } + for i in 0..count { + let shader = if mapping != 0 { res.u16(mapping + i * 2)? } else { 0 }; + let g = read_geometry(res, res.u64(geoms + i * 8)?, enhanced)?; + out.geometries.push(OfGeometry { shader, ..g }); + } + Ok(out) +} + +/// Where each component of a vertex is and how it is stored. +struct Layout { + decl: VertexDecl, + /// (component, byte offset, encoding) + slots: Vec<(usize, usize, Encoding)>, +} + +fn legacy_type(t: u8) -> Option<(usize, Option)> { + Some(match t { + 1 => (4, Some(Encoding::Half2)), + 2 => (4, None), // float + 3 => (8, Some(Encoding::Half4)), + 5 => (8, Some(Encoding::Float2)), + 6 => (12, Some(Encoding::Float3)), + 7 => (16, Some(Encoding::Float4)), + 8 => (4, Some(Encoding::Uint8x4)), + 9 => (4, Some(Encoding::Unorm8x4)), + 10 => (4, Some(Encoding::Snorm8x4)), + _ => return None, + }) +} + +fn legacy_layout(res: &Resource, decl: u64) -> Result { + let decl = VertexDecl { flags: res.u32(decl)? & 0xFFFF, types: res.u64(decl + 8)? }; + let mut slots = Vec::new(); + let mut offset = 0; + for (k, t) in decl.components() { + let (size, enc) = legacy_type(t).ok_or_else(|| bad(format!("unknown vertex component type {t}")))?; + let enc = enc.ok_or_else(|| bad(format!("vertex component {k} has type {t}, which is not read")))?; + slots.push((k, offset, enc)); + offset += size; + } + Ok(Layout { decl, slots }) +} + +/// Enhanced declarations: 52 slots with offsets and DXGI formats. Each slot +/// that holds something becomes the matching Legacy component with its +/// usual type. +fn enhanced_layout(res: &Resource, decl: u64) -> Result { + let offsets = res.bytes(decl, 52 * 4)?; + let formats = res.bytes(decl + 52 * 4 + 52, 52)?; + let component = |slot: usize| match slot { + 0 => Some(component::POSITION), + 4 => Some(component::NORMAL), + 8 => Some(component::TANGENT), + 12 => Some(component::BINORMAL), + 16 => Some(component::BLEND_WEIGHTS), + 20 => Some(component::BLEND_INDICES), + 24 => Some(component::COLOUR0), + 25 => Some(component::COLOUR1), + 28..=35 => Some(component::TEXCOORD0 + slot - 28), + _ => None, + }; + let encoding = |format: u8| match format { + 2 => Some(Encoding::Float4), + 6 => Some(Encoding::Float3), + 10 => Some(Encoding::Half4), + 16 => Some(Encoding::Float2), + 24 => Some(Encoding::R10G10B10A2), + 28 => Some(Encoding::Unorm8x4), + 30 => Some(Encoding::Uint8x4), + 34 => Some(Encoding::Half2), + _ => None, + }; + let mut slots = Vec::new(); + let mut flags = 0u32; + for slot in 0..52 { + let format = formats[slot]; + if format == 0 { + continue; + } + let Some(k) = component(slot) else { continue }; + let enc = encoding(format).ok_or_else(|| bad(format!("vertex slot {slot} has format {format}")))?; + let off = u32::from_le_bytes(offsets[slot * 4..slot * 4 + 4].try_into().expect("4 bytes")) as usize; + flags |= 1 << k; + slots.push((k, off, enc)); + } + slots.sort_by_key(|s| s.0); + Ok(Layout { decl: VertexDecl { flags, types: DEFAULT_TYPES }, slots }) +} + +fn read_geometry(res: &Resource, g: u64, enhanced: bool) -> Result { + let (vb, ib) = (res.u64(g + 0x18)?, res.u64(g + 0x38)?); + let (count, stride, data, layout) = if enhanced { + ( + res.u32(vb + 0x08)? as usize, + res.u16(vb + 0x0C)? as usize, + res.u64(vb + 0x18)?, + enhanced_layout(res, res.u64(vb + 0x38)?)?, + ) + } else { + ( + res.u32(vb + 0x18)? as usize, + res.u16(vb + 0x08)? as usize, + res.u64(vb + 0x10)?, + legacy_layout(res, res.u64(vb + 0x30)?)?, + ) + }; + if stride == 0 || count > 1 << 22 { + return Err(bad("implausible vertex buffer")); + } + if layout.slots.iter().any(|&(_, o, e)| o + e.size() > stride) { + return Err(bad("a vertex component lies outside the vertex")); + } + let bytes = res.bytes(data, count * stride)?; + // Blend indices point into the geometry's bone table. + let table: Vec = { + let table = res.u64(g + 0x68)?; + let n = res.u16(g + 0x72)? as u64; + if table != 0 && n <= 1024 { + (0..n).map(|i| res.u16(table + i * 2)).collect::>()? + } else { + Vec::new() + } + }; + let mut attributes = Vec::new(); + for &(k, off, enc) in &layout.slots { + let mut values = Vec::with_capacity(count); + for i in 0..count { + let raw = &bytes[i * stride + off..i * stride + off + enc.size()]; + let v = match (k, enc) { + // Bytes as they are stored. + (component::BLEND_INDICES | component::COLOUR0 | component::COLOUR1, _) if enc.size() == 4 => { + [raw[0], raw[1], raw[2], raw[3]].map(f32::from) + } + _ => enc.decode(raw), + }; + values.push(v); + } + if k == component::BLEND_INDICES && !table.is_empty() { + for v in &mut values { + *v = v.map(|i| table.get(i as usize).copied().map_or(i, f32::from)); + } + } + attributes.push((k, values)); + } + let index_count = res.u32(ib + 0x08)? as usize; + let (ptr, size) = + if enhanced { (res.u64(ib + 0x18)?, res.u16(ib + 0x0C)?.max(2) as usize) } else { (res.u64(ib + 0x10)?, 2) }; + let raw = res.bytes(ptr, index_count * size)?; + let indices: Vec = if size == 4 { + raw.as_chunks::<4>().0.iter().map(|c| u32::from_le_bytes(*c)).collect() + } else { + raw.as_chunks::<2>().0.iter().map(|c| u32::from(u16::from_le_bytes(*c))).collect() + }; + if indices.iter().any(|&i| i as usize >= count) { + return Err(bad("index outside the vertex buffer")); + } + Ok(OfGeometry { shader: 0, decl: layout.decl, indices, attributes }) +} + +fn read_shaders(res: &Resource, group: u64, enhanced: bool) -> Result, ResourceError> { + let list = res.u64(group + 0x10)?; + let count = res.u16(group + 0x18)? as u64; + let texture_name = |ptr: u64| -> Result { + let name = res.u64(ptr + 0x28)?; + Ok(if name != 0 { res.string(name)? } else { String::new() }) + }; + let mut out = Vec::new(); + for i in 0..count.min(512) { + let s = res.u64(list + i * 8)?; + let mut shader = OfShader::default(); + if enhanced { + shader.name = shader_name(res.u32(s)?); + let ptrs = res.u64(s + 0x10)?; + let infos = res.u64(s + 0x20)?; + if infos != 0 && ptrs != 0 { + let total = res.u8(infos + 4)? as u64; + for k in 0..total.min(128) { + let (hash, slot) = (res.u32(infos + 8 + k * 8)?, res.u32(infos + 12 + k * 8)?); + if slot & 3 != 0 { + continue; + } + let p = res.u64(ptrs + u64::from(slot >> 2) * 8)?; + if p != 0 { + shader + .params + .push((legacy_texture_param(¶m_name(hash).0), OfValue::Texture(texture_name(p)?))); + } + } + } + } else { + // Parameters: 16 bytes each (data type: 0 texture, else the + // number of float4s; data pointer at 8), then their data, then + // one name hash per parameter. + let params = res.u64(s)?; + shader.name = shader_name(res.u32(s + 0x08)?); + let n = res.u8(s + 0x10)? as u64; + let types: Vec = (0..n).map(|p| res.u8(params + p * 16).map(u64::from)).collect::>()?; + let hashes = params + n * 16 + types.iter().sum::() * 16; + for (p, &t) in types.iter().enumerate() { + let p = p as u64; + let (name, width) = param_name(res.u32(hashes + p * 4)?); + let data = res.u64(params + p * 16 + 8)?; + let value = if t == 0 { + if data == 0 { + continue; + } + OfValue::Texture(texture_name(data)?) + } else { + let mut v = (0..t * 4).map(|k| f(res, data + k * 4)).collect::, _>>()?; + if t == 1 + && let Some(w) = width + { + v.truncate(w.max(1)); + } + OfValue::Floats(v) + }; + shader.params.push((name, value)); + } + } + out.push(shader); + } + Ok(out) +} + +/// GTA V Enhanced names its texture parameters `…Tex`, Legacy (and OpenIV's +/// files) `…Sampler`: the Legacy name where it is known. +pub(crate) fn legacy_texture_param(name: &str) -> String { + let legacy = match name { + "SpecularTex" => "SpecSampler".to_owned(), + "DamageTexture" => "DamageSampler".to_owned(), + n => { + if let Some(base) = n.strip_suffix("Tex2") { + format!("{base}Sampler2") + } else if let Some(base) = n.strip_suffix("Tex") { + format!("{base}Sampler") + } else { + return n.to_owned(); + } + } + }; + if PARAMS.iter().any(|(p, _)| *p == legacy) { legacy } else { name.to_owned() } +} diff --git a/crates/rage-formats/src/openformats/tests.rs b/crates/rage-formats/src/openformats/tests.rs new file mode 100644 index 0000000..99eebaa --- /dev/null +++ b/crates/rage-formats/src/openformats/tests.rs @@ -0,0 +1,341 @@ +use std::collections::HashMap; + +use rage_resource::{Resource, ResourceError}; + +use super::*; +use crate::texture::{Dimension, Format}; + +fn files_source(files: &[ExportedFile]) -> impl Fn(&str) -> Result, ResourceError> + '_ { + let map: HashMap<&str, &[u8]> = files.iter().map(|f| (f.path.as_str(), f.data.as_slice())).collect(); + move |p: &str| map.get(p).map(|d| d.to_vec()).ok_or_else(|| ResourceError::Format(format!("no file {p}"))) +} + +fn text_of<'a>(files: &'a [ExportedFile], path: &str) -> &'a str { + let f = files.iter().find(|f| f.path == path).unwrap_or_else(|| panic!("{path} not written")); + std::str::from_utf8(&f.data).unwrap() +} + +#[test] +fn declaration_codes() { + // Codes seen in OpenIV's exports. + let d = VertexDecl { flags: 0x4059, types: DEFAULT_TYPES }; + assert_eq!(d.code(), "N51263BB5"); + assert_eq!(VertexDecl::from_code("N51263BB5"), Some(d)); + assert_eq!(VertexDecl { flags: 0x405F, types: DEFAULT_TYPES }.code(), "S9445853F"); + // Unused type bits do not change the code. + assert_eq!(VertexDecl { flags: 0x4059, types: DEFAULT_TYPES ^ 0xF00 }.code(), "N51263BB5"); + // Others carry the layout itself. + let odd = VertexDecl { flags: 0x00D9, types: 0x7755_5555_5599_6996 }; + let code = odd.code(); + assert_eq!(code, "N00D97755555555996996"); + assert_eq!(VertexDecl::from_code(&code), Some(odd)); + let half = VertexDecl { flags: 0x0041, types: 0x1006 }; + assert!(half.code().starts_with('N')); + assert_eq!(VertexDecl::from_code(&half.code()), Some(half)); + assert_eq!(VertexDecl::from_code("Nnonsense"), None); +} + +#[test] +fn numbers_like_openiv() { + assert_eq!(text::num(0.0), "0.00000000"); + assert_eq!(text::num(-0.0), "0.00000000"); + assert_eq!(text::num(9998.0), "9998.00000000"); + assert_eq!(text::num(58.368), "58.36800000"); + assert_eq!(text::num(0.97), "0.97000000"); + assert_eq!(text::num(-0.235_351_56), "-0.23535160"); +} + +#[test] +fn blocks_and_errors() { + let doc = text::parse("Version 165 32\r\n{\r\n\tA 1 2\r\n\tB\r\n\t{\r\n\t\tC x\r\n\t}\r\n}\r\n").unwrap(); + assert_eq!(doc.root.get("a").unwrap().floats().unwrap(), vec![1.0, 2.0]); + assert_eq!(doc.root.get("B").unwrap().get("C").unwrap().arg(0).unwrap(), "x"); + assert!(text::parse("Version 1 2\n{\nA\n").is_err()); + assert!(text::parse("Version 1 2\n{\n}\n}\n").is_err()); + assert!(text::parse("A 1\n{\n}\n").is_err()); + assert!(text::parse("{\n}\n").is_err()); +} + +/// A drawable with everything the format has: two detail levels, a fixed and +/// a skinned model, a skeleton whose bones are not in tree order, shader +/// parameters and an embedded texture. +fn sample() -> OfDrawable { + let tri = |shader: u16, decl: VertexDecl, n: usize| { + let mut attributes = Vec::new(); + for (k, _) in decl.components() { + let values = (0..n) + .map(|i| { + let i = i as f32; + match k { + component::BLEND_INDICES => [0.0, 0.0, (i as u32 % 3) as f32, 1.0], + component::BLEND_WEIGHTS => [0.0, 0.0, 1.0, 0.0], + component::COLOUR0 | component::COLOUR1 => [255.0, 128.0, 0.0, 255.0], + _ => [i * 0.5 - 1.25, 1.0 / (i + 3.0), -i * 1234.567, 1.0], + } + }) + .collect(); + attributes.push((k, values)); + } + OfGeometry { shader, decl, indices: (0..n as u32).collect(), attributes } + }; + let fixed = VertexDecl { flags: 0x4059, types: DEFAULT_TYPES }; + let skinned = VertexDecl { flags: 0x405F, types: DEFAULT_TYPES }; + let model = |skinned_model: bool, geometries: Vec| OfModel { + bone: if skinned_model { 0 } else { 2 }, + skinned: skinned_model, + bone_count: if skinned_model { 3 } else { 0 }, + mask: 255, + bounds: vec![([-1.0, -2.0, -3.0], [1.0, 2.0, 3.0]); geometries.len() + usize::from(geometries.len() > 1)], + geometries, + }; + let bone = |name: &str, tag: u16, parent: i16, flags: u16| OfBone { + name: name.into(), + tag, + mirror: tag, + parent, + flags, + rotation: [0.0, 0.0, std::f32::consts::FRAC_1_SQRT_2, std::f32::consts::FRAC_1_SQRT_2], + translation: [0.25, -1.5, 3.0], + scale: [1.0; 3], + }; + let texture = crate::texture::Texture { + name: "Prop_Thing_D".into(), + width: 4, + height: 4, + depth: 1, + levels: 1, + format: Format::BC1_UNORM, + dimension: Dimension::Texture2D, + usage: 20, + data: (0..8).collect(), + }; + let mut d = OfDrawable { + name: "prop_thing".into(), + shaders: vec![ + OfShader { + name: "normal_spec".into(), + params: vec![ + ("DiffuseSampler".into(), OfValue::Texture("Prop_Thing_D".into())), + ("BumpSampler".into(), OfValue::Texture("prop_thing_n".into())), + ("Bumpiness".into(), OfValue::Floats(vec![1.5])), + ("SpecMapIntMask".into(), OfValue::Floats(vec![1.0, 0.0, 0.0])), + ("hash_12345678".into(), OfValue::Floats(vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0])), + ], + }, + OfShader { name: "hash_ABCDEF01".into(), params: Vec::new() }, + ], + skeleton: Some(OfSkeleton { + crc: 3_624_623_659, + // Bone 1's child comes after bone 2, a child of the root. + bones: vec![ + bone("root", 0, -1, 0x1077), + bone("arm", 100, 0, 0x7), + bone("leg", 200, 0, 0x77), + bone("hand", 300, 1, 0x7), + ], + }), + center: [0.5, 0.25, 1.0], + radius: 2.5, + aabb_min: [-1.0, -2.0, -3.0], + aabb_max: [1.0, 2.0, 3.0], + textures: vec![OfTexture { texture }], + ..Default::default() + }; + d.lods[0] = OfLod { + distance: 50.0, + models: vec![model(false, vec![tri(0, fixed, 6), tri(1, fixed, 3)]), model(true, vec![tri(0, skinned, 9)])], + }; + d.lods[1] = OfLod { distance: 200.0, models: vec![model(false, vec![tri(1, fixed, 3)])] }; + d +} + +#[test] +fn drawable_round_trip() { + let d = sample(); + let files = export_odr(&d); + let paths: Vec<&str> = files.iter().map(|f| f.path.as_str()).collect(); + for p in [ + "prop_thing.odr", + "prop_thing/prop_thing.skel", + "prop_thing/prop_thing_high_0.mesh", + "prop_thing/prop_thing_high_1.mesh", + "prop_thing/prop_thing_med.mesh", + "prop_thing/prop_thing.otd", + "prop_thing/prop_thing_d.otx", + "prop_thing/prop_thing_d.dds", + ] { + assert!(paths.contains(&p), "{p} missing from {paths:?}"); + } + let odr = text_of(&files, "prop_thing.odr"); + assert!(odr.starts_with("Version 165 32\r\n{\r\n\tShaders\r\n")); + assert!(odr.contains("\t\tnormal_spec.sps\r\n")); + assert!(odr.contains("\t\t\tBumpiness 1.50000000\r\n")); + assert!(odr.contains("\tSkeleton prop_thing\\prop_thing.skel\r\n")); + assert!(odr.contains("\tTextureDictionary prop_thing\\prop_thing.otd\r\n")); + // The fixed model sits on "leg", the third bone in the tree. + assert!(odr.contains("\t\t\tprop_thing\\prop_thing_high_0.mesh 3\r\n"), "{odr}"); + assert!(odr.contains("\t\tMed 200.00000000\r\n")); + assert!(odr.contains("\t\tLow 9998.00000000\r\n\t\tVlow")); + let skel = text_of(&files, "prop_thing/prop_thing.skel"); + assert!(skel.contains("\tNumBones 4\r\n\tBone root 0\r\n")); + assert!(skel.contains("\t\tFlags ROT_X ROT_Y ROT_Z TRANS_X TRANS_Y TRANS_Z\r\n")); + assert!(skel.contains("\t\tChildren 2\r\n")); + let mesh = text_of(&files, "prop_thing/prop_thing_high_1.mesh"); + assert!(mesh.contains("\tSkinned True\r\n\tBoneCount 3\r\n\tMask 255\r\n")); + assert!(mesh.contains("VertexDeclaration S9445853F")); + // Blend index 2 ("leg") is the fourth bone in the tree. + assert!(mesh.contains(" / 0 0 3 1 / "), "{mesh}"); + assert!(mesh.contains("\t\t\t\t0 1 2 3 4 5 6 7 8\r\n")); + let otx = text_of(&files, "prop_thing/prop_thing_d.otx"); + assert!(otx.contains( + "\tImage prop_thing_d.dds\r\n\tType Regular\r\n\tPixelFormat DXT1\r\n\tLevels 1\r\n\tUsage DIFFUSE\r\n" + )); + + let src = files_source(&files); + let back = parse_odr(&src, "prop_thing.odr").unwrap(); + assert_eq!(difference(&d, &back), None); + assert_eq!( + back.skeleton.as_ref().unwrap().bones.iter().map(|b| b.name.as_str()).collect::>(), + ["root", "arm", "hand", "leg"] + ); +} + +#[test] +fn differences_are_found() { + let d = sample(); + let files = export_odr(&d); + let src = files_source(&files); + let back = parse_odr(&src, "prop_thing.odr").unwrap(); + let mut moved = back.clone(); + moved.lods[0].models[0].geometries[0].attributes[0].1[2][1] += 0.01; + assert!(difference(&d, &moved).unwrap().contains("vertex component 0")); + let mut reshaded = back.clone(); + reshaded.shaders[0].params[2].1 = OfValue::Floats(vec![2.0]); + assert!(difference(&d, &reshaded).unwrap().contains("Bumpiness")); + let mut rebound = back.clone(); + rebound.lods[0].models[1].geometries[0].attributes[2].1[0][2] = 1.0; + assert!(difference(&d, &rebound).is_some()); + let mut retextured = back; + retextured.textures[0].texture.data[0] ^= 1; + assert!(difference(&d, &retextured).is_some()); +} + +#[test] +fn files_with_errors() { + let files = export_odr(&sample()); + let edit = |path: &str, f: &dyn Fn(&str) -> String| -> Vec { + files + .iter() + .map(|x| { + let data = + if x.path == path { f(std::str::from_utf8(&x.data).unwrap()).into_bytes() } else { x.data.clone() }; + ExportedFile { path: x.path.clone(), data } + }) + .collect() + }; + let parse = + |files: &[ExportedFile]| parse_odr(&files_source(files), "prop_thing.odr").map(|_| ()).unwrap_err().to_string(); + let e = parse(&edit("prop_thing/prop_thing_med.mesh", &|t| t.replacen(" / ", " ", 1))); + assert!(e.contains("prop_thing_med.mesh") && e.contains("vertex components"), "{e}"); + let e = parse(&edit("prop_thing/prop_thing_med.mesh", &|t| t.replace("\t\t\t\t0 1 2\r\n", "\t\t\t\t0 1 7\r\n"))); + assert!(e.contains("index 7"), "{e}"); + let e = parse(&edit("prop_thing/prop_thing_med.mesh", &|t| t.replace("N51263BB5", "N0BADC0DE"))); + assert!(e.contains("not known"), "{e}"); + let e = parse(&edit("prop_thing.odr", &|t| t.replace("prop_thing_med.mesh", "missing.mesh"))); + assert!(e.contains("missing.mesh"), "{e}"); +} + +#[test] +fn paths_with_backslashes() { + assert_eq!(parse::resolve("a/b", "c\\d.mesh"), "a/b/c/d.mesh"); + assert_eq!(parse::resolve("a/b", "..\\c.otx"), "a/c.otx"); + assert_eq!(parse::resolve("", "x/./y.dds"), "x/y.dds"); +} + +#[test] +fn dictionaries_and_fragments() { + let mut a = sample(); + a.name = "head_000_r".into(); + let mut b = sample(); + b.name = "hash_00C0FFEE".into(); + b.skeleton = None; + for m in b.lods.iter_mut().flat_map(|l| &mut l.models) { + m.bone = 0; + } + let files = export_odd("ped_parts", &[a.clone(), b.clone()]); + let odd = text_of(&files, "ped_parts.odd"); + assert!(odd.contains("\tped_parts\\head_000_r.odr\r\n\tped_parts\\hash_00c0ffee.odr\r\n"), "{odd}"); + let back = parse_odd(&files_source(&files), "ped_parts.odd").unwrap(); + assert_eq!(back.len(), 2); + assert_eq!(difference(&a, &back[0]), None); + assert_eq!(difference(&b, &back[1]), None); + + let f = OfFragment { drawable: a.clone(), children: vec![(1234, b.clone()), (5678, b.clone())] }; + let files = export_oft(&f); + let oft = text_of(&files, "head_000_r.oft"); + assert!(oft.starts_with("Version 162 30\r\n{\r\n\tDrawable\r\n\t{\r\n\t\tShaders\r\n"), "{oft}"); + assert!(oft.contains("\t\t\tBoneTag 5678\r\n")); + let back = parse_oft(&files_source(&files), "head_000_r.oft").unwrap(); + assert_eq!(difference(&f.drawable, &back.drawable), None); + assert_eq!(back.children.iter().map(|c| c.0).collect::>(), [1234, 5678]); + for (_, c) in &back.children { + assert_eq!(difference(&b, c), None); + } + + let textures = sample().textures; + let files = export_otd("prop_textures", &textures); + assert!(text_of(&files, "prop_textures.otd").contains("\tprop_textures\\prop_thing_d.otx\r\n")); + let back = parse_otd(&files_source(&files), "prop_textures.otd").unwrap(); + assert_eq!(back.len(), 1); + // Names come from the file names (lowercase); the game finds textures by name in any case. + assert_eq!(texture_difference(&textures[0].texture, &back[0].texture), None); +} + +/// A real drawable from the model writer's test template: read, written as +/// text, read back. +#[test] +fn from_a_resource() { + let res: Resource = crate::ydr_write::tests::template_with(2, true); + let d = read_ydr(&res, "template").unwrap(); + assert_eq!(d.shaders.len(), 2); + assert_eq!(d.textures.len(), 1); + assert_eq!(d.lods[0].models[0].geometries.len(), 2); + let g = &d.lods[0].models[0].geometries[0]; + assert_eq!(g.decl.flags, 0x4059, "position, normal, colour, uv, tangent"); + assert_eq!(g.attribute(component::POSITION).unwrap()[1], [1.0, 0.0, 0.0, 0.0]); + let files = export_odr(&d); + let back = parse_odr(&files_source(&files), "template.odr").unwrap(); + assert_eq!(difference(&d, &back), None); +} + +#[test] +fn enhanced_parameter_names() { + assert_eq!(read::legacy_texture_param("DiffuseTex"), "DiffuseSampler"); + assert_eq!(read::legacy_texture_param("DiffuseTex2"), "DiffuseSampler2"); + assert_eq!(read::legacy_texture_param("SpecularTex"), "SpecSampler"); + assert_eq!(read::legacy_texture_param("DamageTexture"), "DamageSampler"); + assert_eq!(read::legacy_texture_param("hash_12345678"), "hash_12345678"); +} + +#[test] +fn texture_names_from_file_names() { + for name in ["generic_ cav_detail_dash", "font_?", "font_!", "font_specailcharacter_,", "a%b", "Prop_Thing_D"] { + let stem = file_stem(name); + assert!(stem.bytes().all(|b| b.is_ascii_alphanumeric() || b"_-.+%".contains(&b)), "{stem}"); + assert!(same_texture_name(name, &name_of_file_stem(&stem)), "{name} → {stem}"); + } + assert_eq!(file_stem("generic_ cav_detail_dash"), "generic_%20cav_detail_dash"); + assert_ne!(file_stem("font_?"), file_stem("font_!")); + assert!(!same_texture_name("prop_thing_d", "prop_thing_n")); +} + +#[test] +fn usages() { + for code in 0..32u8 { + assert_eq!(usage_code(&usage_name(code)), Some(code)); + } + assert_eq!(usage_name(20), "DIFFUSE"); + assert_eq!(usage_name(0), "UNKNOWN"); + assert_eq!(usage_name(7), "USAGE_7"); + assert_eq!(usage_code("nonsense"), None); +} diff --git a/crates/rage-formats/src/openformats/text.rs b/crates/rage-formats/src/openformats/text.rs new file mode 100644 index 0000000..e9b2614 --- /dev/null +++ b/crates/rage-formats/src/openformats/text.rs @@ -0,0 +1,173 @@ +//! The text layer of openFormats: indented `Key values` lines and blocks in +//! braces. + +use rage_resource::ResourceError; + +use crate::drawable::bad; + +/// Writes lines indented with tabs, as OpenIV does. +#[derive(Default)] +pub(crate) struct Writer { + pub(crate) out: String, + depth: usize, +} + +impl Writer { + pub(crate) fn line(&mut self, text: impl AsRef) { + for _ in 0..self.depth { + self.out.push('\t'); + } + self.out.push_str(text.as_ref()); + self.out.push_str("\r\n"); + } + + pub(crate) fn open(&mut self) { + self.line("{"); + self.depth += 1; + } + + pub(crate) fn close(&mut self) { + self.depth = self.depth.saturating_sub(1); + self.line("}"); + } + + /// `name` followed by a block that `body` fills. + pub(crate) fn block(&mut self, name: impl AsRef, body: impl FnOnce(&mut Self)) { + self.line(name); + self.open(); + body(self); + self.close(); + } +} + +/// A number as OpenIV writes it: rounded to seven significant digits (what +/// a float holds), with eight decimals. +pub(crate) fn num(v: f32) -> String { + if v == 0.0 || !v.is_finite() { + return if v.is_finite() { "0.00000000".to_owned() } else { format!("{v}") }; + } + let rounded: f64 = format!("{v:.6e}").parse().unwrap_or(f64::from(v)); + format!("{rounded:.8}") +} + +pub(crate) fn nums(v: &[f32]) -> String { + v.iter().map(|&x| num(x)).collect::>().join(" ") +} + +/// A line and, if a block follows it, the block's lines. +#[derive(Debug, Clone)] +pub(crate) struct Node { + /// The line's words. + pub(crate) words: Vec, + pub(crate) children: Option>, + /// Line number (1-based) for messages. + pub(crate) line: usize, +} + +impl Node { + pub(crate) fn key(&self) -> &str { + self.words.first().map_or("", String::as_str) + } + + /// The words after the key. + pub(crate) fn args(&self) -> &[String] { + self.words.get(1..).unwrap_or(&[]) + } + + pub(crate) fn arg(&self, i: usize) -> Result<&str, ResourceError> { + self.args() + .get(i) + .map(String::as_str) + .ok_or_else(|| bad(format!("line {}: {} needs a value", self.line, self.key()))) + } + + pub(crate) fn children(&self) -> &[Node] { + self.children.as_deref().unwrap_or(&[]) + } + + /// The first child with this key (case-insensitive). + pub(crate) fn get(&self, key: &str) -> Option<&Node> { + self.children().iter().find(|n| n.key().eq_ignore_ascii_case(key)) + } + + pub(crate) fn all<'a>(&'a self, key: &'a str) -> impl Iterator + 'a { + self.children().iter().filter(move |n| n.key().eq_ignore_ascii_case(key)) + } + + pub(crate) fn floats(&self) -> Result, ResourceError> { + self.args().iter().map(|w| parse_f32(w, self.line)).collect() + } + + pub(crate) fn float(&self) -> Result { + parse_f32(self.arg(0)?, self.line) + } + + pub(crate) fn vec3(&self) -> Result<[f32; 3], ResourceError> { + let v = self.floats()?; + v.get(..3) + .map(|s| [s[0], s[1], s[2]]) + .ok_or_else(|| bad(format!("line {}: {} needs three numbers", self.line, self.key()))) + } + + pub(crate) fn int(&self) -> Result { + let w = self.arg(0)?; + w.parse().map_err(|_| bad(format!("line {}: {w} is not a whole number", self.line))) + } + + pub(crate) fn bool(&self) -> Result { + Ok(self.arg(0)?.eq_ignore_ascii_case("true")) + } +} + +pub(crate) fn parse_f32(w: &str, line: usize) -> Result { + w.parse().map_err(|_| bad(format!("line {line}: {w} is not a number"))) +} + +/// The block of the file's `Version` line. +pub(crate) struct Document { + pub(crate) root: Node, +} + +/// Splits a file into lines and blocks. +pub(crate) fn parse(text: &str) -> Result { + let text = text.strip_prefix('\u{feff}').unwrap_or(text); + // Stack of open blocks; the bottom one collects the top level. + let mut stack: Vec> = vec![Vec::new()]; + for (i, raw) in text.lines().enumerate() { + let line = raw.trim(); + if line.is_empty() { + continue; + } + match line { + "{" => { + if stack.last().is_none_or(|b| b.is_empty()) { + return Err(bad(format!("line {}: a block without a name", i + 1))); + } + stack.push(Vec::new()); + } + "}" => { + let children = stack.pop().filter(|_| !stack.is_empty()); + let (Some(children), Some(parent)) = (children, stack.last_mut()) else { + return Err(bad(format!("line {}: a closing brace too many", i + 1))); + }; + parent.last_mut().expect("checked when opening").children = Some(children); + } + _ => { + let words = line.split_whitespace().map(str::to_owned).collect(); + stack.last_mut().expect("bottom").push(Node { words, children: None, line: i + 1 }); + } + } + } + if stack.len() != 1 { + return Err(bad("the file ends inside a block")); + } + let top = stack.pop().expect("bottom"); + let version = top.first().filter(|n| n.key().eq_ignore_ascii_case("Version")); + let Some(node) = version else { return Err(bad("the file does not start with a Version line")) }; + node.arg(0)?.parse::().map_err(|_| bad(format!("line {}: bad Version line", node.line)))?; + let root = Node { words: Vec::new(), children: node.children.clone(), line: node.line }; + if root.children.is_none() { + return Err(bad("the Version line has no block")); + } + Ok(Document { root }) +} diff --git a/crates/rage-formats/src/openformats/write.rs b/crates/rage-formats/src/openformats/write.rs new file mode 100644 index 0000000..1256011 --- /dev/null +++ b/crates/rage-formats/src/openformats/write.rs @@ -0,0 +1,370 @@ +//! Writing the openFormats model as text files. + +use super::text::{Writer, num, nums}; +use super::*; +use crate::texture::{Dimension, Format}; + +/// A file to write, at a path relative to the export folder (`/`-separated). +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ExportedFile { + pub path: String, + pub data: Vec, +} + +fn version(w: &mut Writer, (major, minor): (u32, u32)) { + w.line(format!("Version {major} {minor}")); +} + +/// Joins folder parts with `/` (files) or `\` (paths inside the text). +fn join(sep: char, parts: &[&str]) -> String { + parts.iter().filter(|p| !p.is_empty()).copied().collect::>().join(&sep.to_string()) +} + +/// Whether a texture name read back from a file name (`.otx`) is the texture +/// `name`: file names are lowercase. +pub fn same_texture_name(name: &str, from_file: &str) -> bool { + name.eq_ignore_ascii_case(from_file) +} + +/// A file name for a texture or drawable name: lowercase, other characters +/// than letters, digits and `_-.+` as `%` and their hex code (spaces would +/// split the lines that name the file, `?` and `*` are not allowed on +/// Windows); [`name_of_file_stem`] turns it back. +pub fn file_stem(name: &str) -> String { + let mut s = String::with_capacity(name.len()); + for b in name.bytes() { + if b.is_ascii_alphanumeric() || b"_-.+".contains(&b) { + s.push(b.to_ascii_lowercase() as char); + } else { + s.push_str(&format!("%{b:02x}")); + } + } + if s.is_empty() { "unnamed".to_owned() } else { s } +} + +/// The name a file stem stands for ([`file_stem`]). +pub fn name_of_file_stem(stem: &str) -> String { + let b = stem.as_bytes(); + let mut out = Vec::with_capacity(b.len()); + let mut i = 0; + while i < b.len() { + let hex = (b[i] == b'%').then(|| stem.get(i + 1..i + 3)).flatten().and_then(|h| u8::from_str_radix(h, 16).ok()); + match hex { + Some(v) => { + out.push(v); + i += 3; + } + None => { + out.push(b[i]); + i += 1; + } + } + } + String::from_utf8_lossy(&out).into_owned() +} + +/// A drawable (`.ydr`): `.odr` and the folder `/` with its +/// meshes, skeleton and embedded textures. +pub fn export_odr(d: &OfDrawable) -> Vec { + let mut files = Vec::new(); + odr_file(d, "", &mut files); + files +} + +fn odr_file(d: &OfDrawable, base: &str, files: &mut Vec) -> String { + let stem = file_stem(&d.name); + let mut w = Writer::default(); + version(&mut w, VERSION_DRAWABLE); + w.open(); + drawable_body(&mut w, d, &stem, base, &stem, files); + w.close(); + let path = join('/', &[base, &format!("{stem}.odr")]); + files.push(ExportedFile { path: path.clone(), data: w.out.into_bytes() }); + path +} + +/// The contents of a drawable block. Its files go into the folder `dir` +/// (relative to the text file, which is in `base`); they are named after `stem`. +fn drawable_body(w: &mut Writer, d: &OfDrawable, dir: &str, base: &str, stem: &str, files: &mut Vec) { + let folder = join('/', &[base, dir]); + let rank = d.skeleton.as_ref().map(bone_ranks).unwrap_or_default(); + let remap = |b: usize| rank.get(b).copied().unwrap_or(b); + w.block("Shaders", |w| { + for s in &d.shaders { + w.block(format!("{}.sps", s.name), |w| { + for (name, value) in &s.params { + match value { + OfValue::Texture(t) => w.line(format!("{name} {}", if t.is_empty() { "null" } else { t })), + OfValue::Floats(v) => w.line(format!("{name} {}", nums(v))), + } + } + }); + } + }); + if !d.textures.is_empty() { + let otd = format!("{stem}.otd"); + files.extend(textures_files(&d.textures, &folder, &otd, "")); + w.line(format!("TextureDictionary {}", join('\\', &[dir, &otd]))); + } + match &d.skeleton { + Some(s) => { + let skel = format!("{stem}.skel"); + files.push(ExportedFile { path: join('/', &[&folder, &skel]), data: skeleton_text(s).into_bytes() }); + w.line(format!("Skeleton {}", join('\\', &[dir, &skel]))); + } + None => w.line("Skeleton null"), + } + w.block("LodGroup", |w| { + w.line(format!("Center {}", nums(&d.center))); + w.line(format!("Radius {}", num(d.radius))); + w.line(format!("AABBMin {}", nums(&d.aabb_min))); + w.line(format!("AABBMax {}", nums(&d.aabb_max))); + for (k, lod) in d.lods.iter().enumerate() { + w.line(format!("{} {}", LOD_NAMES[k], num(lod.distance))); + if lod.models.is_empty() { + continue; + } + w.open(); + for (i, m) in lod.models.iter().enumerate() { + let level = LOD_NAMES[k].to_ascii_lowercase(); + let mesh = if lod.models.len() == 1 { + format!("{stem}_{level}.mesh") + } else { + format!("{stem}_{level}_{i}.mesh") + }; + files + .push(ExportedFile { path: join('/', &[&folder, &mesh]), data: mesh_text(m, &remap).into_bytes() }); + w.line(format!("{} {}", join('\\', &[dir, &mesh]), remap(m.bone as usize))); + } + w.close(); + } + }); + w.line("Joints null"); + w.line("Light null"); + w.line("Bound null"); +} + +/// Children of every bone, in index order, and the roots. +fn bone_tree(s: &OfSkeleton) -> (Vec>, Vec) { + let n = s.bones.len(); + let mut children = vec![Vec::new(); n]; + let mut roots = Vec::new(); + for i in 0..n { + match usize::try_from(s.bones[i].parent).ok().filter(|&p| p < i) { + Some(p) => children[p].push(i), + None => roots.push(i), + } + } + (children, roots) +} + +/// Where each bone ends up in the `.skel` file, which lists the bones as a +/// tree (depth first): usually where it already is. +pub(crate) fn bone_ranks(s: &OfSkeleton) -> Vec { + let (children, roots) = bone_tree(s); + let mut rank = vec![0; s.bones.len()]; + let mut next = 0; + let mut stack: Vec = roots.into_iter().rev().collect(); + while let Some(b) = stack.pop() { + rank[b] = next; + next += 1; + stack.extend(children[b].iter().rev()); + } + rank +} + +fn skeleton_text(s: &OfSkeleton) -> String { + let mut w = Writer::default(); + version(&mut w, VERSION_SKELETON); + w.open(); + w.line(format!("DataCRC {}", s.crc)); + w.line(format!("NumBones {}", s.bones.len())); + fn bone(w: &mut Writer, s: &OfSkeleton, i: usize, children: &[Vec]) { + let b = &s.bones[i]; + w.block(format!("Bone {} {}", if b.name.is_empty() { "unnamed" } else { &b.name }, b.tag), |w| { + w.line(format!("MirrorBoneId {}", b.mirror)); + let flags: Vec<&str> = BONE_FLAGS.iter().filter(|(bit, _)| b.flags & bit != 0).map(|(_, n)| *n).collect(); + w.line(format!("Flags {}", if flags.is_empty() { "-".to_owned() } else { flags.join(" ") })); + w.line(format!("RotationQuaternion {}", nums(&b.rotation))); + w.line(format!("LocalOffset {}", nums(&b.translation))); + w.line(format!("Scale {}", nums(&b.scale))); + if !children[i].is_empty() { + w.block(format!("Children {}", children[i].len()), |w| { + for &c in &children[i] { + bone(w, s, c, children); + } + }); + } + }); + } + let (children, roots) = bone_tree(s); + for r in roots { + bone(&mut w, s, r, &children); + } + w.close(); + w.out +} + +fn mesh_text(m: &OfModel, remap: &dyn Fn(usize) -> usize) -> String { + let mut w = Writer::default(); + version(&mut w, VERSION_DRAWABLE); + w.open(); + w.line("Locked False"); + w.line(format!("Skinned {}", if m.skinned { "True" } else { "False" })); + w.line(format!("BoneCount {}", m.bone_count)); + w.line(format!("Mask {}", m.mask)); + w.block("Bounds", |w| { + for (min, max) in &m.bounds { + w.block("Aabb", |w| { + w.line(format!("Min {}", nums(min))); + w.line(format!("Max {}", nums(max))); + }); + } + }); + w.block("Geometries", |w| { + for g in &m.geometries { + w.block("Geometry", |w| { + w.line(format!("ShaderIndex {}", g.shader)); + w.line("Flags -"); + w.line(format!("VertexDeclaration {}", g.decl.code())); + w.block(format!("Indices {}", g.indices.len()), |w| { + for row in g.indices.chunks(15) { + w.line(row.iter().map(u32::to_string).collect::>().join(" ")); + } + }); + let types: Vec<(usize, u8)> = g.decl.components().collect(); + w.block(format!("Vertices {}", g.vertex_count()), |w| { + let mut line = String::new(); + for i in 0..g.vertex_count() { + line.clear(); + for (n, (k, values)) in g.attributes.iter().enumerate() { + if n > 0 { + line.push_str(" / "); + } + let ty = types.iter().find(|(c, _)| c == k).map_or(7, |t| t.1); + let width = VertexDecl::width(*k, ty); + let mut v = values[i]; + if *k == component::BLEND_INDICES { + v = v.map(|b| remap(b as usize) as f32); + } + let v = &v[..width]; + if VertexDecl::integral(*k) { + let ints: Vec = v.iter().map(|x| (x.round() as i64).to_string()).collect(); + line.push_str(&ints.join(" ")); + } else { + line.push_str(&nums(v)); + } + } + w.line(&line); + } + }); + }); + } + }); + w.close(); + w.out +} + +/// A fragment (`.yft`): `.oft` with the main drawable and the parts, +/// their files in the folder `/`. +pub fn export_oft(f: &OfFragment) -> Vec { + let stem = file_stem(&f.drawable.name); + let mut files = Vec::new(); + let mut w = Writer::default(); + version(&mut w, VERSION_FRAGMENT); + w.open(); + w.block("Drawable", |w| drawable_body(w, &f.drawable, &stem, "", &stem, &mut files)); + if !f.children.is_empty() { + w.block("Children", |w| { + for (tag, d) in &f.children { + w.block("Child", |w| { + w.line(format!("BoneTag {tag}")); + w.block("Drawable", |w| drawable_body(w, d, &stem, "", &file_stem(&d.name), &mut files)); + }); + } + }); + } + w.close(); + files.push(ExportedFile { path: format!("{stem}.oft"), data: w.out.into_bytes() }); + files +} + +/// A drawable dictionary (`.ydd`): `.odd` and one `.odr` per drawable +/// in the folder `/`. +pub fn export_odd(name: &str, drawables: &[OfDrawable]) -> Vec { + let stem = file_stem(name); + let mut files = Vec::new(); + let mut w = Writer::default(); + version(&mut w, VERSION_DRAWABLE); + w.open(); + for d in drawables { + let path = odr_file(d, &stem, &mut files); + w.line(path.replace('/', "\\")); + } + w.close(); + files.push(ExportedFile { path: format!("{stem}.odd"), data: w.out.into_bytes() }); + files +} + +/// A texture dictionary (`.ytd`): `.otd` and the folder `/` with +/// one `.otx` and `.dds` per texture. +pub fn export_otd(name: &str, textures: &[OfTexture]) -> Vec { + let stem = file_stem(name); + textures_files(textures, "", &format!("{stem}.otd"), &stem) +} + +/// The `.otd` at `base/otd` listing textures in `base/dir`. +fn textures_files(textures: &[OfTexture], base: &str, otd: &str, dir: &str) -> Vec { + let mut files = Vec::new(); + let mut w = Writer::default(); + version(&mut w, VERSION_TEXTURES); + w.open(); + for t in textures { + let t = &t.texture; + let stem = file_stem(&t.name); + let folder = join('/', &[base, dir]); + files.push(ExportedFile { path: join('/', &[&folder, &format!("{stem}.dds")]), data: crate::dds::to_dds(t) }); + let mut x = Writer::default(); + version(&mut x, VERSION_TEXTURES); + x.open(); + x.line(format!("Image {stem}.dds")); + x.line(format!( + "Type {}", + match t.dimension { + Dimension::Texture2D => "Regular", + Dimension::Cube => "Cube", + Dimension::Texture3D => "Volume", + } + )); + x.line(format!("PixelFormat {}", pixel_format(t.format))); + x.line(format!("Levels {}", t.levels)); + x.line(format!("Usage {}", usage_name(t.usage))); + x.line("UsageFlags -"); + x.line("ExtraFlags 0"); + x.close(); + files.push(ExportedFile { path: join('/', &[&folder, &format!("{stem}.otx")]), data: x.out.into_bytes() }); + w.line(join('\\', &[dir, &format!("{stem}.otx")])); + } + w.close(); + files.push(ExportedFile { path: join('/', &[base, otd]), data: w.out.into_bytes() }); + files +} + +/// Pixel format names as OpenIV writes them (Direct3D 9 style where there is one). +fn pixel_format(f: Format) -> String { + match f { + Format::BC1_UNORM => "DXT1".into(), + Format::BC2_UNORM => "DXT3".into(), + Format::BC3_UNORM => "DXT5".into(), + Format::BC4_UNORM => "ATI1".into(), + Format::BC5_UNORM => "ATI2".into(), + Format::B8G8R8A8_UNORM => "A8R8G8B8".into(), + Format::B8G8R8X8_UNORM => "X8R8G8B8".into(), + Format::R8G8B8A8_UNORM => "A8B8G8R8".into(), + Format::B5G5R5A1_UNORM => "A1R5G5B5".into(), + Format::B5G6R5_UNORM => "R5G6B5".into(), + Format::A8_UNORM => "A8".into(), + Format::R8_UNORM => "L8".into(), + other => other.name(), + } +} diff --git a/crates/rage-formats/src/ydr_write.rs b/crates/rage-formats/src/ydr_write.rs index b6ac4bf..76df957 100644 --- a/crates/rage-formats/src/ydr_write.rs +++ b/crates/rage-formats/src/ydr_write.rs @@ -877,6 +877,32 @@ pub fn replace_parts(template: &Resource, parts: &[Part], donor: Option<&Resourc build(template, parts, donor) } +/// The drawable (or fragment) `template` with embedded textures replaced +/// (same name, any size or format) or added; everything else stays as it is. +/// The textures are found by name, so shaders bound to a replaced texture +/// show the new one. +pub fn replace_embedded_textures(template: &Resource, textures: &[Texture]) -> Result, ResourceError> { + check_template(template)?; + let group = template.u64(drawable_root(template)? + 0x10)?; + if group == 0 { + return Err(bad("the model has no shader group")); + } + let mut b = Builder::new(); + let sys = b.add(Segment::System, template.system.clone()); + if !template.graphics.is_empty() { + b.add(Segment::Graphics, template.graphics.clone()); + } + b.add_pages_info(sys, 0x08); + let mut list = Vec::new(); + for t in textures { + let mut name = t.name.clone().into_bytes(); + name.push(0); + list.push((t.clone(), b.add(Segment::System, name))); + } + add_textures(&mut b, sys, template, group, list, None)?; + b.build(template.version) +} + /// Whether `res` (an Enhanced drawable, fragment or texture dictionary) has a texture /// structure that [`replace_with_materials`] can copy (as the `donor`). pub fn can_donate_textures(res: &Resource) -> bool { diff --git a/site/content/cli.md b/site/content/cli.md index c3925ff..a4bb7b4 100644 --- a/site/content/cli.md +++ b/site/content/cli.md @@ -77,6 +77,7 @@ openrage textures …/prop_x.ydr [--set name=new.dds] # a model's own t openrage model …/vehicles.rpf/adder.yft # meshes, shaders, textures openrage model …/adder.yft --export adder.glb # glTF with embedded textures openrage model …/adder.yft --render adder.png [--yaw 1.2] # software-rendered image +openrage export-openformats …/prop_x.ydr -o out/ # OpenIV openFormats: .odr/.oft/.odd/.otd + .mesh, .skel, .dds openrage audio x64/audio/sfx/RADIO_02_POP.rpf/alright.awc --export out/ # sounds → .wav openrage clips x64c.rpf/anim/ingame/clip_move_.rpf/move_m@generic.ycd # clips of a .ycd openrage model …/a_m_y_hipster_01.ydd --render pose.png --anim "…/move_m@generic.ycd:walk@0.5" @@ -122,6 +123,7 @@ openrage replace-model …/a_m_y_hipster_01.ydd ped.obj --mods # a dictionar openrage replace-model …/a_m_y_hipster_01.ydd shirt.obj --drawable uppr_000_r --out new.ydd # the whole OBJ on one drawable openrage replace-model …/prop_x.ydr model.obj --collision col.obj --mods # with a collision built from col.obj openrage replace-model …/hei_ch3_12_0.ybn col.obj --out new.ybn # a collision file from an OBJ +openrage import-openformats x64i.rpf/…/prop_x.ydr out/prop_x.odr --mods # edited openFormats back into the game (.odr, .oft, .otd) openrage oiv info mod.oiv # what a package would change openrage oiv install mod.oiv # install into the mods folder openrage oiv list / oiv uninstall "Name 1.0" [-y] # installed packages, uninstall @@ -178,6 +180,7 @@ openrage verify --textures [--rebuild] # decode (and rebuild) every text openrage verify --models # parse every model of the game openrage verify --models --rebuild # write every Enhanced .ydr, .yft (with wheels) and .ydd anew, read back identical openrage verify --collisions --rebuild # write every Enhanced collision (.ybn, in .ydr) anew from its triangles +openrage verify --models --openformats # every model and .ytd as openFormats and back; Enhanced models imported onto themselves openrage verify --audio # decode every sound of the game openrage verify --animations # parse every clip dictionary, evaluate all frames openrage verify --meta # convert every metadata file of the game diff --git a/site/content/modding.md b/site/content/modding.md index 1805634..11a16f4 100644 --- a/site/content/modding.md +++ b/site/content/modding.md @@ -113,6 +113,42 @@ How it works: `.ydr`, `.yft` with its wheel models and every drawable of every `.ydd` of the game, with all bone weights, also with shader copies and embedded textures); please report how they behave in the game. +### openFormats (OpenIV) + +OpenIV's text formats go both ways: export a model or texture dictionary, edit the text files or textures (in a text +editor, a script or a tool that reads openFormats), and import them back. + +- **In the explorer:** right-click a `.ydr`, `.yft`, `.ydd` or `.ytd` → **Export openFormats…** and choose a folder. + To bring the files back, unlock editing, right-click the same file → **Import openFormats…** and pick the `.odr`, + `.oft` or `.otd`. The change goes into the `mods` folder and is one entry in **History**. +- **From the command line:** `openrage export-openformats x64i.rpf/levels/gta5/props/…/prop_x.ydr -o out/`, then + `openrage import-openformats x64i.rpf/levels/gta5/props/…/prop_x.ydr out/prop_x.odr --mods` (or `--out new.ydr`). + +What an import takes over (GTA V Enhanced models; texture dictionaries of both versions): + +- **Meshes and detail levels** of the `.mesh` files: positions, normals, colours, texture coordinates and, for + vehicles, the bone each vertex moves with. They are written like an OBJ import (above): every geometry keeps a + shader of the model and its vertex layout; meshes attached to other bones are moved onto the model's. +- **Textures:** changed `.dds` files of a model's own textures replace them (any size and format); a `.otd` onto a + `.ytd` replaces, adds and removes textures. +- **Kept from the game file:** the shaders (an `.odr` must name the model's shaders; changed parameters are reported + and not taken over), the skeleton, the physics and the parts of a fragment (wheels), collisions. Unchanged meshes + stay as they are, so a texture edit changes only the texture. `.odd` files cannot be imported yet. +- The import says what it took over and what it kept (status bar and **History**, or the command's output). + +The files follow OpenIV's own exports (a prop exported by OpenRAGE matches OpenIV's `.odr`, `.mesh` and `.skel` +line for line, apart from the last digit of some numbers). Not taken from OpenIV, so possibly different there: the +embedded texture dictionary line of an `.odr`, the `.oft` layout (OpenRAGE writes the main drawable and its parts, +not the physics) and vertex layouts OpenIV's exports have not shown, which OpenRAGE names with their layout +(`N40597755555555996996`) instead of OpenIV's code. Whether OpenIV reads OpenRAGE's exports has not been tested yet. + +**Checked** on GTA V Enhanced with `openrage verify --models --openformats`: all 258,595 models and texture +dictionaries of the game (248 GB of text) are written as openFormats and read back unchanged, apart from one texture +stored as a cube map with 32 slices, which DDS cannot hold. 144,907 drawables and fragments are imported back onto +themselves and read back with the same meshes, shaders, bones and textures; 749 more (mostly race track and stunt +props) use shaders for some meshes that no geometry of the model shows the writer how to fill, so they cannot be +written yet. + ### Vehicles A vehicle body is one model on the vehicle's skeleton: every part moves with a bone (doors, bonnet, boot, bumpers). diff --git a/site/content/viewers.md b/site/content/viewers.md index 67c4e9b..cc22082 100644 --- a/site/content/viewers.md +++ b/site/content/viewers.md @@ -20,6 +20,7 @@ Texture dictionaries (`.ytd`) open like folders: double-click one to list its te - Selecting a texture shows it in the preview; selecting a `.ytd` previews its first texture. - **Extract…** writes DDS files exactly like OpenIV and CodeWalker (DX10 headers for BC7 and other modern formats). - **Save PNG…** writes images. +- **Export openFormats…** on a `.ytd` writes it as OpenIV's `.otd` with a `.dds` and `.otx` per texture. - With nothing selected, the whole dictionary is exported into a folder named after it. ### Supported layouts @@ -65,6 +66,13 @@ software fallback. **Export glTF…** writes a binary glTF 2.0 file (`.glb`) with one node per shown part and the textures embedded. Blender and most other 3D tools open it directly. +**Export openFormats…** (right-click a `.ydr`, `.yft`, `.ydd` or `.ytd`) writes OpenIV's text formats: `.odr` +(drawable), `.oft` (fragment), `.odd` (drawable dictionary) or `.otd` (texture dictionary), with the meshes (`.mesh`), +the skeleton (`.skel`) and the textures (`.otx` with a `.dds` each) in a folder named after the file. Every shader with +its parameters, every detail level, every geometry with all its vertex data (positions, bone weights, colours, all +texture coordinates, tangents) is in there, readable and editable as text, and the files go back into the game with +**Import openFormats…** (see [Modding](@/modding.md#openformats-openiv)). + ## Animations Clip dictionaries (`.ycd`) show what they animate (peds, vehicles, objects) and a list of fitting models, ranked by the From 74a71b923b16899ea05253c787fe22a84765c1e4 Mon Sep 17 00:00:00 2001 From: Philippe Date: Sun, 22 Nov 2026 23:18:34 +0100 Subject: [PATCH 7/8] verify: files of one archive on every core (#143) Every `openrage verify` mode for GTA V and GTA IV now goes through one helper (`for_each_entry_parallel`, `for_each_gta4_entry_parallel`): archive roots are walked in parallel as before, and every matching file goes through a short queue to one worker thread per core, which reads, decompresses and checks it with its own stats. A big archive (all vehicles are in x64e.rpf) no longer leaves the other cores idle. Counts are unchanged; error lists are sorted, since workers finish in any order. Co-authored-by: Claude Opus 5.5 --- crates/openrage-cli/src/cmd/verify.rs | 1307 ++++++++++---------- crates/openrage-cli/src/cmd/verify_gta4.rs | 451 ++++--- 2 files changed, 855 insertions(+), 903 deletions(-) diff --git a/crates/openrage-cli/src/cmd/verify.rs b/crates/openrage-cli/src/cmd/verify.rs index b36a2e4..ac53328 100644 --- a/crates/openrage-cli/src/cmd/verify.rs +++ b/crates/openrage-cli/src/cmd/verify.rs @@ -21,128 +21,110 @@ pub(crate) fn cmd_verify_textures( } let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); - let all: Vec = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut s = Stats::default(); - let mut nested_errors = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - // Models with textures of their own: check the writer in memory. - if rebuild - && openrage_app::textures::gta5_model_ext(p).is_some() - && let rage_rpf::EntryKind::Resource { system_flags, graphics_flags, .. } = a.entry(id).kind - { - let check = a.read_resource(id).map_err(anyhow::Error::from).and_then(|res| { - openrage_app::textures::check_model_textures(&res, p, system_flags, graphics_flags) - }); - match check { - Ok(openrage_app::textures::ModelCheck::Ok { grown }) => { - s.models += 1; - s.grown += grown as usize; - } - Ok(openrage_app::textures::ModelCheck::NoTextures) => {} - Ok(openrage_app::textures::ModelCheck::Unreadable(why)) => { - s.unreadable.push(format!("{p}: {why}")) - } - Err(e) => s.errors.push(format!("{p}: model textures: {e:#}")), - } - return; + let (all, nested) = for_each_entry_parallel( + &starts, + |e| e.resource_version().is_some(), + |a, id, p, s: &mut Stats| { + // Models with textures of their own: check the writer in memory. + if rebuild + && openrage_app::textures::gta5_model_ext(p).is_some() + && let rage_rpf::EntryKind::Resource { system_flags, graphics_flags, .. } = a.entry(id).kind + { + let check = a.read_resource(id).map_err(anyhow::Error::from).and_then(|res| { + openrage_app::textures::check_model_textures(&res, p, system_flags, graphics_flags) + }); + match check { + Ok(openrage_app::textures::ModelCheck::Ok { grown }) => { + s.models += 1; + s.grown += grown as usize; } - if !a.entry(id).name.to_ascii_lowercase().ends_with(".ytd") - || a.entry(id).resource_version().is_none() - { - return; - } - s.dicts += 1; - let dict = match a - .read_resource(id) - .map_err(anyhow::Error::from) - .and_then(|r| Ok(rage_formats::ytd::parse(&r)?)) - { - Ok(d) => d, - Err(e) => return s.errors.push(format!("{p}: {e:#}")), - }; - s.errors.extend(dict.errors.iter().map(|e| format!("{p}: {e}"))); - if rebuild && dict.errors.is_empty() { - let check = rage_formats::ytd_write::rebuild(&dict) - .and_then(|file| rage_resource::Resource::from_rsc7(&file)) - .and_then(|res| rage_formats::ytd::parse(&res)); - match check { - Ok(back) => { - let mut a: Vec<_> = dict - .textures - .iter() - .map(|t| (&t.name, t.width, t.height, t.levels, t.format, &t.data)) - .collect(); - let mut b: Vec<_> = back - .textures - .iter() - .map(|t| (&t.name, t.width, t.height, t.levels, t.format, &t.data)) + Ok(openrage_app::textures::ModelCheck::NoTextures) => {} + Ok(openrage_app::textures::ModelCheck::Unreadable(why)) => s.unreadable.push(format!("{p}: {why}")), + Err(e) => s.errors.push(format!("{p}: model textures: {e:#}")), + } + return; + } + if !a.entry(id).name.to_ascii_lowercase().ends_with(".ytd") || a.entry(id).resource_version().is_none() { + return; + } + s.dicts += 1; + let dict = match a + .read_resource(id) + .map_err(anyhow::Error::from) + .and_then(|r| Ok(rage_formats::ytd::parse(&r)?)) + { + Ok(d) => d, + Err(e) => return s.errors.push(format!("{p}: {e:#}")), + }; + s.errors.extend(dict.errors.iter().map(|e| format!("{p}: {e}"))); + if rebuild && dict.errors.is_empty() { + let check = rage_formats::ytd_write::rebuild(&dict) + .and_then(|file| rage_resource::Resource::from_rsc7(&file)) + .and_then(|res| rage_formats::ytd::parse(&res)); + match check { + Ok(back) => { + let mut a: Vec<_> = dict + .textures + .iter() + .map(|t| (&t.name, t.width, t.height, t.levels, t.format, &t.data)) + .collect(); + let mut b: Vec<_> = back + .textures + .iter() + .map(|t| (&t.name, t.width, t.height, t.levels, t.format, &t.data)) + .collect(); + a.sort_by(|x, y| x.0.cmp(y.0)); + b.sort_by(|x, y| x.0.cmp(y.0)); + if a != b || !back.errors.is_empty() { + s.errors.push(format!("{p}: rebuilt dictionary differs from the original")); + } + // Structures must match byte for byte, apart from pointers. + let pointers: &[(usize, usize)] = match dict.layout { + rage_formats::ytd::Layout::Legacy => &[(0x28, 0x30), (0x70, 0x78)], + rage_formats::ytd::Layout::Enhanced | rage_formats::ytd::Layout::Rdr2 => &[(0x28, 0x40)], + rage_formats::ytd::Layout::Gta4 => &[(0x14, 0x18), (0x48, 0x4C)], + }; + let masked = |t: &[u8]| { + let mut t = t.to_vec(); + for &(from, to) in pointers { + t[from..to].fill(0); + } + t + }; + for (t, st) in dict.textures.iter().zip(&dict.stored) { + let Some(j) = back.textures.iter().position(|x| x.name == t.name) else { continue }; + let (x, y) = (masked(&st.template), masked(&back.stored[j].template)); + if x != y { + let diffs: Vec = (0..x.len()) + .filter(|&i| x[i] != y[i]) + .map(|i| format!("{i:#x}: {:02x}→{:02x}", x[i], y[i])) .collect(); - a.sort_by(|x, y| x.0.cmp(y.0)); - b.sort_by(|x, y| x.0.cmp(y.0)); - if a != b || !back.errors.is_empty() { - s.errors.push(format!("{p}: rebuilt dictionary differs from the original")); - } - // Structures must match byte for byte, apart from pointers. - let pointers: &[(usize, usize)] = match dict.layout { - rage_formats::ytd::Layout::Legacy => &[(0x28, 0x30), (0x70, 0x78)], - rage_formats::ytd::Layout::Enhanced | rage_formats::ytd::Layout::Rdr2 => { - &[(0x28, 0x40)] - } - rage_formats::ytd::Layout::Gta4 => &[(0x14, 0x18), (0x48, 0x4C)], - }; - let masked = |t: &[u8]| { - let mut t = t.to_vec(); - for &(from, to) in pointers { - t[from..to].fill(0); - } - t - }; - for (t, st) in dict.textures.iter().zip(&dict.stored) { - let Some(j) = back.textures.iter().position(|x| x.name == t.name) else { continue }; - let (x, y) = (masked(&st.template), masked(&back.stored[j].template)); - if x != y { - let diffs: Vec = (0..x.len()) - .filter(|&i| x[i] != y[i]) - .map(|i| format!("{i:#x}: {:02x}→{:02x}", x[i], y[i])) - .collect(); - s.errors.push(format!( - "{p}/{}: rebuilt texture structure differs ({}x{} {} mips {}; {})", - t.name, - t.width, - t.height, - t.format.name(), - t.levels, - diffs.join(", ") - )); - break; - } - } + s.errors.push(format!( + "{p}/{}: rebuilt texture structure differs ({}x{} {} mips {}; {})", + t.name, + t.width, + t.height, + t.format.name(), + t.levels, + diffs.join(", ") + )); + break; } - Err(e) => s.errors.push(format!("{p}: rebuild failed: {e}")), } } - for t in &dict.textures { - s.textures += 1; - match t.to_rgba() { - Some(_) => s.decoded += 1, - None => *s.undecodable.entry(t.format.name()).or_default() += 1, - } - } - }, - &mut |e| nested_errors.push(e.to_string()), - ); - s.errors.extend(nested_errors); - s - }) - .collect(); - let mut total = Stats::default(); + Err(e) => s.errors.push(format!("{p}: rebuild failed: {e}")), + } + } + for t in &dict.textures { + s.textures += 1; + match t.to_rgba() { + Some(_) => s.decoded += 1, + None => *s.undecodable.entry(t.format.name()).or_default() += 1, + } + } + }, + ); + let mut total = Stats { errors: nested, ..Default::default() }; for s in all { total.dicts += s.dicts; total.textures += s.textures; @@ -155,6 +137,8 @@ pub(crate) fn cmd_verify_textures( *total.undecodable.entry(k).or_default() += v; } } + total.errors.sort(); + total.unreadable.sort(); for e in total.errors.iter().take(50) { outln!("FAIL {e}"); } @@ -190,48 +174,37 @@ pub(crate) fn cmd_verify_media(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut c: Counts = (0, 0, 0.0, 0); - let (mut errors, mut nested) = (Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let name = a.entry(id).name.to_ascii_lowercase(); - if !media::is_media(&name) { - return; - } - let result = a.read(id).map_err(anyhow::Error::from).and_then(|d| { - if name.ends_with(".bik") { - let b = media::bink(&d)?; - c.1 += 1; - c.2 += b.duration(); - } else { - let g = media::gfx(&d)?; - c.0 += 1; - c.3 += g.exports.len(); - } - Ok(()) - }); - if let Err(e) = result { - errors.push(format!("{p}: {e:#}")); - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (c, errors) - }) - .collect(); + let (all, nested): (Vec<(Counts, Vec)>, _) = for_each_entry_parallel( + &starts, + |e| media::is_media(&e.name.to_ascii_lowercase()), + |a, id, p, (c, errors): &mut (Counts, Vec)| { + let name = a.entry(id).name.to_ascii_lowercase(); + if !media::is_media(&name) { + return; + } + let result = a.read(id).map_err(anyhow::Error::from).and_then(|d| { + if name.ends_with(".bik") { + let b = media::bink(&d)?; + c.1 += 1; + c.2 += b.duration(); + } else { + let g = media::gfx(&d)?; + c.0 += 1; + c.3 += g.exports.len(); + } + Ok(()) + }); + if let Err(e) = result { + errors.push(format!("{p}: {e:#}")); + } + }, + ); let mut t: Counts = (0, 0, 0.0, 0); for (c, _) in &all { t = (t.0 + c.0, t.1 + c.1, t.2 + c.2, t.3 + c.3); } - let errors: Vec<&String> = all.iter().flat_map(|x| &x.1).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.1).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -255,51 +228,40 @@ pub(crate) fn cmd_verify_scripts(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut c: Counts = (0, 0, 0, 0, 0); - let (mut errors, mut nested) = (Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - if !a.entry(id).name.to_ascii_lowercase().ends_with(".ysc") { - return; - } - c.0 += 1; - match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(ysc::parse(&r)?)) { - Ok(s) => match s.table { - Some(t) => { - if t == ysc::Table::Current { - c.1 += 1; - } else { - c.2 += 1; - } - c.3 += s.check().unwrap_or(0); - c.4 += s.code.len(); - } - None => errors.push(format!( - "{p}: no opcode table fits ({})", - s.check().err().map(|e| e.to_string()).unwrap_or_default() - )), - }, - Err(e) => errors.push(format!("{p}: {e:#}")), + let (all, nested): (Vec<(Counts, Vec)>, _) = for_each_entry_parallel( + &starts, + |e| e.name.to_ascii_lowercase().ends_with(".ysc"), + |a, id, p, (c, errors): &mut (Counts, Vec)| { + if !a.entry(id).name.to_ascii_lowercase().ends_with(".ysc") { + return; + } + c.0 += 1; + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(ysc::parse(&r)?)) { + Ok(s) => match s.table { + Some(t) => { + if t == ysc::Table::Current { + c.1 += 1; + } else { + c.2 += 1; + } + c.3 += s.check().unwrap_or(0); + c.4 += s.code.len(); } + None => errors.push(format!( + "{p}: no opcode table fits ({})", + s.check().err().map(|e| e.to_string()).unwrap_or_default() + )), }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (c, errors) - }) - .collect(); + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let mut t: Counts = (0, 0, 0, 0, 0); for (c, _) in &all { t = (t.0 + c.0, t.1 + c.1, t.2 + c.2, t.3 + c.3, t.4 + c.4); } - let errors: Vec<&String> = all.iter().flat_map(|x| &x.1).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.1).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -324,53 +286,42 @@ pub(crate) fn cmd_verify_paths(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut c: Counts = (0, 0, 0, 0, 0.0, 0); - let (mut errors, mut nested) = (Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let name = a.entry(id).name.to_ascii_lowercase(); - if !paths::is_path_file(&name) { - return; - } - c.0 += 1; - let ext = name.rsplit('.').next().unwrap_or_default().to_owned(); - match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(paths::parse(&r, &ext)?)) { - Ok((d, s)) => { - c.1 += s.nodes + s.polygons; - c.2 += s.links; - c.3 += s.points; - c.4 += s.duration; - c.5 += s.skipped; - let bad = d - .meshes - .iter() - .flat_map(|m| &m.positions) - .any(|p| p.iter().any(|v| !v.is_finite() || v.abs() > 20000.0)); - if bad { - errors.push(format!("{p}: positions out of the map")); - } - } - Err(e) => errors.push(format!("{p}: {e:#}")), + let (all, nested): (Vec<(Counts, Vec)>, _) = for_each_entry_parallel( + &starts, + |e| paths::is_path_file(&e.name.to_ascii_lowercase()), + |a, id, p, (c, errors): &mut (Counts, Vec)| { + let name = a.entry(id).name.to_ascii_lowercase(); + if !paths::is_path_file(&name) { + return; + } + c.0 += 1; + let ext = name.rsplit('.').next().unwrap_or_default().to_owned(); + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(paths::parse(&r, &ext)?)) { + Ok((d, s)) => { + c.1 += s.nodes + s.polygons; + c.2 += s.links; + c.3 += s.points; + c.4 += s.duration; + c.5 += s.skipped; + let bad = d + .meshes + .iter() + .flat_map(|m| &m.positions) + .any(|p| p.iter().any(|v| !v.is_finite() || v.abs() > 20000.0)); + if bad { + errors.push(format!("{p}: positions out of the map")); } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (c, errors) - }) - .collect(); + } + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let mut t: Counts = (0, 0, 0, 0, 0.0, 0); for (c, _) in &all { t = (t.0 + c.0, t.1 + c.1, t.2 + c.2, t.3 + c.3, t.4 + c.4, t.5 + c.5); } - let errors: Vec<&String> = all.iter().flat_map(|x| &x.1).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.1).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -495,41 +446,27 @@ pub(crate) fn cmd_verify_collision_writer(game_dir: &Path, within: &str, keys: O Ok(()) }; type Counts = (usize, (usize, usize, usize), Vec); - let all: Vec = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut files, mut s, mut errors, mut nested) = (0, (0, 0, 0), Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let name = a.entry(id).name.to_ascii_lowercase(); - let ydr = name.ends_with(".ydr"); - if !ydr && !name.ends_with(".ybn") { - return; - } - let Ok(res) = a.read_resource(id) else { return }; - if ydr - && (res.version != drawable::VERSION_YDR_ENHANCED - || ybn_write::collision_of(&res, true).is_err()) - { - return; - } - files += 1; - if let Err(e) = check(&res, ydr, &mut s) { - errors.push(format!("{p}: {e:#}")); - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (files, s, errors) - }) - .collect(); + let (all, nested) = for_each_entry_parallel( + &starts, + |e| { + let name = e.name.to_ascii_lowercase(); + name.ends_with(".ydr") || name.ends_with(".ybn") + }, + |a, id, p, (files, s, errors): &mut Counts| { + let ydr = a.entry(id).name.to_ascii_lowercase().ends_with(".ydr"); + let Ok(res) = a.read_resource(id) else { return }; + if ydr && (res.version != drawable::VERSION_YDR_ENHANCED || ybn_write::collision_of(&res, true).is_err()) { + return; + } + *files += 1; + if let Err(e) = check(&res, ydr, s) { + errors.push(format!("{p}: {e:#}")); + } + }, + ); let sum = |f: fn(&Counts) -> usize| all.iter().map(f).sum::(); - let errors: Vec<&String> = all.iter().flat_map(|x| &x.2).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.2).chain(&nested).collect(); + errors.sort(); outln!( "{} collisions ({} game hierarchies as expected), {} written anew and read back the same, {} skipped (no triangles, or over {}), {} errors ({:.1}s)", sum(|x| x.0), @@ -550,45 +487,30 @@ pub(crate) fn cmd_verify_collisions(game_dir: &Path, within: &str, keys: Option< let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); type Counts = (usize, usize, usize, usize); - let all: Vec<(Counts, Vec)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut c: Counts = (0, 0, 0, 0); - let (mut errors, mut nested) = (Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - if !a.entry(id).name.to_ascii_lowercase().ends_with(".ybn") { - return; - } - c.0 += 1; - match a - .read_resource(id) - .map_err(anyhow::Error::from) - .and_then(|r| Ok(rage_formats::ybn::parse(&r)?)) - { - Ok((_, s)) => { - c.1 += s.bounds; - c.2 += s.triangles; - c.3 += s.primitives; - } - Err(e) => errors.push(format!("{p}: {e:#}")), - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (c, errors) - }) - .collect(); + let (all, nested): (Vec<(Counts, Vec)>, _) = for_each_entry_parallel( + &starts, + |e| e.name.to_ascii_lowercase().ends_with(".ybn"), + |a, id, p, (c, errors): &mut (Counts, Vec)| { + if !a.entry(id).name.to_ascii_lowercase().ends_with(".ybn") { + return; + } + c.0 += 1; + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(rage_formats::ybn::parse(&r)?)) { + Ok((_, s)) => { + c.1 += s.bounds; + c.2 += s.triangles; + c.3 += s.primitives; + } + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let mut t: Counts = (0, 0, 0, 0); for (c, _) in &all { t = (t.0 + c.0, t.1 + c.1, t.2 + c.2, t.3 + c.3); } - let errors: Vec<&String> = all.iter().flat_map(|x| &x.1).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.1).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -611,50 +533,35 @@ pub(crate) fn cmd_verify_particles(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut c: Counts = (0, 0, 0, 0, 0); - let (mut errors, mut nested) = (Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - if !a.entry(id).name.to_ascii_lowercase().ends_with(".ypt") { - return; - } - c.0 += 1; - match a - .read_resource(id) - .map_err(anyhow::Error::from) - .and_then(|r| Ok(rage_formats::ypt::parse(&r)?)) - { - Ok(d) => { - c.1 += d.effects.len(); - c.2 += d.textures.as_ref().map_or(0, |t| t.textures.len()); - c.3 += d.drawables.len(); - c.4 += d.drawables.iter().map(|(_, m)| m.triangle_count()).sum::(); - let bad_tex = d.textures.as_ref().map_or(0, |t| t.errors.len()); - if !d.errors.is_empty() || bad_tex > 0 { - errors.push(format!("{p}: {} {bad_tex} texture errors", d.errors.join("; "))); - } - } - Err(e) => errors.push(format!("{p}: {e:#}")), + let (all, nested): (Vec<(Counts, Vec)>, _) = for_each_entry_parallel( + &starts, + |e| e.name.to_ascii_lowercase().ends_with(".ypt"), + |a, id, p, (c, errors): &mut (Counts, Vec)| { + if !a.entry(id).name.to_ascii_lowercase().ends_with(".ypt") { + return; + } + c.0 += 1; + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(rage_formats::ypt::parse(&r)?)) { + Ok(d) => { + c.1 += d.effects.len(); + c.2 += d.textures.as_ref().map_or(0, |t| t.textures.len()); + c.3 += d.drawables.len(); + c.4 += d.drawables.iter().map(|(_, m)| m.triangle_count()).sum::(); + let bad_tex = d.textures.as_ref().map_or(0, |t| t.errors.len()); + if !d.errors.is_empty() || bad_tex > 0 { + errors.push(format!("{p}: {} {bad_tex} texture errors", d.errors.join("; "))); } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (c, errors) - }) - .collect(); + } + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let mut t: Counts = (0, 0, 0, 0, 0); for (c, _) in &all { t = (t.0 + c.0, t.1 + c.1, t.2 + c.2, t.3 + c.3, t.4 + c.4); } - let errors: Vec<&String> = all.iter().flat_map(|x| &x.1).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.1).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -678,40 +585,29 @@ pub(crate) fn cmd_verify_text(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut files, mut entries, mut errors) = (0, 0, Vec::new()); - let mut nested = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let Some(kind) = Kind::of(&a.entry(id).name) else { return }; - files += 1; - let result = a.read(id).map_err(anyhow::Error::from).and_then(|data| { - let (text, n) = texttable::to_text(kind, &data)?; - let back = texttable::from_text(kind, &text)?; - if back != data { - bail!("converting back changes the file ({} → {} bytes)", data.len(), back.len()); - } - Ok(n) - }); - match result { - Ok(n) => entries += n, - Err(e) => errors.push(format!("{p}: {e:#}")), - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (files, entries, errors) - }) - .collect(); + let (all, nested) = for_each_entry_parallel( + &starts, + |e| Kind::of(&e.name).is_some(), + |a, id, p, (files, entries, errors): &mut (usize, usize, Vec)| { + let Some(kind) = Kind::of(&a.entry(id).name) else { return }; + *files += 1; + let result = a.read(id).map_err(anyhow::Error::from).and_then(|data| { + let (text, n) = texttable::to_text(kind, &data)?; + let back = texttable::from_text(kind, &text)?; + if back != data { + bail!("converting back changes the file ({} → {} bytes)", data.len(), back.len()); + } + Ok(n) + }); + match result { + Ok(n) => *entries += n, + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let (files, entries): (usize, usize) = all.iter().fold((0, 0), |a, b| (a.0 + b.0, a.1 + b.1)); - let errors: Vec<&String> = all.iter().flat_map(|x| &x.2).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.2).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -947,40 +843,27 @@ pub(crate) fn cmd_verify_model_writer(game_dir: &Path, within: &str, keys: Optio Ok(written) }; type Counts = (usize, usize, usize, usize, Vec); - let results: Vec = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut seen, mut written, mut children, mut entries) = (0, 0, 0, 0); - let (mut errors, mut nested) = (Vec::new(), Vec::new()); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let name = a.entry(id).name.to_ascii_lowercase(); - if !name.ends_with(".ydr") && !name.ends_with(".yft") && !name.ends_with(".ydd") { - return; - } - seen += 1; - match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| check(&r, &name)) { - Ok((0, _, _)) => {} - Ok((_, c, e)) => { - written += 1; - children += c; - entries += e; - } - Err(e) => errors.push(format!("{p}: {e:#}")), - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (seen, written, children, entries, errors) - }) - .collect(); + let is_model = |name: &str| name.ends_with(".ydr") || name.ends_with(".yft") || name.ends_with(".ydd"); + let (results, nested) = for_each_entry_parallel( + &starts, + |e| is_model(&e.name.to_ascii_lowercase()), + |a, id, p, (seen, written, children, entries, errors): &mut Counts| { + let name = a.entry(id).name.to_ascii_lowercase(); + *seen += 1; + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| check(&r, &name)) { + Ok((0, _, _)) => {} + Ok((_, c, e)) => { + *written += 1; + *children += c; + *entries += e; + } + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let sum = |f: fn(&Counts) -> usize| results.iter().map(f).sum::(); - let errors: Vec<&String> = results.iter().flat_map(|r| &r.4).collect(); + let mut errors: Vec<&String> = results.iter().flat_map(|r| &r.4).chain(&nested).collect(); + errors.sort(); outln!( "{} models, {} written anew and read back identically ({} fragment child models, {} dictionary drawables among them), {} errors ({:.1}s)", sum(|r| r.0), @@ -1002,41 +885,26 @@ pub(crate) fn cmd_verify_meta(game_dir: &Path, within: &str, keys: Option; - let all: Vec<(Counts, Vec, Vec)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut counts, mut errors, mut problems) = (Counts::new(), Vec::new(), Vec::new()); - let mut nested = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let name = &a.entry(id).name; - if !metadata::is_metadata(name) { - return; + let (all, nested) = for_each_entry_parallel( + &starts, + |e| metadata::is_metadata(&e.name), + |a, id, p, (counts, errors, problems): &mut (Counts, Vec, Vec)| { + let name = &a.entry(id).name; + let ext = name.rsplit('.').next().unwrap_or_default().to_ascii_lowercase(); + let result = a.read(id).map_err(anyhow::Error::from).and_then(|d| metadata::from_bytes(&d)); + let c = counts.entry(ext).or_insert((0, 0)); + c.0 += 1; + match result { + Ok(x) => { + c.1 += x.text.len(); + if let Some(e) = x.errors.first() { + problems.push(format!("{p}: {} problems, first: {e}", x.errors.len())); } - let ext = name.rsplit('.').next().unwrap_or_default().to_ascii_lowercase(); - let result = a.read(id).map_err(anyhow::Error::from).and_then(|d| metadata::from_bytes(&d)); - let c = counts.entry(ext).or_insert((0, 0)); - c.0 += 1; - match result { - Ok(x) => { - c.1 += x.text.len(); - if let Some(e) = x.errors.first() { - problems.push(format!("{p}: {} problems, first: {e}", x.errors.len())); - } - } - Err(e) => errors.push(format!("{p}: {e:#}")), - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (counts, errors, problems) - }) - .collect(); + } + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let mut counts = BTreeMap::::new(); for (c, _, _) in &all { for (k, v) in c { @@ -1045,8 +913,10 @@ pub(crate) fn cmd_verify_meta(game_dir: &Path, within: &str, keys: Option = all.iter().flat_map(|x| &x.1).collect(); - let problems: Vec<&String> = all.iter().flat_map(|x| &x.2).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.1).chain(&nested).collect(); + errors.sort(); + let mut problems: Vec<&String> = all.iter().flat_map(|x| &x.2).collect(); + problems.sort(); for e in errors.iter().take(30) { outln!("FAIL {e}"); } @@ -1108,48 +978,33 @@ pub(crate) fn cmd_verify_pso_rebuild(game_dir: &Path, within: &str, keys: Option let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); // Per archive: identical, same XML, unreadable, errors. - let all: Vec<(usize, usize, usize, Vec)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut same, mut xml, mut unreadable, mut errors) = (0, 0, 0, Vec::new()); - let mut nested = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let e = a.entry(id); - if e.is_dir() || e.is_archive() || e.resource_version().is_some() { - return; - } - if !openrage_app::metadata::is_metadata(&e.name) { - return; - } - let data = match a.read(id) { - Ok(d) => d, - Err(err) => return errors.push(format!("{p}: {err}")), - }; - if !rage_formats::pso::is_pso(&data) { - return; - } - match pso_round_trip(&data, false) { - Ok(PsoRoundTrip::Identical) => same += 1, - Ok(PsoRoundTrip::SameXml) => xml += 1, - Ok(PsoRoundTrip::Unreadable) => unreadable += 1, - Err(err) => errors.push(format!("{p}: {err}")), - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (same, xml, unreadable, errors) - }) - .collect(); + let (all, nested) = for_each_entry_parallel( + &starts, + |e| { + !(e.is_dir() || e.is_archive() || e.resource_version().is_some()) + && openrage_app::metadata::is_metadata(&e.name) + }, + |a, id, p, (same, xml, unreadable, errors): &mut (usize, usize, usize, Vec)| { + let data = match a.read(id) { + Ok(d) => d, + Err(err) => return errors.push(format!("{p}: {err}")), + }; + if !rage_formats::pso::is_pso(&data) { + return; + } + match pso_round_trip(&data, false) { + Ok(PsoRoundTrip::Identical) => *same += 1, + Ok(PsoRoundTrip::SameXml) => *xml += 1, + Ok(PsoRoundTrip::Unreadable) => *unreadable += 1, + Err(err) => errors.push(format!("{p}: {err}")), + } + }, + ); let same: usize = all.iter().map(|x| x.0).sum(); let xml: usize = all.iter().map(|x| x.1).sum(); let unreadable: usize = all.iter().map(|x| x.2).sum(); - let errors: Vec<&String> = all.iter().flat_map(|x| &x.3).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.3).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(40) { outln!("FAIL {e}"); } @@ -1176,66 +1031,49 @@ pub(crate) type AnimStats = (usize, usize, usize, usize, usize, Vec); pub(crate) fn cmd_verify_animations(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); - let all: Vec = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut files, mut clips, mut anims, mut mismatch, mut badq) = (0, 0, 0, 0, 0); - let mut errors = Vec::new(); - let mut nested = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - if !a.entry(id).name.to_ascii_lowercase().ends_with(".ycd") - || a.entry(id).resource_version().is_none() - { - return; - } - files += 1; - let parsed = a - .read_resource(id) - .map_err(|e| e.to_string()) - .and_then(|r| rage_formats::clip::parse_ycd(&r).map_err(|e| e.to_string())); - match parsed { - Ok(d) => { - clips += d.clips.len(); - anims += d.animations.len(); - for an in &d.animations { - let blocks = an.block_frames(); - let sum: usize = blocks.iter().sum(); - let overlapped = sum.saturating_sub(blocks.len().saturating_sub(1)); - if sum != an.frames && overlapped != an.frames { - mismatch += 1; - } - for (t, tr) in an.tracks.iter().enumerate() { - for f in (0..an.frames).step_by(7) { - match an.value(t, f as f32) { - Some(v) if tr.format == 1 => { - let n = v.iter().map(|x| x * x).sum::().sqrt(); - if !(0.99..=1.01).contains(&n) { - badq += 1; - } - } - Some(v) if v.iter().any(|x| !x.is_finite()) => badq += 1, - _ => {} + let (all, nested) = for_each_entry_parallel( + &starts, + |e| e.name.to_ascii_lowercase().ends_with(".ycd") && e.resource_version().is_some(), + |a, id, p, (files, clips, anims, mismatch, badq, errors): &mut AnimStats| { + *files += 1; + let parsed = a + .read_resource(id) + .map_err(|e| e.to_string()) + .and_then(|r| rage_formats::clip::parse_ycd(&r).map_err(|e| e.to_string())); + match parsed { + Ok(d) => { + *clips += d.clips.len(); + *anims += d.animations.len(); + for an in &d.animations { + let blocks = an.block_frames(); + let sum: usize = blocks.iter().sum(); + let overlapped = sum.saturating_sub(blocks.len().saturating_sub(1)); + if sum != an.frames && overlapped != an.frames { + *mismatch += 1; + } + for (t, tr) in an.tracks.iter().enumerate() { + for f in (0..an.frames).step_by(7) { + match an.value(t, f as f32) { + Some(v) if tr.format == 1 => { + let n = v.iter().map(|x| x * x).sum::().sqrt(); + if !(0.99..=1.01).contains(&n) { + *badq += 1; } } + Some(v) if v.iter().any(|x| !x.is_finite()) => *badq += 1, + _ => {} } } } - Err(e) => errors.push(format!("{p}: {e}")), } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (files, clips, anims, mismatch, badq, errors) - }) - .collect(); + } + Err(e) => errors.push(format!("{p}: {e}")), + } + }, + ); let sum = |f: fn(&AnimStats) -> usize| all.iter().map(f).sum::(); - let errors: Vec<&String> = all.iter().flat_map(|x| &x.5).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.5).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(40) { outln!("FAIL {e}"); } @@ -1259,67 +1097,63 @@ pub(crate) fn cmd_verify_audio(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut files, mut sounds, mut secs, mut encrypted, mut errors) = (0, 0, 0f64, 0, Vec::new()); - let mut not_audio = 0usize; - let mut nested = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - if !openrage_app::audio::is_audio(&a.entry(id).name) { - return; - } - files += 1; - let result = a - .read(id) - .map_err(anyhow::Error::from) - .and_then(|d| openrage_app::audio::parse(d, keys.as_deref())) - .and_then(|awc| { - if awc.encrypted || awc.flags & 0xA != 0 { - encrypted += 1; - } - let pcms = if awc.stream_format.is_some() { - vec![awc.decode_stream()?] - } else { - (0..awc.sounds.len()).map(|i| awc.decode_sound(i)).collect::, _>>()? - }; - Ok(pcms) - }); - match result { - Ok(pcms) => { - sounds += pcms.len(); - secs += pcms.iter().map(|p| p.duration_secs() as f64).sum::(); - } - // A few files only share the extension (e.g. shader caches). - Err(e) - if matches!( - e.downcast_ref::(), - Some(rage_formats::awc::AwcError::NotAwc) - ) => - { - files -= 1; - not_audio += 1; + let (all, nested) = + for_each_entry_parallel( + &starts, + |e| openrage_app::audio::is_audio(&e.name), + |a, + id, + p, + (files, sounds, secs, encrypted, not_audio, errors): &mut ( + usize, + usize, + f64, + usize, + usize, + Vec, + )| { + *files += 1; + let result = a + .read(id) + .map_err(anyhow::Error::from) + .and_then(|d| openrage_app::audio::parse(d, keys.as_deref())) + .and_then(|awc| { + if awc.encrypted || awc.flags & 0xA != 0 { + *encrypted += 1; } - Err(e) => errors.push(format!("{p}: {e:#}")), + let pcms = if awc.stream_format.is_some() { + vec![awc.decode_stream()?] + } else { + (0..awc.sounds.len()).map(|i| awc.decode_sound(i)).collect::, _>>()? + }; + Ok(pcms) + }); + match result { + Ok(pcms) => { + *sounds += pcms.len(); + *secs += pcms.iter().map(|p| p.duration_secs() as f64).sum::(); } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (files, sounds, secs, encrypted, not_audio, errors) - }) - .collect(); + // A few files only share the extension (e.g. shader caches). + Err(e) + if matches!( + e.downcast_ref::(), + Some(rage_formats::awc::AwcError::NotAwc) + ) => + { + *files -= 1; + *not_audio += 1; + } + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let files: usize = all.iter().map(|x| x.0).sum(); let sounds: usize = all.iter().map(|x| x.1).sum(); let secs: f64 = all.iter().map(|x| x.2).sum(); let encrypted: usize = all.iter().map(|x| x.3).sum(); let not_audio: usize = all.iter().map(|x| x.4).sum(); - let errors: Vec<&String> = all.iter().flat_map(|x| &x.5).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.5).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(40) { outln!("FAIL {e}"); } @@ -1339,48 +1173,34 @@ pub(crate) fn cmd_verify_models(game_dir: &Path, within: &str, keys: Option)> = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let (mut models, mut tris, mut errors) = (0usize, 0usize, Vec::new()); - let mut nested = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let n = a.entry(id).name.to_ascii_lowercase(); - let drawable_file = n.ends_with(".ydr") || n.ends_with(".yft") || n.ends_with(".ydd"); - if !drawable_file || a.entry(id).resource_version().is_none() { - return; - } - models += 1; - let parsed = a.read_resource(id).map_err(|e| e.to_string()).and_then(|r| { - let r = if n.ends_with(".ydd") { - drawable::parse_ydd(&r).map(|v| v.into_iter().map(|(_, d)| d).collect::>()) - } else if n.ends_with(".yft") { - drawable::parse_fragment(&r).map(|f| { - std::iter::once(f.drawable).chain(f.children.into_iter().map(|c| c.drawable)).collect() - }) - } else { - drawable::parse_ydr(&r).map(|d| vec![d]) - }; - r.map_err(|e| e.to_string()) - }); - match parsed { - Ok(ds) => tris += ds.iter().map(|d| d.triangle_count()).sum::(), - Err(e) => errors.push(format!("{p}: {e}")), - } - }, - &mut |e| nested.push(e.to_string()), - ); - errors.extend(nested); - (models, tris, errors) - }) - .collect(); + let is_model = |n: &str| n.ends_with(".ydr") || n.ends_with(".yft") || n.ends_with(".ydd"); + let (all, nested) = for_each_entry_parallel( + &starts, + |e| is_model(&e.name.to_ascii_lowercase()) && e.resource_version().is_some(), + |a, id, p, (models, tris, errors): &mut (usize, usize, Vec)| { + let n = a.entry(id).name.to_ascii_lowercase(); + *models += 1; + let parsed = a.read_resource(id).map_err(|e| e.to_string()).and_then(|r| { + let r = if n.ends_with(".ydd") { + drawable::parse_ydd(&r).map(|v| v.into_iter().map(|(_, d)| d).collect::>()) + } else if n.ends_with(".yft") { + drawable::parse_fragment(&r).map(|f| { + std::iter::once(f.drawable).chain(f.children.into_iter().map(|c| c.drawable)).collect() + }) + } else { + drawable::parse_ydr(&r).map(|d| vec![d]) + }; + r.map_err(|e| e.to_string()) + }); + match parsed { + Ok(ds) => *tris += ds.iter().map(|d| d.triangle_count()).sum::(), + Err(e) => errors.push(format!("{p}: {e}")), + } + }, + ); let (models, tris): (usize, usize) = all.iter().fold((0, 0), |a, b| (a.0 + b.0, a.1 + b.1)); - let errors: Vec<&String> = all.iter().flat_map(|x| &x.2).collect(); + let mut errors: Vec<&String> = all.iter().flat_map(|x| &x.2).chain(&nested).collect(); + errors.sort(); for e in errors.iter().take(40) { outln!("FAIL {e}"); } @@ -1393,6 +1213,166 @@ pub(crate) fn cmd_verify_models(game_dir: &Path, within: &str, keys: Option, EntryId); +/// What a worker gets: the archive the file is in (a nested one too), the file, its path, and the +/// archive root it was found under (to report that root done once all its files are checked). +type Job = (Arc, I, String, Arc); + +/// Files of one archive root still queued or being checked, plus one while it is walked. +struct Pending { + left: std::sync::atomic::AtomicUsize, + prefix: String, + report: bool, +} + +impl Pending { + fn done(&self) { + if self.left.fetch_sub(1, std::sync::atomic::Ordering::AcqRel) == 1 && self.report { + eprintln!(" checked {}", self.prefix); + } + } +} + +/// Runs `work` on every file `walk` finds below the archive roots, on one +/// thread per core, each with its own stats (returned unmerged), plus the +/// errors of walking (nested archives that do not open). +/// +/// Roots are walked in parallel (rayon), and the files go through a short +/// queue to the workers: one big archive (all vehicles are in one) does not +/// leave the other cores idle. Reading and decompressing happen in the +/// workers too. The workers are plain threads, not rayon tasks: walkers wait +/// on a full queue, and waiting rayon tasks could starve rayon workers. +fn run_parallel( + starts: &[(String, Arc, I)], + report: bool, + walk: impl Fn(&Arc, I, &str, &mut dyn FnMut(&Arc, I, &str), &mut Vec) + Sync, + work: impl Fn(&A, I, &str, &mut S) + Sync, +) -> (Vec, Vec) +where + A: Send + Sync, + I: Copy + Send + Sync, + S: Default + Send, +{ + use std::sync::atomic::{AtomicUsize, Ordering}; + let workers = std::thread::available_parallelism().map_or(4, |n| n.get()); + let (send, receive) = std::sync::mpsc::sync_channel::>(workers * 4); + // Owned by the workers only: should they all stop (a panic), the walkers stop waiting. + let receive = Arc::new(std::sync::Mutex::new(receive)); + let work = &work; + std::thread::scope(|scope| { + let handles: Vec<_> = (0..workers) + .map(|_| { + let receive = Arc::clone(&receive); + scope.spawn(move || { + let mut s = S::default(); + loop { + // The lock is held only while waiting for the next file. + let job = receive.lock().unwrap_or_else(|e| e.into_inner()).recv(); + let Ok((archive, id, path, pending)) = job else { break }; + work(&archive, id, &path, &mut s); + pending.done(); + } + s + }) + }) + .collect(); + drop(receive); + let errors: Vec = starts + .par_iter() + .flat_map_iter(|(prefix, archive, dir)| { + let pending = Arc::new(Pending { left: AtomicUsize::new(1), prefix: prefix.clone(), report }); + let mut errors = Vec::new(); + let send = send.clone(); + walk( + archive, + *dir, + prefix, + &mut |a, id, p| { + pending.left.fetch_add(1, Ordering::AcqRel); + if send.send((Arc::clone(a), id, p.to_owned(), Arc::clone(&pending))).is_err() { + pending.done(); + } + }, + &mut errors, + ); + pending.done(); + errors + }) + .collect(); + drop(send); + let stats = handles.into_iter().map(|h| h.join().expect("verify worker")).collect(); + (stats, errors) + }) +} + +/// Runs `work` on every entry below the archive roots (nested archives too) +/// that `wanted` accepts, on every core, also within one archive. +/// Returns the stats of every worker, unmerged, and the errors of nested +/// archives that do not open. +pub(crate) fn for_each_entry_parallel( + starts: &[Start], + wanted: impl Fn(&rage_rpf::Entry) -> bool + Sync, + work: impl Fn(&Rpf7, EntryId, &str, &mut S) + Sync, +) -> (Vec, Vec) { + for_each_entry_parallel_reporting(starts, false, wanted, work) +} + +/// [`for_each_entry_parallel`], printing `checked ` once all files of a root are checked. +pub(crate) fn for_each_entry_parallel_reporting( + starts: &[Start], + report: bool, + wanted: impl Fn(&rage_rpf::Entry) -> bool + Sync, + work: impl Fn(&Rpf7, EntryId, &str, &mut S) + Sync, +) -> (Vec, Vec) { + // Like `vfs::walk`, but every archive shared, so workers can read from it. + fn walk( + archive: &Arc, + dir: EntryId, + prefix: &str, + wanted: &(dyn Fn(&rage_rpf::Entry) -> bool + Sync), + emit: &mut dyn FnMut(&Arc, EntryId, &str), + errors: &mut Vec, + ) { + for child in archive.children(dir) { + let entry = archive.entry(child); + let path = if prefix.is_empty() { entry.name.clone() } else { format!("{prefix}/{}", entry.name) }; + if wanted(entry) { + emit(archive, child, &path); + } + if entry.is_dir() { + walk(archive, child, &path, wanted, emit, errors); + } else if entry.is_archive() { + match archive.open_child(child) { + Ok(inner) => walk(&Arc::new(inner), Rpf7::ROOT, &path, wanted, emit, errors), + Err(e) => errors.push(e.to_string()), + } + } + } + } + run_parallel(starts, report, |a, dir, prefix, emit, errors| walk(a, dir, prefix, &wanted, emit, errors), work) +} + +/// [`for_each_entry_parallel`] for GTA IV archives (`.rpf`, `.img`; not nested). +pub(crate) fn for_each_gta4_entry_parallel( + starts: &[crate::cmd::verify_gta4::Gta4Start], + report: bool, + wanted: impl Fn(&rage_rpf::Gta4Archive, rage_rpf::Gta4EntryId) -> bool + Sync, + work: impl Fn(&rage_rpf::Gta4Archive, rage_rpf::Gta4EntryId, &str, &mut S) + Sync, +) -> Vec { + let (stats, _) = run_parallel( + starts, + report, + |a, dir, prefix, emit, _| { + vfs::walk_gta4(a, dir, prefix, &mut |id, p| { + if wanted(a, id) { + emit(a, id, p) + } + }) + }, + work, + ); + stats +} + /// Resolves `within` to the archive directories to process: either one /// directory inside an archive, or every `.rpf` below a real directory. pub(crate) fn archive_roots(game_dir: &Path, within: &str, keys: Option>) -> Result> { @@ -1436,44 +1416,30 @@ pub(crate) struct VerifyStats { pub(crate) fn cmd_verify(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); - let stats: Vec = starts - .par_iter() - .map(|(prefix, rpf, dir)| { - let mut s = VerifyStats { archives: 1, ..Default::default() }; - let mut nested_errors = Vec::new(); - vfs::walk( - rpf, - *dir, - prefix, - true, - &mut |a, id, p| { - let e = a.entry(id); - let result = if e.is_dir() { - return; - } else if e.is_archive() { - s.archives += 1; - return; - } else if e.resource_version().is_some() { - s.resources += 1; - a.read_resource_pages(id) - } else { - s.files += 1; - a.read(id) - }; - match result { - Ok(data) => s.bytes += data.len() as u64, - Err(err) => s.errors.push(format!("{p}: {err}")), - } - }, - &mut |e| nested_errors.push(e.to_string()), - ); - s.errors.extend(nested_errors); - eprintln!(" checked {prefix}"); - s - }) - .collect(); + let (stats, nested) = for_each_entry_parallel_reporting( + &starts, + true, + |e| !e.is_dir(), + |a, id, p, s: &mut VerifyStats| { + let e = a.entry(id); + let result = if e.is_archive() { + s.archives += 1; + return; + } else if e.resource_version().is_some() { + s.resources += 1; + a.read_resource_pages(id) + } else { + s.files += 1; + a.read(id) + }; + match result { + Ok(data) => s.bytes += data.len() as u64, + Err(err) => s.errors.push(format!("{p}: {err}")), + } + }, + ); - let mut total = VerifyStats::default(); + let mut total = VerifyStats { archives: starts.len(), errors: nested, ..Default::default() }; for s in stats { total.archives += s.archives; total.files += s.files; @@ -1481,6 +1447,7 @@ pub(crate) fn cmd_verify(game_dir: &Path, within: &str, keys: Option Result<()> { // Audio entries (RPF3) with a name instead of only a hash. let audio = std::sync::atomic::AtomicUsize::new(0); let audio_named = std::sync::atomic::AtomicUsize::new(0); - let stats: Vec = starts - .par_iter() - .map(|(prefix, a, dir)| { - let mut s = VerifyStats { archives: 1, ..Default::default() }; - vfs::walk_gta4(a, *dir, prefix, &mut |id, p| { - let e = a.entry(id); - if let Some(hash) = a.audio_hash_of(id) { - use std::sync::atomic::Ordering::Relaxed; - audio.fetch_add(1, Relaxed); - if e.name != format!("{hash:08x}") { - audio_named.fetch_add(1, Relaxed); - } - } - let result = if e.is_dir() { - return; - } else if e.resource_type().is_some() { - s.resources += 1; - a.read_resource(id).map(|r| r.system.len() + r.graphics.len()) - } else { - s.files += 1; - a.read(id).map(|d| d.len()) - }; - match result { - Ok(n) => s.bytes += n as u64, - Err(err) => s.errors.push(format!("{p}: {err}")), + let stats: Vec = for_each_gta4_entry_parallel( + &starts, + true, + |_, _| true, + |a, id, p, s: &mut VerifyStats| { + let e = a.entry(id); + if let Some(hash) = a.audio_hash_of(id) { + use std::sync::atomic::Ordering::Relaxed; + audio.fetch_add(1, Relaxed); + if e.name != format!("{hash:08x}") { + audio_named.fetch_add(1, Relaxed); } - }); - eprintln!(" checked {prefix}"); - s - }) - .collect(); - let mut total = VerifyStats { archives: open_errors.len(), errors: open_errors, ..Default::default() }; + } + let result = if e.is_dir() { + return; + } else if e.resource_type().is_some() { + s.resources += 1; + a.read_resource(id).map(|r| r.system.len() + r.graphics.len()) + } else { + s.files += 1; + a.read(id).map(|d| d.len()) + }; + match result { + Ok(n) => s.bytes += n as u64, + Err(err) => s.errors.push(format!("{p}: {err}")), + } + }, + ); + let mut total = + VerifyStats { archives: open_errors.len() + starts.len(), errors: open_errors, ..Default::default() }; for s in stats { total.archives += s.archives; total.files += s.files; @@ -82,6 +80,7 @@ pub(crate) fn cmd_verify_gta4(game_dir: &Path, within: &str) -> Result<()> { total.bytes += s.bytes; total.errors.extend(s.errors); } + total.errors.sort(); for e in &total.errors { outln!("FAIL {e}"); } @@ -111,34 +110,30 @@ pub(crate) fn cmd_verify_gta4(game_dir: &Path, within: &str) -> Result<()> { pub(crate) fn cmd_verify_gta4_scripts(game_dir: &Path, within: &str) -> Result<()> { let (starts, open_errors) = gta4_starts(game_dir, within)?; let started = Instant::now(); - let all: Vec<(usize, usize, Vec)> = starts - .par_iter() - .map(|(prefix, a, dir)| { - let (mut files, mut instructions, mut errors) = (0, 0, Vec::new()); - vfs::walk_gta4(a, *dir, prefix, &mut |id, p| { - if !a.entry(id).name.to_ascii_lowercase().ends_with(".sco") { - return; - } - files += 1; - let checked = a - .read(id) - .map_err(anyhow::Error::from) - .and_then(|d| openrage_app::gta4::read_sco(&d)) - .and_then(|s| s.check().map_err(|e| anyhow::anyhow!(e))); - match checked { - Ok(n) => instructions += n, - Err(e) => errors.push(format!("{p}: {e:#}")), - } - }); - (files, instructions, errors) - }) - .collect(); + let all: Vec<(usize, usize, Vec)> = for_each_gta4_entry_parallel( + &starts, + false, + |a, id| a.entry(id).name.to_ascii_lowercase().ends_with(".sco"), + |a, id, p, (files, instructions, errors): &mut (usize, usize, Vec)| { + *files += 1; + let checked = a + .read(id) + .map_err(anyhow::Error::from) + .and_then(|d| openrage_app::gta4::read_sco(&d)) + .and_then(|s| s.check().map_err(|e| anyhow::anyhow!(e))); + match checked { + Ok(n) => *instructions += n, + Err(e) => errors.push(format!("{p}: {e:#}")), + } + }, + ); let (mut files, mut instructions, mut errors) = (0, 0, open_errors); for (f, i, e) in all { files += f; instructions += i; errors.extend(e); } + errors.sort(); for e in errors.iter().take(50) { outln!("FAIL {e}"); } @@ -166,42 +161,36 @@ pub(crate) fn cmd_verify_gta4_animations(game_dir: &Path, within: &str) -> Resul } let (starts, open_errors) = gta4_starts(game_dir, within)?; let started = Instant::now(); - let all: Vec = starts - .par_iter() - .map(|(prefix, a, dir)| { - let mut s = Stats::default(); - vfs::walk_gta4(a, *dir, prefix, &mut |id, p| { - let e = a.entry(id); - if e.resource_type().is_none() || !e.name.to_ascii_lowercase().ends_with(".wad") { - return; - } - s.files += 1; - match a - .read_resource(id) - .map_err(anyhow::Error::from) - .and_then(|r| Ok(rage_formats::wad::parse_wad(&r)?)) - { - Ok(dict) => { - for anim in &dict.animations { - s.animations += 1; - s.tracks += anim.tracks.len(); - s.frames += anim.frames; - for t in 0..anim.tracks.len() { - for f in 0..anim.frames { - let ok = anim.value(t, f as f32).is_some_and(|v| v.iter().all(|c| c.is_finite())); - if !ok { - s.bad_values += 1; - } + let all: Vec = for_each_gta4_entry_parallel( + &starts, + false, + |a, id| !a.entry(id).is_dir(), + |a, id, p, s: &mut Stats| { + let e = a.entry(id); + if e.resource_type().is_none() || !e.name.to_ascii_lowercase().ends_with(".wad") { + return; + } + s.files += 1; + match a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| Ok(rage_formats::wad::parse_wad(&r)?)) { + Ok(dict) => { + for anim in &dict.animations { + s.animations += 1; + s.tracks += anim.tracks.len(); + s.frames += anim.frames; + for t in 0..anim.tracks.len() { + for f in 0..anim.frames { + let ok = anim.value(t, f as f32).is_some_and(|v| v.iter().all(|c| c.is_finite())); + if !ok { + s.bad_values += 1; } } } } - Err(err) => s.errors.push(format!("{p}: {err:#}")), } - }); - s - }) - .collect(); + Err(err) => s.errors.push(format!("{p}: {err:#}")), + } + }, + ); let mut total = Stats { errors: open_errors, ..Default::default() }; for s in all { total.files += s.files; @@ -211,6 +200,7 @@ pub(crate) fn cmd_verify_gta4_animations(game_dir: &Path, within: &str) -> Resul total.bad_values += s.bad_values; total.errors.extend(s.errors); } + total.errors.sort(); for e in total.errors.iter().take(50) { outln!("FAIL {e}"); } @@ -244,49 +234,47 @@ pub(crate) fn cmd_verify_gta4_collisions(game_dir: &Path, within: &str) -> Resul } let (starts, open_errors) = gta4_starts(game_dir, within)?; let started = Instant::now(); - let all: Vec = starts - .par_iter() - .map(|(prefix, a, dir)| { - let mut s = Stats::default(); - vfs::walk_gta4(a, *dir, prefix, &mut |id, p| { - let e = a.entry(id); - let lower = e.name.to_ascii_lowercase(); - let fragment = lower.ends_with(".wft"); - if e.resource_type().is_none() || !(lower.ends_with(".wbn") || lower.ends_with(".wbd") || fragment) { - return; - } - let parsed = a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| { - use rage_formats::wbn; - Ok(if fragment { - // The collision a fragment keeps for itself, if it has one. - match rage_formats::wdr::fragment_bound(&r) { - Some(at) => vec![wbn::parse_bound(&r, at)?.1], - None => Vec::new(), - } - } else if lower.ends_with(".wbn") { - vec![wbn::parse_wbn(&r)?.1] - } else { - wbn::parse_wbd(&r)?.into_iter().map(|(_, _, st)| st).collect() - }) - }); - if !matches!(&parsed, Ok(list) if list.is_empty()) { - s.files += 1; - } - match parsed { - Ok(list) => { - for st in list { - s.bounds += st.bounds; - s.triangles += st.triangles; - s.primitives += st.primitives; - s.materials.extend(st.materials); - } + let all: Vec = for_each_gta4_entry_parallel( + &starts, + false, + |a, id| !a.entry(id).is_dir(), + |a, id, p, s: &mut Stats| { + let e = a.entry(id); + let lower = e.name.to_ascii_lowercase(); + let fragment = lower.ends_with(".wft"); + if e.resource_type().is_none() || !(lower.ends_with(".wbn") || lower.ends_with(".wbd") || fragment) { + return; + } + let parsed = a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| { + use rage_formats::wbn; + Ok(if fragment { + // The collision a fragment keeps for itself, if it has one. + match rage_formats::wdr::fragment_bound(&r) { + Some(at) => vec![wbn::parse_bound(&r, at)?.1], + None => Vec::new(), } - Err(err) => s.errors.push(format!("{p}: {err:#}")), - } + } else if lower.ends_with(".wbn") { + vec![wbn::parse_wbn(&r)?.1] + } else { + wbn::parse_wbd(&r)?.into_iter().map(|(_, _, st)| st).collect() + }) }); - s - }) - .collect(); + if !matches!(&parsed, Ok(list) if list.is_empty()) { + s.files += 1; + } + match parsed { + Ok(list) => { + for st in list { + s.bounds += st.bounds; + s.triangles += st.triangles; + s.primitives += st.primitives; + s.materials.extend(st.materials); + } + } + Err(err) => s.errors.push(format!("{p}: {err:#}")), + } + }, + ); let mut total = Stats { errors: open_errors, ..Default::default() }; for s in all { total.files += s.files; @@ -296,6 +284,7 @@ pub(crate) fn cmd_verify_gta4_collisions(game_dir: &Path, within: &str) -> Resul total.materials.extend(s.materials); total.errors.extend(s.errors); } + total.errors.sort(); for e in total.errors.iter().take(50) { outln!("FAIL {e}"); } @@ -329,43 +318,41 @@ pub(crate) fn cmd_verify_gta4_models(game_dir: &Path, within: &str) -> Result<() } let (starts, open_errors) = gta4_starts(game_dir, within)?; let started = Instant::now(); - let all: Vec = starts - .par_iter() - .map(|(prefix, a, dir)| { - let mut s = Stats::default(); - vfs::walk_gta4(a, *dir, prefix, &mut |id, p| { - let e = a.entry(id); - let lower = e.name.to_ascii_lowercase(); - let kind = ["wdr", "wdd", "wft"].into_iter().find(|x| lower.ends_with(&format!(".{x}"))); - let (Some(kind), Some(_)) = (kind, e.resource_type()) else { return }; - s.files += 1; - let parsed = a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| { - use rage_formats::wdr; - Ok(match kind { - "wdr" => vec![wdr::parse_wdr(&r)?], - "wdd" => wdr::parse_wdd(&r)?.into_iter().map(|(_, d)| d).collect(), - _ => { - let f = wdr::parse_wft(&r)?; - std::iter::once(f.drawable).chain(f.children.into_iter().map(|c| c.drawable)).collect() - } - }) - }); - match parsed { - Ok(ds) => { - for d in ds { - s.drawables += 1; - s.meshes += d.meshes.len(); - s.triangles += d.triangle_count(); - s.shaders += d.shaders.len(); - s.textured += d.shaders.iter().filter(|sh| sh.base_texture().is_some()).count(); - } + let all: Vec = for_each_gta4_entry_parallel( + &starts, + false, + |a, id| !a.entry(id).is_dir(), + |a, id, p, s: &mut Stats| { + let e = a.entry(id); + let lower = e.name.to_ascii_lowercase(); + let kind = ["wdr", "wdd", "wft"].into_iter().find(|x| lower.ends_with(&format!(".{x}"))); + let (Some(kind), Some(_)) = (kind, e.resource_type()) else { return }; + s.files += 1; + let parsed = a.read_resource(id).map_err(anyhow::Error::from).and_then(|r| { + use rage_formats::wdr; + Ok(match kind { + "wdr" => vec![wdr::parse_wdr(&r)?], + "wdd" => wdr::parse_wdd(&r)?.into_iter().map(|(_, d)| d).collect(), + _ => { + let f = wdr::parse_wft(&r)?; + std::iter::once(f.drawable).chain(f.children.into_iter().map(|c| c.drawable)).collect() } - Err(err) => s.errors.push(format!("{p}: {err:#}")), - } + }) }); - s - }) - .collect(); + match parsed { + Ok(ds) => { + for d in ds { + s.drawables += 1; + s.meshes += d.meshes.len(); + s.triangles += d.triangle_count(); + s.shaders += d.shaders.len(); + s.textured += d.shaders.iter().filter(|sh| sh.base_texture().is_some()).count(); + } + } + Err(err) => s.errors.push(format!("{p}: {err:#}")), + } + }, + ); let mut total = Stats { errors: open_errors, ..Default::default() }; for s in all { total.files += s.files; @@ -376,6 +363,7 @@ pub(crate) fn cmd_verify_gta4_models(game_dir: &Path, within: &str) -> Result<() total.textured += s.textured; total.errors.extend(s.errors); } + total.errors.sort(); for e in total.errors.iter().take(50) { outln!("FAIL {e}"); } @@ -543,82 +531,78 @@ pub(crate) fn cmd_verify_gta4_textures(game_dir: &Path, within: &str, rebuild: b } let (starts, open_errors) = gta4_starts(game_dir, within)?; let started = Instant::now(); - let all: Vec = starts - .par_iter() - .map(|(prefix, a, dir)| { - let mut s = Stats::default(); - vfs::walk_gta4(a, *dir, prefix, &mut |id, p| { - let e = a.entry(id); - let lower = e.name.to_ascii_lowercase(); - // Texture dictionaries, and models (.wdr) with textures of their own. - let model = lower.ends_with(".wdr"); - if e.resource_type().is_none() || !(lower.ends_with(".wtd") || model) { - return; - } - let read = a.read(id).map_err(anyhow::Error::from).and_then(|raw| { - let header = rage_resource::rsc5_header(&raw).context("no RSC5 header")?; - let res = rage_resource::Resource::from_rsc5(&raw)?; - let root = match model { - true => { - rage_formats::wdr::embedded_textures(&res, rage_resource::Resource::ROOT).map(|e| e.root) - } - false => Some(rage_resource::Resource::ROOT), - }; - let dict = root.map(|r| rage_formats::ytd::parse_gta4_at(&res, r)).transpose()?; - Ok((header, res, root.zip(dict))) - }); - let ((kind, flags), res, (root, dict)) = match read { - Ok((h, r, Some(d))) => (h, r, d), - Ok((_, _, None)) => return, - Err(err) => return s.errors.push(format!("{p}: {err:#}")), + let all: Vec = for_each_gta4_entry_parallel( + &starts, + false, + |a, id| !a.entry(id).is_dir(), + |a, id, p, s: &mut Stats| { + let e = a.entry(id); + let lower = e.name.to_ascii_lowercase(); + // Texture dictionaries, and models (.wdr) with textures of their own. + let model = lower.ends_with(".wdr"); + if e.resource_type().is_none() || !(lower.ends_with(".wtd") || model) { + return; + } + let read = a.read(id).map_err(anyhow::Error::from).and_then(|raw| { + let header = rage_resource::rsc5_header(&raw).context("no RSC5 header")?; + let res = rage_resource::Resource::from_rsc5(&raw)?; + let root = match model { + true => rage_formats::wdr::embedded_textures(&res, rage_resource::Resource::ROOT).map(|e| e.root), + false => Some(rage_resource::Resource::ROOT), }; - s.dicts += 1; - s.models += model as usize; - s.errors.extend(dict.errors.iter().map(|err| format!("{p}: {err}"))); - if rebuild && dict.errors.is_empty() { - // The writer's rebuild must read back to the same textures. - let mut same_memory = false; - let check = if model { - rage_formats::wtd_write::rebuild_embedded(&res, kind, flags, root, &dict) - .and_then(|file| rage_resource::Resource::from_rsc5(&file)) - .and_then(|r| { - // Nothing changed: the model must come out byte for byte. - same_memory = r.system == res.system && r.graphics == res.graphics; - rage_formats::ytd::parse_gta4_at(&r, root) - }) - } else { - rage_formats::wtd_write::rebuild(&res, kind, flags, &dict) - .and_then(|file| rage_resource::Resource::from_rsc5(&file)) - .and_then(|r| rage_formats::ytd::parse_gta4(&r)) - }; - s.identical += same_memory as usize; - let key = |d: &rage_formats::ytd::TextureDictionary| { - let mut v: Vec<_> = d - .textures - .iter() - .map(|t| (t.name.clone(), t.width, t.height, t.levels, t.format, t.data.clone())) - .collect(); - v.sort_by(|x, y| x.0.cmp(&y.0)); - v - }; - match check { - Ok(back) if back.errors.is_empty() && key(&back) == key(&dict) => s.rebuilt += 1, - Ok(_) => s.errors.push(format!("{p}: rebuilt dictionary differs")), - Err(e) => s.errors.push(format!("{p}: rebuild failed: {e}")), - } + let dict = root.map(|r| rage_formats::ytd::parse_gta4_at(&res, r)).transpose()?; + Ok((header, res, root.zip(dict))) + }); + let ((kind, flags), res, (root, dict)) = match read { + Ok((h, r, Some(d))) => (h, r, d), + Ok((_, _, None)) => return, + Err(err) => return s.errors.push(format!("{p}: {err:#}")), + }; + s.dicts += 1; + s.models += model as usize; + s.errors.extend(dict.errors.iter().map(|err| format!("{p}: {err}"))); + if rebuild && dict.errors.is_empty() { + // The writer's rebuild must read back to the same textures. + let mut same_memory = false; + let check = if model { + rage_formats::wtd_write::rebuild_embedded(&res, kind, flags, root, &dict) + .and_then(|file| rage_resource::Resource::from_rsc5(&file)) + .and_then(|r| { + // Nothing changed: the model must come out byte for byte. + same_memory = r.system == res.system && r.graphics == res.graphics; + rage_formats::ytd::parse_gta4_at(&r, root) + }) + } else { + rage_formats::wtd_write::rebuild(&res, kind, flags, &dict) + .and_then(|file| rage_resource::Resource::from_rsc5(&file)) + .and_then(|r| rage_formats::ytd::parse_gta4(&r)) + }; + s.identical += same_memory as usize; + let key = |d: &rage_formats::ytd::TextureDictionary| { + let mut v: Vec<_> = d + .textures + .iter() + .map(|t| (t.name.clone(), t.width, t.height, t.levels, t.format, t.data.clone())) + .collect(); + v.sort_by(|x, y| x.0.cmp(&y.0)); + v + }; + match check { + Ok(back) if back.errors.is_empty() && key(&back) == key(&dict) => s.rebuilt += 1, + Ok(_) => s.errors.push(format!("{p}: rebuilt dictionary differs")), + Err(e) => s.errors.push(format!("{p}: rebuild failed: {e}")), } - for t in &dict.textures { - s.textures += 1; - *s.formats.entry(t.format.name()).or_default() += 1; - match t.to_rgba() { - Some(_) => s.decoded += 1, - None => s.errors.push(format!("{p}/{}: cannot decode {}", t.name, t.format.name())), - } + } + for t in &dict.textures { + s.textures += 1; + *s.formats.entry(t.format.name()).or_default() += 1; + match t.to_rgba() { + Some(_) => s.decoded += 1, + None => s.errors.push(format!("{p}/{}: cannot decode {}", t.name, t.format.name())), } - }); - s - }) - .collect(); + } + }, + ); let mut total = Stats { errors: open_errors, ..Default::default() }; for s in all { total.dicts += s.dicts; @@ -632,6 +616,7 @@ pub(crate) fn cmd_verify_gta4_textures(game_dir: &Path, within: &str, rebuild: b *total.formats.entry(k).or_default() += v; } } + total.errors.sort(); for e in total.errors.iter().take(50) { outln!("FAIL {e}"); } From ae28791e44e4aa334ed8dffb2889b4ecb101f199 Mon Sep 17 00:00:00 2001 From: Philippe Date: Tue, 24 Nov 2026 20:17:35 +0100 Subject: [PATCH 8/8] GTA VI, maps in 3D and videos (#144) * GTA VI: archives, audio, metadata, textures and models GTA VI's archives (RPF9) have an encrypted table of contents, and the keys are only in the game's program. What is not encrypted is read without it: - RPF9 as a recovery view: the data area is scanned once for zlib streams, Bink 2 videos and audio containers; files are named by their offset and sorted into folders by what they start with. The index is stored per archive and made in the background when the game is opened. - A folder with GTA VI's archives counts as a game without a program and without keys. The setup says Open instead of Derive keys and can always be left. - Audio: GTA VI's containers (two more tables, Opus instead of Vorbis), sounds and multi-channel streams, decoded with opus-rs. - Metadata: PSIN with an LSCH schema and the RBF0 variant with 8-byte numbers, both as XML. Tables of zero-ended strings open as text. - Textures: the texture pools (.ttpf) open as folders of 64 textures; 2D textures, arrays and cube maps, with BCPack for BC1, BC3, BC4 and BC5. `openrage ttpf` counts and exports a pool. - Models: drawables, fragments and drawable dictionaries open in the viewer, listed by their own names under models/, with the base colour texture of their materials from the texture pools. Not read: BCPack for BC6H and BC7, volume textures, skeletons and skinning, Bink 2 video (no free decoder), and everything that needs names from the table of contents. Format knowledge and its sources are in NOTICE.md (Leonida, rpf9-explorer, Microsoft's silicon-rans tables). Co-Authored-By: Claude Fable 5.2 * GTA VI: decrypt the RPF9 table of contents from the game executable Adds the native RPF9 reader that decodes the encrypted table of contents, using cipher material read from the user's own game_scarlett_master.exe (nothing is bundled; an unknown build is rejected by its SHA-256): - rpf9_cipher: the Scarlett build's table-driven 16-byte block transform (not standard AES, which is why it resisted key scanning), CBC for the header and AES-CTR (algorithm 17) for members. Key schedules and tables are read from the executable by selector. - rpf9_index: parses the decoded header into validated native tables and entries (slot, offset, sizes, type, name hashes, storage). - rpf9_names: the native 32-bit Jenkins and 64-bit Murmur name-hash leaves, path-candidate collection, and the static extension<->type mapping. - rpf9_native: finds the executable beside the archive, builds the cipher once, decodes the header (selector 9: two chained metadata spans), and parses the catalog. Verified against the local 1.0.2.1 Xbox archives: the header decrypts and the catalogs parse with the exact declared entry counts (common 418, data 699, audio 103), matching the clear-header fields. Not yet wired into the browse/extract path (the modules are staged behind allow(dead_code)); reading member payloads (chunked/CTR), the Rpf9/GUI integration and wider name recovery follow. The clear header now also exposes its declared slot count and transform selector, and the CLI/GUI recognize the executable for GTA VI. The cipher, index, name and documentation modules were reconstructed from the executable by a contributor; this commit fixes the missing extension-for-type mapping, resolves lints, and adds the decryption verification. Co-Authored-By: Claude Opus 4.8 * GTA VI: read members and browse archives by their own table Members are decoded from their chunk, encryption and resource records; nested archives open like folders. Names come from strings in the executable and the game's metadata, checked against the table's hashes. Also regenerates the third-party licence files. Co-Authored-By: Claude Opus 5.5 * GTA VI: names inside nested archives, expand archives on extraction Models, clip dictionaries and some other types hold their own name, which is checked against the hash in the archive's table. Opened tables are kept. Co-Authored-By: Claude Opus 5.5 * GTA VI: extensions of registered types, names that follow patterns Co-Authored-By: Claude Opus 5.5 * GTA VI: tell sounds and other unnamed files by their content Co-Authored-By: Claude Opus 5.5 * GTA VI: texture dictionaries, maps and types; containers with one sound play at once Co-Authored-By: Claude Opus 5.5 * GTA VI: show collisions Co-Authored-By: Claude Opus 5.5 * Preview: centre models, sharp on scaled screens, waveforms fill the area; GTA VI texture sheets and icons Co-Authored-By: Claude Opus 5.5 * GTA VI: show navigation meshes Co-Authored-By: Claude Opus 5.5 * Search: index GTA VI archives, their metadata and game text Native RPF9 archives and those nested in them are indexed in parts, in parallel and cancellable; metadata (#mt) as XML, language files (#ldbmt) as label hash and text. Searches find names that are only known as hashes, text hits have room beside names, words with punctuation match, paths are found, and results of every game show their matching line. Co-Authored-By: Claude Opus 5.5 * GTA VI: read text tables Co-Authored-By: Claude Opus 5.5 * Bink 2 videos: decoder, CLI export, player in the preview Pure Rust decoder for .bk2 (KB2g to KB2n) with alpha and sound, ported from Librempeg (GPL-3.0-or-later). openrage media exports frames as PNG and sound as WAV; the GUI preview shows the first frame and plays, pauses and seeks. Co-Authored-By: Claude Opus 5.5 * GTA VI clip dictionaries and skeletons: list, verify and play clips Reads .#cd files: clips with their layers joined, all channel kinds the game uses (with the new eight-lane packed floats), tracks by name hash. Skeletons and byte-indexed skinning of GTA VI models; clips and verify --animations on the command line, clip list in the GUI. Co-Authored-By: Claude Opus 5.5 * Order modules * Search index and GTA VI keys use threads of their own Co-Authored-By: Claude Opus 5.5 * README: what GTA VI support covers Co-Authored-By: Claude Opus 5.5 * Fix the findings of the review: GTA VI XML, video shape, stuck previews, limits for damaged files Co-Authored-By: Claude Opus 5.5 * Videos of every game in a player window; stop, resume and progress of the index Bink 1 (revisions f to k) is decoded, so the videos of GTA IV and V play like those of RDR2 and GTA VI; RDR2's have no names and are told by their content. A double click opens a video in a window of its own with volume, repeat and full screen. Sounds are played without a copy in memory, and the picture of a long video is there before its sound is read. The status bar shows how far the search index is and can stop it and go on. Co-Authored-By: Claude Opus 5.5 * GTA VI: parts of people and animals move with their skeleton A model lists the hashes of its bones' names. Parts name those of a base skeleton in metaped_fragments.rpf, so clips play on them; bones of garments and hair hang from the body. Bone numbers of 32 bits are read too. Co-Authored-By: Claude Opus 5.5 * GTA VI: the map in 3D, materials, names across archives A map file is shown with what lies around it, and the whole world from afar; models of dictionaries are found by the hash of their name. Models show their normal and specular maps (GTA V Enhanced too) and can have up to 1024 bones. Files without a name are named after those of other archives once the index is built (155,000 of them), and more metadata opens as XML. Loading the keys or the skeletons from a worker thread could wait for itself; no longer. Co-Authored-By: Claude Opus 5.5 * Website and README: GTA VI works Co-Authored-By: Claude Opus 5.5 * Map: fly through it with details loaded around the camera; orbit on a circle The whole map of GTA VI shows the level of detail that fits where the camera is, after the tree in the map files. Maps and cutscenes get a flying camera; the wheel sets its speed, in model views too. Orbiting no longer shifts the camera with the angle, which felt like an ellipse. Depth is reversed, so that scenes of kilometres do not flicker. Files listed before their name was learned are still found. Co-Authored-By: Claude Opus 5.5 * Website: a short GTA VI section and a page of its own Co-Authored-By: Claude Opus 5.5 * Website: screenshots and an accent of its own for GTA VI Co-Authored-By: Claude Opus 5.5 * README and website: drop the note on where the screenshots come from Co-Authored-By: Claude Opus 5.5 * Maps: sky, sun, haze and water; pictures drawn much faster Placements of a model are drawn together, a model has one buffer, and only what changes is set between draws. Textures have smaller copies for the distance, new models are uploaded by the loading thread, and what is smaller than a pixel is left out. Pictures of scenes are at most Full HD. Co-Authored-By: Claude Opus 5.5 * Maps: textures in full size, decals, layers, water, time of day Textures go to the graphics card compressed as the game has them and are shared between models; near the camera they are read in full size. Decals are blended, layered grounds mixed and shaded by what GTA VI stores per vertex. There is a sea with waves, and beside the map settings for the time of day, haze, sea, field of view and detail. Models share buffers, vertices are half as large, the list of what to draw is made in parallel, and a moving view does not wait for the graphics card. Co-Authored-By: Claude Opus 5.5 * Website: another picture at the top of the GTA VI page Co-Authored-By: Claude Opus 5.5 * Release 0.6.0: version Co-Authored-By: Claude Opus 5.5 * Release 0.6.0: version of the workspace crates and the lock file Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Fable 5.2 --- Cargo.lock | 34 +- Cargo.toml | 18 +- NOTICE.md | 52 + README.md | 21 +- THIRD_PARTY_LICENSES.md | 209 ++- crates/openrage-app/Cargo.toml | 1 + crates/openrage-app/src/anim.rs | 11 +- crates/openrage-app/src/audio.rs | 1 + crates/openrage-app/src/detect.rs | 60 +- crates/openrage-app/src/gta4_cutscene.rs | 2 +- crates/openrage-app/src/gta6_models.rs | 322 ++++ crates/openrage-app/src/gta6_textures.rs | 170 +++ crates/openrage-app/src/gta6_world.rs | 913 ++++++++++++ crates/openrage-app/src/lib.rs | 4 + crates/openrage-app/src/media.rs | 32 +- crates/openrage-app/src/metadata.rs | 21 +- crates/openrage-app/src/models.rs | 67 +- crates/openrage-app/src/plugins.rs | 24 +- crates/openrage-app/src/render.rs | 146 +- crates/openrage-app/src/rpf9.rs | 531 +++++++ crates/openrage-app/src/textures.rs | 6 + .../src/third_party_licenses.json | 2 +- crates/openrage-cli/src/cli.rs | 40 +- crates/openrage-cli/src/cmd/archive.rs | 118 ++ crates/openrage-cli/src/cmd/edit.rs | 1 + crates/openrage-cli/src/cmd/search.rs | 89 +- crates/openrage-cli/src/cmd/verify.rs | 259 +++- crates/openrage-cli/src/cmd/view.rs | 132 +- crates/openrage-cli/src/main.rs | 68 +- crates/openrage-gui/src/audio.rs | 149 +- crates/openrage-gui/src/badges.rs | 26 +- crates/openrage-gui/src/browser.rs | 137 +- crates/openrage-gui/src/callbacks.rs | 56 +- crates/openrage-gui/src/debug.rs | 29 +- crates/openrage-gui/src/docs.rs | 31 +- crates/openrage-gui/src/extract_ui.rs | 18 + crates/openrage-gui/src/fly.rs | 148 ++ crates/openrage-gui/src/gpu.rs | 1138 ++++++++++++--- crates/openrage-gui/src/main.rs | 39 +- crates/openrage-gui/src/model_ui.rs | 29 +- crates/openrage-gui/src/navigate.rs | 31 + crates/openrage-gui/src/player.rs | 264 ++++ crates/openrage-gui/src/plugins_ui.rs | 1 + crates/openrage-gui/src/preview.rs | 277 +++- crates/openrage-gui/src/scene.rs | 373 ++++- crates/openrage-gui/src/search.rs | 100 +- crates/openrage-gui/src/setup_ui.rs | 83 +- crates/openrage-gui/src/sound_ui.rs | 63 +- crates/openrage-gui/src/stream.rs | 219 +++ crates/openrage-gui/src/video_ui.rs | 246 ++++ crates/openrage-gui/src/viewer.rs | 84 +- crates/openrage-gui/src/xmlview.rs | 5 +- crates/openrage-gui/ui/app.slint | 632 +++++++- crates/rage-formats/Cargo.toml | 1 + crates/rage-formats/src/awc.rs | 241 ++- crates/rage-formats/src/bcpack/mod.rs | 594 ++++++++ crates/rage-formats/src/bcpack/tables.rs | 1125 ++++++++++++++ crates/rage-formats/src/bink/audio.rs | 287 ++++ crates/rage-formats/src/bink/bits.rs | 97 ++ crates/rage-formats/src/bink/mod.rs | 375 +++++ crates/rage-formats/src/bink/tables1.rs | 401 +++++ crates/rage-formats/src/bink/tables2.rs | 159 ++ crates/rage-formats/src/bink/video1.rs | 727 +++++++++ crates/rage-formats/src/bink/video2.rs | 1256 ++++++++++++++++ crates/rage-formats/src/bn6.rs | 264 ++++ crates/rage-formats/src/clip.rs | 182 ++- crates/rage-formats/src/clip6.rs | 407 ++++++ crates/rage-formats/src/drawable.rs | 18 +- crates/rage-formats/src/drawable6.rs | 802 ++++++++++ crates/rage-formats/src/lib.rs | 8 + crates/rage-formats/src/media.rs | 64 +- crates/rage-formats/src/meta.rs | 176 ++- crates/rage-formats/src/paths.rs | 43 + crates/rage-formats/src/psin.rs | 695 +++++++++ crates/rage-formats/src/rbf.rs | 61 +- crates/rage-formats/src/td6.rs | 159 ++ crates/rage-formats/src/ttpf.rs | 718 +++++++++ crates/rage-formats/src/wad.rs | 4 +- crates/rage-index/Cargo.toml | 2 + crates/rage-index/src/content.rs | 181 ++- crates/rage-index/src/gta6.rs | 141 ++ crates/rage-index/src/lib.rs | 10 +- crates/rage-index/src/schema.rs | 3 +- crates/rage-index/src/search.rs | 115 +- crates/rage-index/src/update.rs | 356 ++++- crates/rage-rpf/README.md | 7 + crates/rage-rpf/src/error.rs | 3 + crates/rage-rpf/src/lib.rs | 26 +- crates/rage-rpf/src/rpf9.rs | 1294 +++++++++++++++++ crates/rage-rpf/src/rpf9_cipher.rs | 357 +++++ crates/rage-rpf/src/rpf9_index.rs | 415 ++++++ crates/rage-rpf/src/rpf9_names.rs | 478 ++++++ crates/rage-rpf/src/rpf9_native.rs | 528 +++++++ crates/rage-rpf/src/vfs.rs | 45 +- docs/publishing.md | 4 +- docs/rpf9-name-hashes.md | 112 ++ docs/rpf9-scarlett.md | 139 ++ site/config.toml | 2 +- site/content/_index.md | 22 +- site/content/cli.md | 1 + site/content/gta-vi.md | 155 ++ site/content/viewers.md | 2 +- site/static/gta6/fly.webp | Bin 0 -> 94898 bytes site/static/gta6/map.webp | Bin 0 -> 24582 bytes site/static/gta6/model.webp | Bin 0 -> 32322 bytes site/static/gta6/video.webp | Bin 0 -> 13742 bytes site/static/style.css | 70 + site/templates/base.html | 1 - site/templates/gta-vi.html | 83 ++ site/templates/index.html | 17 +- 110 files changed, 20089 insertions(+), 876 deletions(-) create mode 100644 crates/openrage-app/src/gta6_models.rs create mode 100644 crates/openrage-app/src/gta6_textures.rs create mode 100644 crates/openrage-app/src/gta6_world.rs create mode 100644 crates/openrage-app/src/rpf9.rs create mode 100644 crates/openrage-gui/src/fly.rs create mode 100644 crates/openrage-gui/src/player.rs create mode 100644 crates/openrage-gui/src/stream.rs create mode 100644 crates/openrage-gui/src/video_ui.rs create mode 100644 crates/rage-formats/src/bcpack/mod.rs create mode 100644 crates/rage-formats/src/bcpack/tables.rs create mode 100644 crates/rage-formats/src/bink/audio.rs create mode 100644 crates/rage-formats/src/bink/bits.rs create mode 100644 crates/rage-formats/src/bink/mod.rs create mode 100644 crates/rage-formats/src/bink/tables1.rs create mode 100644 crates/rage-formats/src/bink/tables2.rs create mode 100644 crates/rage-formats/src/bink/video1.rs create mode 100644 crates/rage-formats/src/bink/video2.rs create mode 100644 crates/rage-formats/src/bn6.rs create mode 100644 crates/rage-formats/src/clip6.rs create mode 100644 crates/rage-formats/src/drawable6.rs create mode 100644 crates/rage-formats/src/psin.rs create mode 100644 crates/rage-formats/src/td6.rs create mode 100644 crates/rage-formats/src/ttpf.rs create mode 100644 crates/rage-index/src/gta6.rs create mode 100644 crates/rage-rpf/src/rpf9.rs create mode 100644 crates/rage-rpf/src/rpf9_cipher.rs create mode 100644 crates/rage-rpf/src/rpf9_index.rs create mode 100644 crates/rage-rpf/src/rpf9_names.rs create mode 100644 crates/rage-rpf/src/rpf9_native.rs create mode 100644 docs/rpf9-name-hashes.md create mode 100644 docs/rpf9-scarlett.md create mode 100644 site/content/gta-vi.md create mode 100644 site/static/gta6/fly.webp create mode 100644 site/static/gta6/map.webp create mode 100644 site/static/gta6/model.webp create mode 100644 site/static/gta6/video.webp create mode 100644 site/templates/gta-vi.html diff --git a/Cargo.lock b/Cargo.lock index 0e7dc6e..fc7c309 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3981,10 +3981,11 @@ dependencies = [ [[package]] name = "openrage-app" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "dirs", + "flate2", "memchr", "openrage-plugins", "png", @@ -4003,7 +4004,7 @@ dependencies = [ [[package]] name = "openrage-cli" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "clap", @@ -4022,7 +4023,7 @@ dependencies = [ [[package]] name = "openrage-gui" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "arboard", @@ -4049,7 +4050,7 @@ dependencies = [ [[package]] name = "openrage-plugins" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "dirs", @@ -4068,6 +4069,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "opus-rs" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafbcaf2ed381cdf68ced4ed8d16517de90ffd7424e36f0b9e45d67fbe30b1f9" + [[package]] name = "orbclient" version = "0.3.55" @@ -4528,11 +4535,11 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rage-core" -version = "0.5.0" +version = "0.6.0" [[package]] name = "rage-crypto" -version = "0.5.0" +version = "0.6.0" dependencies = [ "aes", "flate2", @@ -4543,10 +4550,11 @@ dependencies = [ [[package]] name = "rage-formats" -version = "0.5.0" +version = "0.6.0" dependencies = [ "flate2", "lewton", + "opus-rs", "png", "rage-core", "rage-resource", @@ -4559,11 +4567,13 @@ dependencies = [ [[package]] name = "rage-index" -version = "0.5.0" +version = "0.6.0" dependencies = [ "flate2", "rage-core", "rage-crypto", + "rage-formats", + "rage-resource", "rage-rpf", "rayon", "rusqlite", @@ -4572,7 +4582,7 @@ dependencies = [ [[package]] name = "rage-mods" -version = "0.5.0" +version = "0.6.0" dependencies = [ "rage-crypto", "rage-rpf", @@ -4580,7 +4590,7 @@ dependencies = [ [[package]] name = "rage-resource" -version = "0.5.0" +version = "0.6.0" dependencies = [ "flate2", "thiserror 2.0.21", @@ -4588,7 +4598,7 @@ dependencies = [ [[package]] name = "rage-rpf" -version = "0.5.0" +version = "0.6.0" dependencies = [ "flate2", "memchr", @@ -4604,7 +4614,7 @@ dependencies = [ [[package]] name = "rage-tfit2" -version = "0.5.0" +version = "0.6.0" [[package]] name = "rand" diff --git a/Cargo.toml b/Cargo.toml index 9bc00e7..de977b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/*"] [workspace.package] -version = "0.5.0" +version = "0.6.0" edition = "2024" license = "GPL-3.0-only" repository = "https://github.com/Two-Play/openrage" @@ -13,14 +13,14 @@ authors = ["OpenRAGE contributors"] rust-version = "1.99" [workspace.dependencies] -rage-core = { path = "crates/rage-core", version = "0.5.0" } -rage-crypto = { path = "crates/rage-crypto", version = "0.5.0" } -rage-tfit2 = { path = "crates/rage-tfit2", version = "0.5.0" } -rage-rpf = { path = "crates/rage-rpf", version = "0.5.0", features = ["rdr2"] } -rage-index = { path = "crates/rage-index", version = "0.5.0" } -rage-mods = { path = "crates/rage-mods", version = "0.5.0" } -rage-resource = { path = "crates/rage-resource", version = "0.5.0" } -rage-formats = { path = "crates/rage-formats", version = "0.5.0" } +rage-core = { path = "crates/rage-core", version = "0.6.0" } +rage-crypto = { path = "crates/rage-crypto", version = "0.6.0" } +rage-tfit2 = { path = "crates/rage-tfit2", version = "0.6.0" } +rage-rpf = { path = "crates/rage-rpf", version = "0.6.0", features = ["rdr2"] } +rage-index = { path = "crates/rage-index", version = "0.6.0" } +rage-mods = { path = "crates/rage-mods", version = "0.6.0" } +rage-resource = { path = "crates/rage-resource", version = "0.6.0" } +rage-formats = { path = "crates/rage-formats", version = "0.6.0" } aes = "0.8" anyhow = "1" diff --git a/NOTICE.md b/NOTICE.md index 5a60ca7..ed9b825 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -51,6 +51,58 @@ Vorbis audio (Red Dead Redemption 2) is decoded with lewton (https://github.com/RustAudio/lewton), licensed under the MIT or Apache-2.0 license. +## opus-rs + +Opus audio (GTA VI) is decoded with opus-rs +(https://github.com/restsend/opus-rs), a port of libopus, licensed under the +BSD 3-Clause licence. + +## Librempeg + +The Bink 2 video and audio decoder in `crates/rage-formats/src/bink` is a port +to Rust of the one in Librempeg (https://github.com/librempeg/librempeg; +`libavcodec/bink2.c`, `bink2.h`, `bink2g.h`, `libavcodec/binkaudio.c` and +`libavformat/bink.c`), which is licensed under the GNU General Public License +version 3 or later and used here under version 3: + +``` +Copyright (c) 2014 Konstantin Shishkov +Copyright (c) 2019 Paul B Mahol +Copyright (c) 2007-2011 Peter Ross +Copyright (c) 2009 Daniel Verkamp +``` + +## FFmpeg + +The Bink 1 video decoder in `crates/rage-formats/src/bink` (`video1.rs`, +`tables1.rs`) is a port to Rust of the one in FFmpeg (https://ffmpeg.org; +`libavcodec/bink.c`, `binkdata.h` and `binkdsp.c`), which is licensed under the +GNU Lesser General Public License version 2.1 or later and used here under the +GNU General Public License version 3, as section 3 of the former allows: + +``` +Copyright (c) 2009 Konstantin Shishkov +Copyright (c) 2011 Peter Ross +``` + +Bink is a trademark of Epic Games Tools LLC (RAD Game Tools). OpenRAGE is not +affiliated with them and contains none of their code. + +## Leonida + +What is known about GTA VI's formats (RPF9 archives, audio containers, PSIN +and RBF0 metadata, texture pools) comes from the documentation of Leonida +(https://github.com/ItsNotRexed/Leonida, GPL-3.0). The PSIN reader in +`crates/rage-formats/src/psin.rs` follows its `tools/psin_data.py`, the +texture pool reader in `crates/rage-formats/src/ttpf.rs` its +`tools/ttpf_mips.py` and `tools/tex_headers.py`. + +## rpf9-explorer + +The layout of GTA VI's models (`crates/rage-formats/src/drawable6.rs`) is the +one found by rpf9-explorer (https://github.com/breadbbbb/rpf9-explorer). Its +decoder was read to learn the layout; no code was taken from it. + ## RDR2-RPF-Tool The TFIT2-CBC cipher and the strided file encryption of Red Dead Redemption 2 diff --git a/README.md b/README.md index bbcceac..4db5214 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,12 @@ # OpenRAGE -**The open-source successor to OpenIV — mod GTA V and Red Dead Redemption 2 on Linux and Windows.** +**The open-source successor to OpenIV — mod GTA V and Red Dead Redemption 2, and explore GTA VI, on Linux and Windows.** + +### 🌴 New: GTA VI works! + +**Browse and search its RPF9 archives, view the whole map in 3D, models, textures and animations, play sounds and videos.**
+[What works in GTA VI](https://two-play.github.io/openrage/gta-vi/) (read-only preview, with your own copy of the game) Browse and search every archive, preview textures, models, sounds and animations, read metadata as XML,
edit game text and install `.oiv` packages — compatible with OpenIV's `mods` folder, with undo. @@ -34,13 +39,13 @@ edit game text and install `.oiv` packages — compatible with OpenIV's `mods` f OpenIV's last release was in January 2022. OpenRAGE picks up where it left off and stays compatible with it. +- **GTA VI explorer (preview):** browse and extract RPF9 archives, with folders, names and nested archives; see the whole map in 3D; preview models with their materials, collisions, navigation meshes, textures, metadata and text tables, play sounds and videos, search names and text, list clip dictionaries and play them on vehicles, weapons, props and parts of people. - **Explorer and search:** archives, even nested ones, open like folders, as a list or as icons; names, hashes and full text of the whole game in milliseconds. -- **Every major format:** textures, models, audio, animations, metadata as XML, collisions, paths, nav meshes, cutscenes, scripts, game text. +- **Every major format:** textures, models, audio, videos (Bink 1 and 2, with a player), animations, metadata as XML, collisions, paths, nav meshes, cutscenes, scripts, game text. - **Coming from OpenIV?** Your `mods` folder and `.oiv` packages work as they are ([how to switch](https://two-play.github.io/openrage/getting-started/#coming-from-openiv)). - **Mods, safely:** changes go to OpenIV's `mods` folder, never into your game files; every change and every `.oiv` package can be undone. - **Models in:** replace props and vehicle bodies of GTA V Enhanced with your own OBJ models; doors and bonnets keep moving (preview). - **ASI mods:** see and switch GTA V's ASI mods, and on Linux let Proton load the ASI loader with one click. -- **Ready for GTA VI:** support follows as fast as possible once GTA VI comes to PC. - **Tested on the whole game:** every format is checked against every file of GTA V ([details](https://two-play.github.io/openrage/#status)). @@ -61,8 +66,8 @@ More screenshots and all features: **[two-play.github.io/openrage](https://two-p | Game | Archives | Formats | |---|---|---| | **GTA V** (Legacy & Enhanced) | ✅ read and edit (mods folder, with undo) | ✅ textures (also inside models) · models · audio · animations · metadata · text · collisions · paths · cutscenes · scripts · ASI mods (manager, Proton fix on Linux) · ◐ model import from OBJ with compressed textures and detail levels (Enhanced `.ydr` and vehicle bodies `.yft`, preview; explorer via the OBJ tools plugin) | +| **GTA VI** (Scarlett build, preview) | ◐ read-only RPF9: the table of contents is read with the game's own executable (one build); without it, a recovery view. Names of models and clips are known, of some other types not | ◐ models with skeletons · clip dictionaries (`.#cd`) · texture pools (`.ttpf`) and dictionaries (`.#td`; no volumes) · collisions (`.#bn`) · navigation meshes (`.#nv`) · maps in 3D · metadata, maps and text tables as XML (`.#mt`, `.#map`, `.#typ`, `.#ldbmt` and others) · audio · videos | | **Red Dead Redemption 2** | ✅ read, with keys from your own game · ◐ edit (Lenny's Mod Loader `lml/replace` folder, with undo; nested archives rewritten; not yet tried in the game) | ◐ textures (replace same-shape) · models with moving parts and cloth · texts · metadata · audio · animations on fitting models · ped outfits (read-only) | -| **GTA VI** | 🔜 next: as fast as possible once it comes to PC | – | | **GTA IV** (Complete Edition) | ✅ read (IMG3, RPF2, RPF3), key from your own `GTAIV.exe` | ◐ textures · models · collisions · animations · text · scripts · maps in 3D · cutscenes (played with their cast, camera, subtitles and particle effects) · particle effect lists (`.wpfl`) · editing `.img`, `.rpf`, placement files, loose files and textures (`.wtd`, inside `.wdr`) (update folder, or the game files with originals kept) | **Plugins** (API 0.3, preview): sandboxed WebAssembly plugins add file types, previews (text, tree, table, image, 3D model), tool windows of their own (Tools menu), export and batch actions with access to the game's models and textures, and changes to game files through the `mods` folder (with undo), for every game. ✅ explorer (file list, preview, context menu, Settings → Plugins) and command line (`openrage plugin`), four example plugins included (OBJ export and import, a number and hash converter among them) · plugin packages (`.orp`) with install/uninstall in the explorer and the CLI · models into game formats (`build-model`) · ✅ openFormats: OpenIV's text formats (`.odr`, `.oft`, `.odd`, `.otd` with `.mesh`, `.skel`, DDS) exported and imported back (preview). [Writing plugins](https://two-play.github.io/openrage/plugins/) @@ -71,6 +76,10 @@ More screenshots and all features: **[two-play.github.io/openrage](https://two-p Download the [latest release](https://github.com/Two-Play/openrage/releases/latest) for Linux (AppImage, Flatpak or `.tar.gz`) or Windows (`.zip`) and start `openrage-gui`. On first start it finds your game and sets up the keys. Step by step: **[Getting started](https://two-play.github.io/openrage/getting-started/)**. +For the GTA VI preview, choose the folder containing `game_scarlett_master.exe` or RPF9 archives. With the supported executable beside the archives, OpenRAGE reads their tables of contents with the keys in it (the keys are not stored), so archives open at once. Names are matched to the hashes in the tables; files without a match are listed under `entries/`. Without the executable, or with another build, the explorer indexes the archives in the background and caches the results, which can take several minutes for large archives; recovered entries are then grouped by file type and offset, with model names recovered from their data where possible. Editing RPF9 archives is not supported. + +The CLI also supports browsing, extraction and verification, for example `openrage --game ls common.rpf` and `openrage --game verify common.rpf` (or a folder or file inside it). Running `verify` without a path checks all RPF9 archives below the game folder. Verification decodes the entries with checksum, size and bounds checks and returns an error on a failed entry; in the recovery view, unread data is outside its coverage. Nested archives are checked when their path is given. `verify --animations ` reads the clip dictionaries below a path, nested archives included; other format-specific verification and `--rebuild` are not supported for GTA VI yet. + To build from source (Rust, pinned in `rust-toolchain.toml`; on Linux also the fontconfig, xkbcommon, Wayland and ALSA development packages): ```sh @@ -84,7 +93,7 @@ cargo build --release # target/release/openrage-gui and target/release/open - [Explorer and search](https://two-play.github.io/openrage/guide/): the window, keyboard, search, settings - [Viewing files](https://two-play.github.io/openrage/viewers/): what each format shows and exports - [Modding](https://two-play.github.io/openrage/modding/): edit mode, editing archives, undo, `.oiv` packages, the `mods` folder -- [GTA IV](https://two-play.github.io/openrage/gta-iv/) and [Red Dead Redemption 2](https://two-play.github.io/openrage/rdr2/): setup and what works per game +- [GTA VI](https://two-play.github.io/openrage/gta-vi/), [GTA IV](https://two-play.github.io/openrage/gta-iv/) and [Red Dead Redemption 2](https://two-play.github.io/openrage/rdr2/): setup and what works per game - [Command line](https://two-play.github.io/openrage/cli/): every `openrage` command - [Writing plugins](https://two-play.github.io/openrage/plugins/): sandboxed WebAssembly plugins, SDK and API - [Development](https://two-play.github.io/openrage/development/): building from source, build environment, releases, project layout @@ -95,4 +104,4 @@ The website lives in [`site/`](site/) and is built from Markdown. GPL-3.0-only, except `crates/rage-tfit2` (the RDR2 archive cipher, ported from an AGPL-3.0 project), which is AGPL-3.0-only, and the plugin interface and SDK (`crates/openrage-plugins/wit`, `plugins/`), which are MIT OR Apache-2.0 so that plugins may use any licence. See [LICENSE](LICENSE) and [NOTICE.md](NOTICE.md) for third-party attributions, and [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md) for the licenses of all third-party crates in the programs (generated from `Cargo.lock`, checked in CI). The same is in the app under **Help → About OpenRAGE**, via `openrage licenses` and on the [licenses page](https://two-play.github.io/openrage/licenses/). -Grand Theft Auto, Red Dead Redemption, RAGE and Rockstar Games are trademarks of Take-Two Interactive Software, Inc. The screenshots show OpenRAGE displaying files from the author's own copy of the game. +Grand Theft Auto, Red Dead Redemption, RAGE and Rockstar Games are trademarks of Take-Two Interactive Software, Inc. diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index 8dff725..65eecd2 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -3,7 +3,7 @@ OpenRAGE is licensed under the GPL-3.0-only (see `LICENSE`); `crates/rage-tfit2` under the AGPL-3.0-only. Credits for format knowledge and ported code are in `NOTICE.md`. -The OpenRAGE programs contain the following 546 Rust crates. Their license texts +The OpenRAGE programs contain the following 547 Rust crates. Their license texts follow, each with the crates it applies to. This file is generated by `dev/third_party_licenses.py`; do not edit it by hand. @@ -281,6 +281,7 @@ This file is generated by `dev/third_party_licenses.py`; do not edit it by hand. | [once_cell_polyfill](https://github.com/polyfill-rs/once_cell_polyfill) | 1.70.2 | MIT OR Apache-2.0 | | [oozextract](https://github.com/lvlvllvlvllvlvl/oozextract) | 0.5.7 | MIT | | [option-ext](https://github.com/soc/option-ext.git) | 0.2.0 | MPL-2.0 | +| [opus-rs](https://github.com/restsend/opus-rs) | 0.1.42 | BSD-3-Clause | | [ordered-float](https://github.com/reem/rust-ordered-float) | 5.5.1 | MIT | | [ordered-stream](https://github.com/danieldg/ordered-stream) | 0.2.0 | MIT OR Apache-2.0 | | [os_pipe](https://github.com/oconnor663/os_pipe.rs) | 1.2.3 | MIT | @@ -8365,6 +8366,60 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) #44 +Used by: opus-rs 0.1.42 + +~~~~text + +Copyright 2026 restsend.com + +Copyright 2001-2023 Xiph.Org, Skype Limited, Octasic, + Jean-Marc Valin, Timothy B. Terriberry, + CSIRO, Gregory Maxwell, Mark Borgerding, + Erik de Castro Lopo, Mozilla, Amazon + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Opus is subject to the royalty-free patent licenses which are +specified at: + +Xiph.Org Foundation: +https://datatracker.ietf.org/ipr/1524/ + +Microsoft Corporation: +https://datatracker.ietf.org/ipr/1914/ + +Broadcom Corporation: +https://datatracker.ietf.org/ipr/1526/ +~~~~ + +### BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) #45 + Used by: encoding_rs 0.8.44 ~~~~text @@ -8424,7 +8479,7 @@ pub(crate) static GB18030_2022_OVERRIDE_BYTES: [[u8; 2]; 18] = [ ]; ~~~~ -### BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) #45 +### BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) #46 Used by: tiny-skia 0.11.4, tiny-skia 0.12.0, tiny-skia-path 0.11.4, tiny-skia-path 0.12.0 @@ -8461,7 +8516,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ~~~~ -### BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) #46 +### BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) #47 Used by: encoding_rs 0.8.44 @@ -8494,7 +8549,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ~~~~ -### Boost Software License 1.0 (BSL-1.0) #47 +### Boost Software License 1.0 (BSL-1.0) #48 Used by: error-code 3.4.0 @@ -8524,7 +8579,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### Boost Software License 1.0 (BSL-1.0) #48 +### Boost Software License 1.0 (BSL-1.0) #49 Used by: clipboard-win 5.4.3 @@ -8538,7 +8593,7 @@ The copyright notices in the Software and this entire statement, including the a THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### GNU General Public License v3.0 only (GPL-3.0-only) #49 +### GNU General Public License v3.0 only (GPL-3.0-only) #50 Used by: i-slint-backend-selector 1.18.1, i-slint-backend-winit 1.18.1, i-slint-common 1.18.1, i-slint-compiler 1.18.1, i-slint-core 1.18.1, i-slint-core-macros 1.18.1, i-slint-renderer-femtovg 1.18.1, i-slint-renderer-software 1.18.1, slint 1.18.1, slint-build 1.18.1, slint-macros 1.18.1 @@ -8777,7 +8832,7 @@ You should also get your employer (if you work as a programmer) or school, if an The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ~~~~ -### ISC License (ISC) #50 +### ISC License (ISC) #51 Used by: libloading 0.8.9 @@ -8796,7 +8851,7 @@ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE US THIS SOFTWARE. ~~~~ -### MIT License (MIT) #51 +### MIT License (MIT) #52 Used by: uds_windows 1.2.1 @@ -8824,7 +8879,7 @@ Used by: uds_windows 1.2.1 SOFTWARE ~~~~ -### MIT License (MIT) #52 +### MIT License (MIT) #53 Used by: cfg_aliases 0.2.2 @@ -8857,7 +8912,7 @@ The `cfg_aliases!` macro uses a lot of the code from [`tectonic_cfg_support::tar --- ~~~~ -### MIT License (MIT) #53 +### MIT License (MIT) #54 Used by: texpresso 2.0.2 @@ -8924,7 +8979,7 @@ where } ~~~~ -### MIT License (MIT) #54 +### MIT License (MIT) #55 Used by: mio 1.2.4 @@ -8950,7 +9005,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #55 +### MIT License (MIT) #56 Used by: libsqlite3-sys 0.39.1, rusqlite 0.41.1 @@ -8976,7 +9031,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #56 +### MIT License (MIT) #57 Used by: nom 8.0.0 @@ -9003,7 +9058,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #57 +### MIT License (MIT) #58 Used by: float-cmp 0.9.0 @@ -9029,7 +9084,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #58 +### MIT License (MIT) #59 Used by: wayland-backend 0.3.17, wayland-client 0.31.15, wayland-cursor 0.31.14, wayland-protocols 0.32.13, wayland-protocols-plasma 0.3.12, wayland-protocols-wlr 0.3.12, wayland-scanner 0.31.11, wayland-sys 0.31.11 @@ -9055,7 +9110,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #59 +### MIT License (MIT) #60 Used by: ordered-float 5.5.1 @@ -9087,7 +9142,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #60 +### MIT License (MIT) #61 Used by: dlib 0.5.3 @@ -9113,7 +9168,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #61 +### MIT License (MIT) #62 Used by: memoffset 0.9.1 @@ -9139,7 +9194,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #62 +### MIT License (MIT) #63 Used by: bytes 1.12.1 @@ -9171,7 +9226,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #63 +### MIT License (MIT) #64 Used by: smithay-client-toolkit 0.19.2 @@ -9197,7 +9252,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #64 +### MIT License (MIT) #65 Used by: calloop 0.13.0 @@ -9223,7 +9278,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #65 +### MIT License (MIT) #66 Used by: slab 0.4.12 @@ -9255,7 +9310,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #66 +### MIT License (MIT) #67 Used by: tracing 0.1.44, tracing-attributes 0.1.31, tracing-core 0.1.36 @@ -9287,7 +9342,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #67 +### MIT License (MIT) #68 Used by: pico-args 0.5.0 @@ -9313,7 +9368,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #68 +### MIT License (MIT) #69 Used by: pin-weak 1.1.0 @@ -9339,7 +9394,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #69 +### MIT License (MIT) #70 Used by: clru 0.6.3 @@ -9365,7 +9420,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #70 +### MIT License (MIT) #71 Used by: strict-num 0.1.1 @@ -9391,7 +9446,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #71 +### MIT License (MIT) #72 Used by: calloop-wayland-source 0.3.0 @@ -9417,7 +9472,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #72 +### MIT License (MIT) #73 Used by: wayland-csd-frame 0.3.0 @@ -9443,7 +9498,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #73 +### MIT License (MIT) #74 Used by: zbus 5.19.0, zbus_macros 5.19.0, zbus_names 4.3.5, zbus_xml 5.2.1, zvariant 5.15.1, zvariant_derive 5.15.1 @@ -9475,7 +9530,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #74 +### MIT License (MIT) #75 Used by: zcheapstr 1.2.0 @@ -9507,7 +9562,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #75 +### MIT License (MIT) #76 Used by: winresource 0.1.34 @@ -9539,7 +9594,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #76 +### MIT License (MIT) #77 Used by: synstructure 0.14.0 @@ -9553,7 +9608,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #77 +### MIT License (MIT) #78 Used by: wayland-protocols 0.32.13 @@ -9593,7 +9648,7 @@ The above is the version of the MIT "Expat" License used by X.org: http://cgit.freedesktop.org/xorg/xserver/tree/COPYING ~~~~ -### MIT License (MIT) #78 +### MIT License (MIT) #79 Used by: glutin-winit 0.5.0 @@ -9619,7 +9674,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #79 +### MIT License (MIT) #80 Used by: texpresso 2.0.2 @@ -9648,7 +9703,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #80 +### MIT License (MIT) #81 Used by: tree_magic_mini 3.2.2 @@ -9676,7 +9731,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #81 +### MIT License (MIT) #82 Used by: imagesize 0.15.0 @@ -9704,7 +9759,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #82 +### MIT License (MIT) #83 Used by: alsa-sys 0.4.0 @@ -9732,7 +9787,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #83 +### MIT License (MIT) #84 Used by: rgb 0.8.53 @@ -9760,7 +9815,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #84 +### MIT License (MIT) #85 Used by: strum 0.28.0, strum_macros 0.28.0 @@ -9788,7 +9843,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #85 +### MIT License (MIT) #86 Used by: ashpd 0.11.1 @@ -9816,7 +9871,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #86 +### MIT License (MIT) #87 Used by: cfg_aliases 0.2.2 @@ -9832,7 +9887,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #87 +### MIT License (MIT) #88 Used by: xcursor 0.3.11 @@ -9860,7 +9915,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #88 +### MIT License (MIT) #89 Used by: rfd 0.15.4, sctk-adwaita 0.10.1 @@ -9888,7 +9943,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #89 +### MIT License (MIT) #90 Used by: convert_case 0.10.0 @@ -9916,7 +9971,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #90 +### MIT License (MIT) #91 Used by: dpi 0.1.2, libm 0.2.16, oozextract 0.5.7, rspolib 0.1.2, taffy 0.10.1 @@ -9941,7 +9996,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTI USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #91 +### MIT License (MIT) #92 Used by: tokio 1.54.1 @@ -9969,7 +10024,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #92 +### MIT License (MIT) #93 Used by: simd-adler32 0.3.10 @@ -9997,7 +10052,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #93 +### MIT License (MIT) #94 Used by: wayland-protocols-plasma 0.3.12 @@ -10023,7 +10078,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #94 +### MIT License (MIT) #95 Used by: endi 1.1.1, x11-dl 2.21.0, zbus-lockstep 0.5.2, zbus-lockstep-macros 0.5.2, zmij 1.0.23, zvariant_utils 4.2.0 @@ -10053,7 +10108,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #95 +### MIT License (MIT) #96 Used by: winnow 1.0.5 @@ -10078,7 +10133,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #96 +### MIT License (MIT) #97 Used by: pulldown-cmark 0.13.6 @@ -10106,7 +10161,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #97 +### MIT License (MIT) #98 Used by: tracing-core 0.1.36, zip 9.5.0 @@ -10134,7 +10189,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #98 +### MIT License (MIT) #99 Used by: xml-rs 0.8.29 @@ -10162,7 +10217,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #99 +### MIT License (MIT) #100 Used by: natord 1.0.9 @@ -10190,7 +10245,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #100 +### MIT License (MIT) #101 Used by: phf 0.13.1, phf_generator 0.13.1, phf_macros 0.13.1, phf_shared 0.13.1 @@ -10217,7 +10272,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #101 +### MIT License (MIT) #102 Used by: byteorder 1.5.0, byteorder-lite 0.1.0, memchr 2.8.3, termcolor 1.4.1 @@ -10245,7 +10300,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #102 +### MIT License (MIT) #103 Used by: strsim 0.11.1 @@ -10275,7 +10330,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #103 +### MIT License (MIT) #104 Used by: derive_more 2.1.1, derive_more-impl 2.1.1 @@ -10303,7 +10358,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #104 +### MIT License (MIT) #105 Used by: color_quant 1.1.0 @@ -10331,7 +10386,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #105 +### MIT License (MIT) #106 Used by: winapi-util 0.1.11 @@ -10359,7 +10414,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #106 +### MIT License (MIT) #107 Used by: xmlwriter 0.1.0 @@ -10387,7 +10442,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #107 +### MIT License (MIT) #108 Used by: fontdb 0.24.0 @@ -10415,7 +10470,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #108 +### MIT License (MIT) #109 Used by: xkbcommon-dl 0.4.2 @@ -10443,7 +10498,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #109 +### MIT License (MIT) #110 Used by: harfrust 0.12.0 @@ -10472,7 +10527,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #110 +### MIT License (MIT) #111 Used by: yeslogic-fontconfig-sys 6.0.1 @@ -10503,7 +10558,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #111 +### MIT License (MIT) #112 Used by: os_pipe 1.2.3 @@ -10529,7 +10584,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #112 +### MIT License (MIT) #113 Used by: generic-array 0.14.7 @@ -10557,7 +10612,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #113 +### MIT License (MIT) #114 Used by: quick-xml 0.41.0 @@ -10587,7 +10642,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### MIT License (MIT) #114 +### MIT License (MIT) #115 Used by: urlencoding 2.1.3 @@ -10614,7 +10669,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~ -### Mozilla Public License 2.0 (MPL-2.0) #115 +### Mozilla Public License 2.0 (MPL-2.0) #116 Used by: symphonia 0.6.1, symphonia-bundle-mp3 0.6.1, symphonia-core 0.6.1, symphonia-metadata 0.6.1 @@ -10994,7 +11049,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice defined by the Mozilla Public License, v. 2.0. ~~~~ -### Mozilla Public License 2.0 (MPL-2.0) #116 +### Mozilla Public License 2.0 (MPL-2.0) #117 Used by: option-ext 0.2.0 @@ -11374,7 +11429,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice defined by the Mozilla Public License, v. 2.0. ~~~~ -### Unicode License v3 (Unicode-3.0) #117 +### Unicode License v3 (Unicode-3.0) #118 Used by: unicode-ident 1.0.27 @@ -11420,7 +11475,7 @@ dealings in these Data Files or Software without prior written authorization of the copyright holder. ~~~~ -### Unicode License v3 (Unicode-3.0) #118 +### Unicode License v3 (Unicode-3.0) #119 Used by: fixed_decimal 0.7.3, icu_collections 2.4.0, icu_decimal 2.4.0, icu_decimal_data 2.4.0, icu_locale_core 2.4.0, icu_locale_fallback 2.4.0, icu_locale_fallback_data 2.4.0, icu_normalizer 2.4.0, icu_normalizer_data 2.4.0, icu_properties 2.4.0, icu_properties_data 2.4.0, icu_provider 2.4.0, icu_segmenter 2.4.0, icu_segmenter_data 2.4.0, litemap 0.8.3, potential_utf 0.1.6, tinystr 0.8.5, writeable 0.6.4, yoke 0.8.4, yoke-derive 0.8.4, zerofrom 0.1.8, zerofrom-derive 0.1.8, zerotrie 0.2.5, zerovec 0.11.9, zerovec-derive 0.11.7 @@ -11473,7 +11528,7 @@ Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. ~~~~ -### zlib License (Zlib) #119 +### zlib License (Zlib) #120 Used by: slotmap 1.1.1 @@ -11499,7 +11554,7 @@ the following restrictions: 3. This notice may not be removed or altered from any source distribution. ~~~~ -### zlib License (Zlib) #120 +### zlib License (Zlib) #121 Used by: foldhash 0.1.5, foldhash 0.2.0 diff --git a/crates/openrage-app/Cargo.toml b/crates/openrage-app/Cargo.toml index 3a3572c..c4a724f 100644 --- a/crates/openrage-app/Cargo.toml +++ b/crates/openrage-app/Cargo.toml @@ -24,4 +24,5 @@ png = "0.18" zip.workspace = true [dev-dependencies] +flate2.workspace = true zip = { version = "9", default-features = false, features = ["deflate-flate2"] } diff --git a/crates/openrage-app/src/anim.rs b/crates/openrage-app/src/anim.rs index a737cd6..94f4f54 100644 --- a/crates/openrage-app/src/anim.rs +++ b/crates/openrage-app/src/anim.rs @@ -6,7 +6,7 @@ use rage_formats::math::{self, Mat4}; use crate::expr::Local; -/// Reads a clip dictionary (`.ycd`, GTA V or RDR2; GTA IV `.wad`) or a cutscene's +/// Reads a clip dictionary (`.ycd`, GTA V or RDR2; GTA IV `.wad`; GTA VI `.#cd`) or a cutscene's /// animation (`.cut`, its sections joined), mods included. pub fn load_clips( game_dir: &std::path::Path, @@ -25,6 +25,10 @@ pub fn load_clips( rpf.entries().and_then(|e| e.get(i)).ok_or_else(|| anyhow::anyhow!("archive table not readable"))?; Ok(rage_formats::clip::parse_ycd(&rpf.read_resource(entry)?)?) } + Node::Rpf9File(rpf, i) => { + let (system, graphics) = crate::rpf9::resource(&rpf, i)?; + Ok(rage_formats::clip6::parse(&rage_resource::Resource { version: 0, system, graphics })?) + } _ => anyhow::bail!("{vpath} is not a file inside an archive"), } } @@ -88,7 +92,8 @@ impl Binding { pub fn new(skeleton: &Skeleton, animation: &Animation) -> Self { let mut tracks = vec![[None; 3]; skeleton.bones.len()]; for (i, t) in animation.tracks.iter().enumerate() { - let Some(b) = skeleton.find_tag(t.bone) else { continue }; + let found = if t.bone_hash != 0 { skeleton.find_hash(t.bone_hash) } else { skeleton.find_tag(t.bone) }; + let Some(b) = found else { continue }; let slot = match t.track { TRACK_BONE_TRANSLATION => 0, TRACK_BONE_ROTATION => 1, @@ -224,7 +229,7 @@ mod tests { let animation = Animation::from_frames( 1, 0.0, - vec![BoneTrack { bone: 1, format: 1, track: TRACK_BONE_ROTATION }], + vec![BoneTrack { bone: 1, format: 1, track: TRACK_BONE_ROTATION, ..Default::default() }], vec![vec![[0.0, 0.0, h, h]]], ); let binding = Binding::new(&skeleton, &animation); diff --git a/crates/openrage-app/src/audio.rs b/crates/openrage-app/src/audio.rs index 8870310..a93952e 100644 --- a/crates/openrage-app/src/audio.rs +++ b/crates/openrage-app/src/audio.rs @@ -18,6 +18,7 @@ pub fn load(game_dir: &Path, keys: Option>, vpath: &str) -> Result let data = match node { Node::ArchiveFile(rpf, id) => rpf.read(id)?, Node::PlainFile(p) => std::fs::read(p)?, + Node::Rpf9File(rpf, i) => rpf.read_at(i)?, _ => bail!("{vpath} is not a file"), }; parse(data, keys.as_deref()) diff --git a/crates/openrage-app/src/detect.rs b/crates/openrage-app/src/detect.rs index 5f532e1..a537650 100644 --- a/crates/openrage-app/src/detect.rs +++ b/crates/openrage-app/src/detect.rs @@ -74,12 +74,39 @@ pub fn is_rdr2_dir(dir: &Path) -> bool { dir.join(RDR2_EXE).is_file() } +/// The program in the GTA VI Scarlett build. +pub const GTA6_EXE: &str = "game_scarlett_master.exe"; + +/// Whether a folder holds GTA VI: its Scarlett executable or archives in the +/// RPF9 format. Archives can also be explored without the executable through +/// the recovery view (see [`rage_rpf::rpf9`]). +pub fn is_gta6_dir(dir: &Path) -> bool { + if is_gta5_dir(dir) || is_rdr2_dir(dir) || crate::gta4::is_gta4_dir(dir) { + return false; + } + if dir.join(GTA6_EXE).is_file() || rage_rpf::Rpf9::file_is_rpf9(&dir.join("common.rpf")) { + return true; + } + let Ok(rd) = fs::read_dir(dir) else { return false }; + rd.flatten() + .map(|e| e.path()) + .filter(|p| p.extension().is_some_and(|x| x.eq_ignore_ascii_case("rpf"))) + .any(|p| rage_rpf::Rpf9::file_is_rpf9(&p)) +} + +/// Whether a folder holds a game OpenRAGE can open. +pub fn is_game_dir(dir: &Path) -> bool { + is_gta5_dir(dir) || is_rdr2_dir(dir) || crate::gta4::is_gta4_dir(dir) || is_gta6_dir(dir) +} + /// The icon of the game in `dir`, from its own program: (width, height, RGBA). pub fn game_icon(dir: &Path) -> Option<(u32, u32, Vec)> { let programs: &[&str] = if is_rdr2_dir(dir) { &[RDR2_EXE] } else if crate::gta4::is_gta4_dir(dir) { &["GTAIV.exe"] + } else if is_gta6_dir(dir) { + &[GTA6_EXE] } else { &["GTA5_Enhanced.exe", "GTA5.exe", "PlayGTAV.exe"] }; @@ -87,7 +114,7 @@ pub fn game_icon(dir: &Path) -> Option<(u32, u32, Vec)> { } /// Short name of the game installed in `dir`: "GTA V Enhanced", "GTA V", -/// "GTA IV", "RDR2", or `None` when no known executable is there. +/// "GTA IV", "RDR2", "GTA VI", or `None` when the folder holds no known game. pub fn game_name(dir: &Path) -> Option<&'static str> { if is_rdr2_dir(dir) { Some("RDR2") @@ -97,6 +124,8 @@ pub fn game_name(dir: &Path) -> Option<&'static str> { Some("GTA V") } else if crate::gta4::is_gta4_dir(dir) { Some("GTA IV") + } else if is_gta6_dir(dir) { + Some("GTA VI") } else { None } @@ -130,6 +159,35 @@ pub fn collect_rpfs(dir: &Path, out: &mut Vec) { mod tests { use super::*; + #[test] + fn detects_gta6_from_scarlett_executable_or_rpf9_archives() { + let dir = std::env::temp_dir().join(format!("openrage-detect-gta6-{}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + fs::create_dir_all(&dir).unwrap(); + assert!(!is_game_dir(&dir)); + + // The executable identifies the game even before archives are copied. + fs::write(dir.join(GTA6_EXE), b"MZ").unwrap(); + assert!(is_gta6_dir(&dir)); + assert!(is_game_dir(&dir)); + assert_eq!(game_name(&dir), Some("GTA VI")); + fs::remove_file(dir.join(GTA6_EXE)).unwrap(); + + // Archive-only copies remain supported. A non-RPF9 common.rpf must + // not hide another archive with the RPF9 signature. + fs::write(dir.join("common.rpf"), b"unrelated data").unwrap(); + assert!(!is_gta6_dir(&dir)); + fs::write(dir.join("data.RPF"), b"9FPR").unwrap(); + assert!(is_gta6_dir(&dir)); + assert_eq!(game_name(&dir), Some("GTA VI")); + + // An RPF9 file copied into another game's folder does not switch it. + fs::write(dir.join("GTA5.exe"), b"MZ").unwrap(); + assert!(!is_gta6_dir(&dir)); + assert_eq!(game_name(&dir), Some("GTA V")); + fs::remove_dir_all(&dir).unwrap(); + } + #[test] fn parses_library_folders() { let vdf = r#" diff --git a/crates/openrage-app/src/gta4_cutscene.rs b/crates/openrage-app/src/gta4_cutscene.rs index 7d350bd..0f3b674 100644 --- a/crates/openrage-app/src/gta4_cutscene.rs +++ b/crates/openrage-app/src/gta4_cutscene.rs @@ -1451,7 +1451,7 @@ FX_CS_spit:effect1_0 0 1205 500 500 0 0 0 0 0 0 0\n[/EFFECTS]\n[DURATION]\n2000\ #[test] fn props_move_by_their_root() { use rage_formats::clip::BoneTrack; - let track = |bone, track, format| BoneTrack { bone, format, track }; + let track = |bone, track, format| BoneTrack { bone, format, track, ..Default::default() }; let body = Animation::from_frames( 2, 1.0, diff --git a/crates/openrage-app/src/gta6_models.rs b/crates/openrage-app/src/gta6_models.rs new file mode 100644 index 0000000..7f654a6 --- /dev/null +++ b/crates/openrage-app/src/gta6_models.rs @@ -0,0 +1,322 @@ +//! GTA VI models. +//! +//! A model is stored as its system part and then its graphics part. The +//! archive's table says how long they are. In the recovery view both are cut into zlib streams of 64 KiB. Without the table of contents nothing +//! says where one part ends: the recovery view lists a resource as its first +//! entry (which starts the system part) and what follows it. So the parts +//! are found by trying: every cut between two streams is a possible end of +//! the system part, and the reader says whether the graphics part reaches +//! far enough. + +use std::collections::HashSet; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex}; + +use anyhow::{Context, Result, bail}; +use rage_formats::drawable::{Bone, Drawable, Skeleton}; +use rage_formats::drawable6::{self, ModelError}; +use rage_formats::math; +use rage_rpf::Rpf9; + +/// Streams unpack to this many bytes, the last one of a part to fewer. +const STREAM: usize = 0x10000; +/// A system part is at most this long. +const MAX_SYSTEM: usize = 32 << 20; +/// A resource is at most this long, and spread over at most this many entries. +const MAX_RESOURCE: usize = 256 << 20; +const MAX_ENTRIES: usize = 4096; + +/// Reads the model that starts at entry `index`: its drawables with their names. +pub fn load(rpf: &Rpf9, index: usize) -> Result> { + let entries = rpf.entries()?; + let first = entries.get(index).context("no such entry")?; + let mut data = rpf.read(first)?; + if drawable6::root(&data).is_none() { + bail!("this resource is not a model"); + } + if let Some((system, _)) = rpf.resource_parts(first) { + let (system, graphics) = data.split_at_checked(system as usize).context("the resource is cut off")?; + return Ok(named(drawable6::parse(system, graphics)?)); + } + // Where streams end: the possible ends of the system part. + let mut cuts: Vec = (1..=data.len().div_ceil(STREAM)).map(|i| (i * STREAM).min(data.len())).collect(); + let mut last = index; + loop { + let mut needs_more = false; + let mut failure = None; + for cut in cuts.iter().copied().take_while(|c| *c <= MAX_SYSTEM) { + match drawable6::parse(&data[..cut], &data[cut..]) { + Ok(drawables) => return Ok(named(drawables)), + Err(ModelError::Graphics(_)) => needs_more = true, + Err(e) => failure = failure.or(Some(e)), + } + } + // The graphics part goes on in the next entry. + if !needs_more || !Rpf9::follows(&entries, last) || last - index >= MAX_ENTRIES || data.len() >= MAX_RESOURCE { + match failure { + Some(e) if !needs_more => bail!(e), + _ => bail!("the model's vertex and index data was not found after it"), + } + } + last += 1; + let more = rpf.read(&entries[last])?; + let start = data.len(); + data.extend_from_slice(&more); + cuts.extend((1..=more.len().div_ceil(STREAM)).map(|i| start + (i * STREAM).min(more.len()))); + } +} + +fn named(drawables: Vec) -> Vec<(String, Drawable)> { + drawables + .into_iter() + .enumerate() + .map(|(i, d)| (if d.name.is_empty() { format!("drawable {i}") } else { d.name.clone() }, d)) + .collect() +} + +/// The archive with the skeletons people and animals are put together on. +const BASE_SKELETONS: &str = "packs.rpf/packs/base/models/metaped_fragments.rpf"; + +/// A vertex with less weight than this on known bones moves with the nearest. +const MIN_WEIGHT: f32 = 0.3; + +type Skeletons = Arc>; + +/// The base skeletons of the game with their file names (read once). +fn base_skeletons(game: &Path) -> Skeletons { + static CACHE: Mutex> = Mutex::new(None); + let mut cache = CACHE.lock().unwrap_or_else(|e| e.into_inner()); + if let Some((of, found)) = &*cache + && of == game + { + return Arc::clone(found); + } + let found = Arc::new(rage_rpf::in_own_threads(|| read_base_skeletons(game)).unwrap_or_default()); + *cache = Some((game.to_path_buf(), Arc::clone(&found))); + found +} + +fn read_base_skeletons(game: &Path) -> Result> { + use rayon::prelude::*; + let (node, _) = rage_mods::resolve(game, BASE_SKELETONS, None)?; + let rage_rpf::vfs::Node::Rpf9Dir(rpf, _) = node else { bail!("no archive") }; + let entries = rpf.entries()?; + let mut found: Vec<(String, Skeleton)> = (0..entries.len()) + .into_par_iter() + .filter_map(|i| { + let name = rpf.entry_name(&entries[i]).to_ascii_lowercase(); + let (system, graphics) = crate::rpf9::resource(&rpf, i).ok()?; + let skeleton = drawable6::parse(&system, &graphics).ok()?.into_iter().next()?.skeleton?; + Some((name.rsplit('/').next().unwrap_or(&name).to_owned(), skeleton)) + }) + .collect(); + found.sort_by(|a, b| a.0.cmp(&b.0)); + Ok(found) +} + +/// Binds meshes that name bones of another skeleton (parts of people and +/// animals) to it, and gives that skeleton. `None` if there are none, or the +/// game has no skeleton for them. +pub(crate) fn bind(game: &Path, file: &str, drawables: &mut [(String, Drawable)]) -> Option { + let wanted: HashSet = + drawables.iter().flat_map(|(_, d)| &d.meshes).flat_map(|m| &m.bone_hashes).copied().collect(); + if wanted.is_empty() { + return None; + } + let bases = base_skeletons(game); + let mut skeleton = best_base(&bases, file, &wanted)?.clone(); + bind_to(&mut skeleton, drawables); + Some(skeleton) +} + +/// The skeleton with the most of the bones; of several with as many, the one +/// whose name is most like the file's. `None` if none has any of them, and +/// the file's name does not tell either. +fn best_base<'a>(bases: &'a [(String, Skeleton)], file: &str, wanted: &HashSet) -> Option<&'a Skeleton> { + let file = file.to_ascii_lowercase(); + let words: Vec<&str> = file.split(['_', '.', '+']).collect(); + // `fr1`, `mo1`, …: a woman's or a man's part, of one of the builds. + let sex = words.iter().find_map(|w| match w.as_bytes() { + [b'f', b'a'..=b'z', b'0'..=b'9'] => Some("ambient_femalebody.#ft"), + [b'm', b'a'..=b'z', b'0'..=b'9'] => Some("ambient_malebody.#ft"), + _ => None, + }); + let rated = bases.iter().filter_map(|(name, skeleton)| { + let own: HashSet = skeleton.bones.iter().map(|b| rage_core::hash::joaat(&b.name)).collect(); + let has = wanted.iter().filter(|h| own.contains(h)).count(); + let alike = words.iter().filter(|w| w.len() > 2 && name.contains(**w)).count(); + (has > 0 || sex == Some(name)).then_some(((has, sex == Some(name), alike), skeleton)) + }); + // The first one of the best. + rated.reduce(|best, next| if next.0 > best.0 { next } else { best }).map(|(_, s)| s) +} + +/// Binds the meshes to the skeleton, which gets the bones it lacks from the +/// drawables' own (hair, garments). +fn bind_to(skeleton: &mut Skeleton, drawables: &mut [(String, Drawable)]) { + let places = + |s: &Skeleton| -> Vec<[f32; 3]> { s.world_transforms().iter().map(|m| [m[12], m[13], m[14]]).collect() }; + // The main bones of the body, with their places. + let body: Vec<(usize, [f32; 3])> = places(skeleton) + .into_iter() + .enumerate() + .filter(|(i, _)| skeleton.bones[*i].name.starts_with("SKEL_")) + .collect(); + let nearest = |at: &[f32; 3]| -> Option { + let far = |p: &[f32; 3]| (0..3).map(|k| (p[k] - at[k]).powi(2)).sum::(); + body.iter().min_by(|a, b| far(&a.1).total_cmp(&far(&b.1))).map(|(i, _)| *i) + }; + // Where the bones of each drawable's own skeleton are. + let mut of_own: Vec> = Vec::new(); + for (_, d) in drawables.iter() { + let Some(own) = &d.skeleton else { + of_own.push(Vec::new()); + continue; + }; + let at = places(own); + let mut placed: Vec = Vec::with_capacity(own.bones.len()); + for (i, b) in own.bones.iter().enumerate() { + if let Some(there) = skeleton.find_hash(rage_core::hash::joaat(&b.name)) { + placed.push(there as i16); + continue; + } + let mut bone = b.clone(); + bone.parent = match usize::try_from(b.parent).ok().and_then(|p| placed.get(p)) { + Some(&p) => p, + // Loose: it hangs from the nearest bone of the body. + None => { + let Some(nearest) = nearest(&at[i]) else { + placed.push(0); + continue; + }; + attach(&mut bone, skeleton, nearest); + nearest as i16 + } + }; + placed.push(skeleton.bones.len() as i16); + skeleton.bones.push(bone); + } + of_own.push(placed); + } + for (k, (_, d)) in drawables.iter_mut().enumerate() { + for mesh in &mut d.meshes { + if mesh.bone_hashes.is_empty() { + // Bound to the drawable's own skeleton. + let own = &of_own[k]; + let there = |b: u16| own.get(usize::from(b)).map_or(b, |&b| b as u16); + mesh.bone_indices.iter_mut().flatten().for_each(|b| *b = there(*b)); + continue; + } + let map: Vec> = + mesh.bone_hashes.iter().map(|&h| skeleton.find_hash(h).map(|b| b as u16)).collect(); + mesh.bone_hashes.clear(); + let vertices = mesh.positions.iter().zip(mesh.bone_indices.iter_mut().zip(&mut mesh.bone_weights)); + for (position, (bones, weights)) in vertices { + // Bones of yet another skeleton do not count. + for (b, w) in bones.iter_mut().zip(weights.iter_mut()) { + match map.get(usize::from(*b)).copied().flatten() { + Some(there) => *b = there, + None => (*b, *w) = (0, 0.0), + } + } + let total: f32 = weights.iter().sum(); + if total > MIN_WEIGHT { + weights.iter_mut().for_each(|w| *w /= total); + } else { + *bones = [nearest(position).unwrap_or(0) as u16, 0, 0, 0]; + *weights = [1.0, 0.0, 0.0, 0.0]; + } + } + } + } +} + +/// Moves a bone without a parent under one of the skeleton's, where it stays. +fn attach(bone: &mut Bone, skeleton: &Skeleton, parent: usize) { + let inverse = math::inverse_affine(&skeleton.world_transforms()[parent]); + bone.translation = math::transform_point(&inverse, bone.translation); + let (mut turn, mut at) = ([0.0, 0.0, 0.0, 1.0], Some(parent)); + while let Some(b) = at.and_then(|i| skeleton.bones.get(i)) { + turn = turned(b.rotation, turn); + at = usize::try_from(b.parent).ok(); + } + let back = [-turn[0], -turn[1], -turn[2], turn[3]]; + bone.rotation = turned(back, bone.rotation); +} + +/// The rotation `b`, then `a`. +fn turned(a: [f32; 4], b: [f32; 4]) -> [f32; 4] { + let ([ax, ay, az, aw], [bx, by, bz, bw]) = (a, b); + [ + aw * bx + ax * bw + ay * bz - az * by, + aw * by - ax * bz + ay * bw + az * bx, + aw * bz + ax * by - ay * bx + az * bw, + aw * bw - ax * bx - ay * by - az * bz, + ] +} + +#[cfg(test)] +mod tests { + use super::*; + use rage_core::hash::joaat; + use rage_formats::drawable::Mesh; + + fn bone(name: &str, parent: i16, translation: [f32; 3], rotation: [f32; 4]) -> Bone { + Bone { name: name.into(), tag: 0, parent, translation, rotation, scale: [1.0; 3] } + } + + fn body() -> Skeleton { + let half = std::f32::consts::FRAC_1_SQRT_2; + Skeleton { + bones: vec![ + bone("SKEL_ROOT", -1, [0.0, 0.0, 1.0], [0.0, 0.0, half, half]), + bone("SKEL_Head", 0, [0.0, 0.0, 0.7], [half, 0.0, 0.0, half]), + ], + } + } + + #[test] + fn parts_find_their_bones_by_name() { + let mesh = Mesh { + positions: vec![[0.0; 3], [0.0, 0.0, 1.8]], + bone_indices: vec![[0, 1, 2, 9], [2, 0, 0, 0]], + bone_weights: vec![[0.25, 0.25, 0.5, 0.0], [1.0, 0.0, 0.0, 0.0]], + bone_hashes: vec![joaat("GM_Collar"), joaat("SKEL_ROOT"), joaat("unknown")], + ..Default::default() + }; + let own = Skeleton { bones: vec![bone("GM_Collar", -1, [0.1, 0.2, 1.6], [0.0, 0.0, 0.0, 1.0])] }; + let mut drawables = + vec![("part".into(), Drawable { meshes: vec![mesh], skeleton: Some(own), ..Default::default() })]; + let mut skeleton = body(); + bind_to(&mut skeleton, &mut drawables); + // Unknown bones do not count; what has no others moves with the nearest. + let mesh = &drawables[0].1.meshes[0]; + assert_eq!(mesh.bone_indices, [[2, 0, 0, 0], [1, 0, 0, 0]]); + assert_eq!(mesh.bone_weights, [[0.5, 0.5, 0.0, 0.0], [1.0, 0.0, 0.0, 0.0]]); + // The garment's bone stays where it was. + assert_eq!(skeleton.bones[2].parent, 1); + let world = skeleton.world_transforms()[2]; + let expected = math::from_trs([0.1, 0.2, 1.6], [0.0, 0.0, 0.0, 1.0], [1.0; 3]); + assert!(world.iter().zip(expected).all(|(a, b)| (a - b).abs() < 1e-5), "{world:?}"); + } + + #[test] + fn the_skeleton_is_the_one_with_the_bones() { + let dog = Skeleton { bones: vec![bone("SKEL_Tail", -1, [0.0; 3], [0.0, 0.0, 0.0, 1.0])] }; + let bases = [ + ("ambient_femalebody.#ft".to_owned(), body()), + ("ambient_malebody.#ft".to_owned(), body()), + ("crm_dog_00.#ft".to_owned(), dog), + ]; + let pick = |file: &str, bones: &[&str]| { + let found = best_base(&bases, file, &bones.iter().map(|b| joaat(b)).collect()); + found.and_then(|s| bases.iter().position(|(_, b)| std::ptr::eq(b, s))) + }; + assert_eq!(pick("shirt_mr1_000.#dd", &["SKEL_Head"]), Some(1)); + assert_eq!(pick("shirt_fr1_000.#dd", &["SKEL_Head"]), Some(0)); + assert_eq!(pick("fur.#dd", &["SKEL_Tail"]), Some(2)); + assert_eq!(pick("fur.#dd", &["a", "b", "SKEL_Tail"]), Some(2)); + assert_eq!(pick("fur.#dd", &["a"]), None); + assert_eq!(pick("belt_fr1_000.#dd", &["a"]), Some(0)); + } +} diff --git a/crates/openrage-app/src/gta6_textures.rs b/crates/openrage-app/src/gta6_textures.rs new file mode 100644 index 0000000..926aad5 --- /dev/null +++ b/crates/openrage-app/src/gta6_textures.rs @@ -0,0 +1,170 @@ +//! GTA VI: the textures of models, which are in the texture pools. +//! +//! A model's shader names a texture by a 64-bit key; each texture pool +//! (`.ttpf`, see [`rage_formats::ttpf`]) lists the keys of its textures. So +//! the pools of a game are read once into a catalog of key → pool and number. + +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, OnceLock, Weak}; + +use rage_formats::drawable::Drawable; +use rage_formats::drawable::param::{BUMP_TEX, DIFFUSE_TEX, DIFFUSE_TEX2, LAYER_1_TEX, SPECULAR_TEX}; +use rage_formats::drawable6::texture_name; +use rage_formats::texture::Texture; +use rage_formats::ttpf::Pool; +use rage_formats::ytd::{Layout, TextureDictionary}; + +/// Textures on a model are read at most this many pixels wide and high. +const MAX_SIDE: u32 = 1024; +/// A model gets at most this many textures. +const MAX_TEXTURES: usize = 64; + +/// Where the textures of a game are: per key, the pool and the number in it. +#[derive(Default)] +pub struct Catalog { + pools: Vec<(PathBuf, Pool)>, + by_key: HashMap, +} + +impl Catalog { + /// Reads the tables of all texture pools below `game_dir`. + fn build(game_dir: &Path) -> Catalog { + let mut files = Vec::new(); + crate::detect::collect_archives(game_dir, &["ttpf"], &mut files); + let mut catalog = Catalog::default(); + for file in files { + let Ok(pool) = Pool::open(&file) else { continue }; + for (number, key) in pool.keys().iter().enumerate().filter(|(_, key)| **key != 0) { + // The same texture can be in several pools: the first one that has data wins. + let has_data = pool.descriptor(number).is_some_and(|d| d.base.is_some()); + let known = catalog + .by_key + .get(key) + .is_some_and(|(p, n)| catalog.pools[*p].1.descriptor(*n).is_some_and(|d| d.base.is_some())); + if !known && (has_data || !catalog.by_key.contains_key(key)) { + catalog.by_key.insert(*key, (catalog.pools.len(), number)); + } + } + catalog.pools.push((file, pool)); + } + catalog + } + + pub fn len(&self) -> usize { + self.by_key.len() + } + + pub fn is_empty(&self) -> bool { + self.by_key.is_empty() + } + + /// The texture with this key, with mip levels, the same for all that use + /// it at the time. + pub fn shared(&self, key: u64, side: u32) -> Option> { + type Known = HashMap<(u64, u32), Weak>; + static KNOWN: OnceLock> = OnceLock::new(); + let lock = || KNOWN.get_or_init(Default::default).lock().unwrap_or_else(|e| e.into_inner()); + if let Some(known) = lock().get(&(key, side)).and_then(Weak::upgrade) { + return Some(known); + } + let (pool, number) = *self.by_key.get(&key)?; + let mut texture = self.pools[pool].1.texture_with_mips(number, Some(side)).ok()?; + texture.name = texture_name(key); + let mut known = lock(); + // Another thread may have been quicker. + if let Some(theirs) = known.get(&(key, side)).and_then(Weak::upgrade) { + return Some(theirs); + } + let texture = Arc::new(texture); + if known.len().is_power_of_two() { + known.retain(|_, t| t.strong_count() > 0); + } + known.insert((key, side), Arc::downgrade(&texture)); + Some(texture) + } + + /// The texture with this key, named by the key. + pub fn texture(&self, key: u64) -> Option { + let (pool, number) = *self.by_key.get(&key)?; + let mut texture = self.pools[pool].1.texture(number, Some(MAX_SIDE)).ok()?; + texture.name = texture_name(key); + Some(texture) + } +} + +/// The catalog of a game's texture pools; read on first use and kept. +pub fn catalog(game_dir: &Path) -> Arc { + static CATALOGS: OnceLock>>> = OnceLock::new(); + let mut catalogs = CATALOGS.get_or_init(Default::default).lock().unwrap_or_else(|e| e.into_inner()); + Arc::clone( + catalogs + .entry(game_dir.to_path_buf()) + .or_insert_with(|| Arc::new(rage_rpf::in_own_threads(|| Catalog::build(game_dir)))), + ) +} + +/// The names of the textures of shaders, of these kinds. +fn names<'a>(drawables: &'a [(String, Drawable)], wanted: &[u32]) -> Vec<&'a str> { + let mut names: Vec<&str> = drawables + .iter() + .flat_map(|(_, d)| &d.shaders) + .flat_map(|s| &s.samplers) + .filter(|(parameter, _)| wanted.contains(parameter)) + .map(|(_, name)| name.as_str()) + .collect(); + names.sort_unstable(); + names.dedup(); + names.truncate(MAX_TEXTURES); + names +} + +/// The textures of drawables, shared with other models: their colours, with +/// `all` normal and specular maps too. +pub fn shared_for(game_dir: &Path, drawables: &[(String, Drawable)], side: u32, all: bool) -> Vec> { + let wanted: &[u32] = if all { + &[DIFFUSE_TEX, DIFFUSE_TEX2, LAYER_1_TEX, BUMP_TEX, SPECULAR_TEX] + } else if side > 256 { + &[DIFFUSE_TEX, DIFFUSE_TEX2, LAYER_1_TEX] + } else { + &[DIFFUSE_TEX] + }; + let names = names(drawables, wanted); + if names.is_empty() { + return Vec::new(); + } + let catalog = catalog(game_dir); + let found = names.iter().filter_map(|n| catalog.shared(u64::from_str_radix(n, 16).ok()?, side)); + // Not the white stand-ins for a colour the game computes. + let stands_in = |t: &Texture| { + t.width <= 8 + && t.to_rgba().is_some_and(|rgba| rgba.as_chunks::<4>().0.iter().all(|p| p[..3].iter().all(|c| *c > 225))) + }; + found.filter(|t| !stands_in(t)).collect() +} + +/// The textures the shaders of these drawables name, from the pools of the +/// game: a dictionary of them, `None` if none was found. +pub fn for_drawables(game_dir: &Path, drawables: &[(String, Drawable)]) -> Option { + let names = names(drawables, &[DIFFUSE_TEX, DIFFUSE_TEX2, LAYER_1_TEX, BUMP_TEX, SPECULAR_TEX]); + if names.is_empty() { + return None; + } + let catalog = catalog(game_dir); + let total = names.len(); + let mut textures = Vec::new(); + for (i, name) in names.into_iter().enumerate() { + crate::progress::set("Loading textures", i as u64, total as u64); + if let Some(texture) = u64::from_str_radix(name, 16).ok().and_then(|key| catalog.texture(key)) { + textures.push(texture); + } + } + (!textures.is_empty()).then(|| TextureDictionary { + textures, + errors: Vec::new(), + layout: Layout::Enhanced, + version: 0, + root: Vec::new(), + stored: Vec::new(), + }) +} diff --git a/crates/openrage-app/src/gta6_world.rs b/crates/openrage-app/src/gta6_world.rs new file mode 100644 index 0000000..2f31b18 --- /dev/null +++ b/crates/openrage-app/src/gta6_world.rs @@ -0,0 +1,913 @@ +//! The map of GTA VI: where its map files (`.#map`) are, what they place, and +//! the models for it. +//! +//! A map file covers a small piece of the world, and there are more than +//! 160,000, so reading all of them takes a minute or two. What is needed of +//! them is kept (`/openrage/gta6-world-.bin`) until the search +//! index changes. + +use std::collections::{BTreeMap, HashMap, HashSet}; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::{Arc, Mutex}; + +use anyhow::{Context, Result}; +use rage_core::bytes::LeRead; +use rage_core::hash::joaat; +use rage_formats::drawable::Drawable; +use rage_formats::math::{self, Mat4}; +use rage_rpf::Rpf9; +use rage_rpf::vfs::Node as Node9; +use rayon::prelude::*; + +use crate::models::LoadedModel; +use crate::world::MapScene; + +const MAGIC: &[u8; 8] = b"ORG6MAP2"; + +/// Levels of detail: the models seen close, and the ones that stand for whole +/// neighbourhoods from afar. +const CLOSE: [u8; 2] = [0, 5]; +const FAR: u8 = 3; +/// The levels between, up to the far one. +const LEVELS: std::ops::RangeInclusive = 1..=FAR; +/// How well textures are read in views of many models. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Quality { + /// Seen from kilometres away. + Far, + Near, + /// From up close: normal and specular maps too. + Close, +} + +impl Quality { + fn side(self) -> u32 { + match self { + Self::Far => 256, + Self::Near => 512, + Self::Close => 1024, + } + } +} + +/// Something a map file places. +#[derive(Debug, Clone, PartialEq)] +struct Object { + /// Hash of the model's name. + model: u32, + position: [f32; 3], + rotation: [f32; 4], + scale: [f32; 2], +} + +impl Object { + fn transform(&self) -> Mat4 { + let [x, y, z, w] = self.rotation; + let [flat, high] = self.scale; + math::from_trs(self.position, [-x, -y, -z, w], [flat, flat, high]) + } +} + +/// An object that stands for others from afar: for those whose parent it is. +#[derive(Debug, Clone, PartialEq)] +struct Node { + /// The map file (the hash of its name) and the place in it. + key: (u32, u32), + parent: Option<(u32, u32)>, + level: u8, + /// Nearer than this, the others are shown. + reach: f32, + object: Object, +} + +/// What is kept of the map files. +#[derive(Debug, Default, PartialEq)] +pub struct Map { + /// Map files with the box around what they place. + files: Vec<(String, [f32; 3], [f32; 3])>, + /// The objects that stand for others from afar. + nodes: Vec, + /// Models in dictionaries, by the hash of their name: the dictionary and + /// the place in it. + children: HashMap, +} + +/// Files of the index, by the archive they are in. +fn by_archive(list: Vec<(String, String)>, keep: impl Fn(&str) -> bool) -> BTreeMap> { + let mut found: BTreeMap> = BTreeMap::new(); + for (_, vpath) in list.into_iter().filter(|(_, v)| keep(v)) { + if let Some((archive, file)) = vpath.rsplit_once(".rpf/") { + found.entry(format!("{archive}.rpf")).or_default().push(file.to_owned()); + } + } + found +} + +fn each_file( + game: &Path, + archives: &BTreeMap>, + work: impl Fn(&Rpf9, usize, String) + Sync, + done: &(dyn Fn() + Sync), +) { + archives.par_iter().for_each(|(archive, files)| { + let Ok((Node9::Rpf9Dir(rpf, _), _)) = rage_mods::resolve(game, archive, None) else { return }; + let Ok(entries) = rpf.entries() else { return }; + files.par_iter().for_each(|file| { + if let Some(i) = rpf.find(&entries, file) { + work(&rpf, i, format!("{archive}/{file}")); + } + done(); + }); + }); +} + +/// The part of the text between two others. +fn between<'a>(line: &'a str, start: &str, end: &str) -> Option<&'a str> { + line.strip_prefix(start)?.split(end).next() +} + +fn attributes(line: &str, names: [&str; N]) -> Option<[f32; N]> { + let mut out = [0.0; N]; + for (out, name) in out.iter_mut().zip(names) { + let at = line.find(&format!(" {name}=\""))? + name.len() + 3; + *out = line[at..].split('"').next()?.parse().ok()?; + } + Some(out) +} + +/// The hash a name in the XML stands for. +fn name_hash(name: &str) -> u32 { + let hash = name.strip_prefix("hash_").filter(|h| h.len() == 8).and_then(|h| u32::from_str_radix(h, 16).ok()); + hash.unwrap_or_else(|| joaat(name)) +} + +/// What a map file holds. +#[derive(Default)] +struct Placements { + /// Hash of the file's name. + name: u32, + /// The box around what it places. + extent: Option<[[f32; 3]; 2]>, + /// In the order of the file. + entries: Vec, +} + +/// A placed object with its place among the levels of detail. +struct Entry { + level: u8, + parent: Option<(u32, u32)>, + reach: f32, + object: Object, +} + +impl Placements { + fn has_close(&self) -> bool { + self.entries.iter().any(|e| CLOSE.contains(&e.level)) + } + + fn close(self) -> impl Iterator { + self.entries.into_iter().filter(|e| CLOSE.contains(&e.level)).map(|e| e.object) + } +} + +/// What a map file places. The XML is read by lines: there is a lot of it, +/// and it is our own. +fn read_map(xml: &str) -> Placements { + let mut map = Placements::default(); + let (mut lo, mut hi) = (None, None); + let mut now = Object { model: 0, position: [0.0; 3], rotation: [0.0, 0.0, 0.0, 1.0], scale: [1.0; 2] }; + // The files with the objects that stand for this one's. + let mut parents: Vec = Vec::new(); + let (mut in_parents, mut in_entities, mut in_extensions) = (false, false, false); + let (mut reach, mut parent_index) = (0.0, -1.0); + let value = |line: &str| attributes(line, ["value"]).map(|[v]| v); + for line in xml.lines().map(str::trim) { + if in_extensions { + in_extensions = line != ""; + } else if in_entities { + if line == "" || line.starts_with("") { + in_extensions = true; + } else if line == "" { + in_entities = false; + } else if let Some(name) = between(line, "", "<") { + now.model = name_hash(name); + } else if line.starts_with("= 0.0 + && file >= 0.0 + { + entry.parent = parents.get(file as usize).map(|file| (*file, parent_index as u32)); + } + } else if line.starts_with("") || line.starts_with(""); + } else if line == "" { + in_parents = true; + } else if line == "" { + in_parents = false; + } else if let Some(name) = between(line, "", "<").filter(|_| in_parents) { + parents.push(name_hash(name)); + } else if let Some(name) = between(line, "", "<").filter(|_| map.name == 0) { + map.name = name_hash(name); + } else if line.starts_with(" Vec { + let list = system.u64_at(32).and_then(|p| usize::try_from(p.checked_sub(0x5000_0000)?).ok()); + let count = system.u16_at(40).unwrap_or(0); + let Some(list) = list else { return Vec::new() }; + (0..usize::from(count)).map_while(|i| system.u32_at(list.checked_add(i * 4)?)).collect() +} + +fn build(game: &Path, index: &rage_index::Index, progress: &(dyn Fn(usize, usize) + Sync)) -> Result { + let maps = by_archive(index.files_with_extensions(&[".#map"])?, |_| true); + let dictionaries = by_archive(index.files_with_extensions(&[".#dd"])?, |v| v.contains("/map/")); + let total = maps.values().chain(dictionaries.values()).map(Vec::len).sum(); + let count = AtomicUsize::new(0); + let done = || { + let n = count.fetch_add(1, Ordering::Relaxed) + 1; + if n.is_multiple_of(500) { + progress(n, total); + } + }; + let map = Mutex::new(Map::default()); + let lock = || map.lock().unwrap_or_else(|e| e.into_inner()); + each_file( + game, + &maps, + |rpf, i, vpath| { + let Ok(xml) = crate::metadata::from_rpf9(rpf, i) else { return }; + let placements = read_map(&xml.text); + let mut map = lock(); + if let Some([lo, hi]) = placements.extent.filter(|_| placements.has_close()) { + map.files.push((vpath, lo, hi)); + } + let name = placements.name; + let nodes = placements.entries.into_iter().enumerate().filter(|(_, e)| LEVELS.contains(&e.level)); + map.nodes.extend(nodes.map(|(k, e)| Node { + key: (name, k as u32), + parent: e.parent, + level: e.level, + reach: e.reach, + object: e.object, + })); + }, + &done, + ); + each_file( + game, + &dictionaries, + |rpf, i, vpath| { + let Ok(entries) = rpf.entries() else { return }; + let Some((system, _)) = rpf.resource_parts(&entries[i]) else { return }; + let Ok(start) = rpf.read_start(&entries[i], system as usize) else { return }; + let names = dictionary(&start); + let mut map = lock(); + for (k, name) in names.into_iter().enumerate() { + map.children.entry(name).or_insert_with(|| (vpath.clone(), k as u16)); + } + }, + &done, + ); + let mut map = map.into_inner().unwrap_or_else(|e| e.into_inner()); + map.files.sort_by(|a, b| a.0.cmp(&b.0)); + map.nodes.sort_by_key(|n| n.key); + Ok(map) +} + +fn cache_path(game: &Path) -> Option { + crate::paths::game_cache(game, "gta6-world", "bin") +} + +fn encode(map: &Map, stamp: i64) -> Vec { + let mut out = Vec::from(MAGIC); + out.extend(stamp.to_le_bytes()); + let text = |out: &mut Vec, s: &str| { + out.extend((s.len() as u32).to_le_bytes()); + out.extend(s.as_bytes()); + }; + let floats = |out: &mut Vec, v: &[f32]| v.iter().for_each(|f| out.extend(f.to_le_bytes())); + out.extend((map.files.len() as u32).to_le_bytes()); + for (path, lo, hi) in &map.files { + text(&mut out, path); + floats(&mut out, lo); + floats(&mut out, hi); + } + out.extend((map.nodes.len() as u32).to_le_bytes()); + for n in &map.nodes { + let parent = n.parent.unwrap_or((u32::MAX, u32::MAX)); + for v in [n.key.0, n.key.1, parent.0, parent.1, u32::from(n.level), n.object.model] { + out.extend(v.to_le_bytes()); + } + floats(&mut out, &[n.reach]); + floats(&mut out, &n.object.position); + floats(&mut out, &n.object.rotation); + floats(&mut out, &n.object.scale); + } + // Dictionaries once, then their models. + let mut by_path: BTreeMap<&str, Vec<(u32, u16)>> = BTreeMap::new(); + for (name, (path, k)) in &map.children { + by_path.entry(path).or_default().push((*name, *k)); + } + out.extend((by_path.len() as u32).to_le_bytes()); + for (path, models) in by_path { + text(&mut out, path); + out.extend((models.len() as u32).to_le_bytes()); + for (name, k) in models { + out.extend(name.to_le_bytes()); + out.extend(u32::from(k).to_le_bytes()); + } + } + out +} + +fn decode(data: &[u8], stamp: i64) -> Option { + let rest = data.strip_prefix(MAGIC)?.strip_prefix(&stamp.to_le_bytes())?; + fn floats(number: &mut impl FnMut() -> Option) -> Option<[f32; N]> { + let mut out = [0.0; N]; + for f in &mut out { + *f = f32::from_bits(number()?); + } + Some(out) + } + let mut reader = Reader { data: rest, at: 0 }; + let mut map = Map::default(); + for _ in 0..reader.number()? { + let path = reader.text()?; + let (lo, hi) = (floats(&mut || reader.number())?, floats(&mut || reader.number())?); + map.files.push((path, lo, hi)); + } + for _ in 0..reader.number()? { + let mut next = || reader.number(); + let (key, parent) = ((next()?, next()?), (next()?, next()?)); + let (level, model) = (next()? as u8, next()?); + let [reach] = floats(&mut next)?; + let object = + Object { model, position: floats(&mut next)?, rotation: floats(&mut next)?, scale: floats(&mut next)? }; + map.nodes.push(Node { key, parent: (parent.0 != u32::MAX).then_some(parent), level, reach, object }); + } + for _ in 0..reader.number()? { + let path = reader.text()?; + for _ in 0..reader.number()? { + let (name, k) = (reader.number()?, reader.number()?); + map.children.insert(name, (path.clone(), k as u16)); + } + } + Some(map) +} + +struct Reader<'a> { + data: &'a [u8], + at: usize, +} + +impl Reader<'_> { + fn number(&mut self) -> Option { + let v = self.data.u32_at(self.at)?; + self.at += 4; + Some(v) + } + + fn text(&mut self) -> Option { + let len = self.number()? as usize; + let bytes = self.data.get(self.at..self.at.checked_add(len)?)?; + self.at += len; + String::from_utf8(bytes.to_vec()).ok() + } +} + +/// The game's map: kept, or read from its map files. `progress` gets the files +/// read and their number. +pub fn load(game: &Path, progress: &(dyn Fn(usize, usize) + Sync)) -> Result> { + static LOADED: Mutex)>> = Mutex::new(None); + let index = open_index(game)?; + let stamp = index.changed_at()?.unwrap_or(0); + let mut loaded = LOADED.lock().unwrap_or_else(|e| e.into_inner()); + if let Some((of, at, map)) = &*loaded + && of == game + && *at == stamp + { + return Ok(Arc::clone(map)); + } + let path = cache_path(game).context("no cache directory")?; + let map = match std::fs::read(&path).ok().and_then(|data| decode(&data, stamp)) { + Some(map) => map, + None => { + let map = rage_rpf::in_own_threads(|| build(game, &index_of(game)?, progress))?; + let partial = path.with_extension("bin.part"); + // The cache only saves time. + let _ = std::fs::write(&partial, encode(&map, stamp)).and_then(|()| std::fs::rename(&partial, &path)); + map + } + }; + let map = Arc::new(map); + *loaded = Some((game.to_path_buf(), stamp, Arc::clone(&map))); + Ok(map) +} + +fn index_of(game: &Path) -> Result { + let path = crate::index_path(game).filter(|p| p.exists()).context("the search index is not built yet")?; + Ok(rage_index::Index::open(&path)?) +} + +fn open_index(game: &Path) -> Result { + let index = index_of(game)?; + anyhow::ensure!(index.is_complete()?, "the search index is still being built"); + Ok(index) +} + +/// Where a model is. +#[derive(Debug, Clone)] +enum Source { + File(String), + Child(String, u16), +} + +/// The files of models, by the hash of their name. +fn model_files(game: &Path) -> Result> { + let list = open_index(game)?.files_with_extensions(&[".#dr", ".#ft"])?; + let mut found = HashMap::with_capacity(list.len()); + for (name, vpath) in list { + if let Some((stem, _)) = name.rsplit_once('.') { + found.entry(joaat(stem)).or_insert(vpath); + } + } + Ok(found) +} + +/// A loaded model: the hash of its name, its name, and itself. +pub type Loaded = (u32, String, LoadedModel); + +/// Where the game's models are. +struct Models<'a> { + game: &'a Path, + files: &'a HashMap, + map: &'a Map, +} + +impl Models<'_> { + fn source(&self, model: u32) -> Option { + let file = self.files.get(&model).map(|file| Source::File(file.clone())); + file.or_else(|| self.map.children.get(&model).map(|(file, k)| Source::Child(file.clone(), *k))) + } + + /// Loads models; those that cannot be read are left out. + fn load(&self, wanted: &[u32], quality: Quality, progress: &(dyn Fn(usize, usize) + Sync)) -> Vec { + // Archives are opened once: that takes longer than reading a model. + let mut archives: BTreeMap> = BTreeMap::new(); + for &model in wanted { + let Some(source) = self.source(model) else { continue }; + let (Source::File(vpath) | Source::Child(vpath, _)) = &source; + if let Some((archive, file)) = vpath.rsplit_once(".rpf/") { + archives.entry(format!("{archive}.rpf")).or_default().push((file.to_owned(), model, source)); + } + } + let total = archives.values().map(Vec::len).sum(); + let count = &AtomicUsize::new(0); + progress(0, total); + archives + .into_par_iter() + .flat_map(|(archive, files)| { + let opened = match rage_mods::resolve(self.game, &archive, None) { + Ok((Node9::Rpf9Dir(rpf, _), _)) => rpf.entries().ok().map(|entries| (rpf, entries)), + _ => None, + }; + files.into_par_iter().filter_map(move |(file, model, source)| { + let loaded = opened.as_ref().and_then(|(rpf, entries)| { + let i = rpf.find(entries, &file)?; + crate::progress::quietly(|| load_model(self.game, rpf, i, &source, quality)).ok() + }); + progress(count.fetch_add(1, Ordering::Relaxed) + 1, total); + loaded.map(|(name, loaded)| (model, name, loaded)) + }) + }) + .collect() + } +} + +/// Puts objects together: every model once, with all its places. +fn scene( + game: &Path, + map: &Map, + objects: &[Object], + quality: Quality, + progress: &(dyn Fn(usize, usize) + Sync), +) -> Result { + let files = model_files(game)?; + let models = Models { game, files: &files, map }; + let mut places: HashMap> = HashMap::new(); + for o in objects { + places.entry(o.model).or_default().push(o.transform()); + } + let (wanted, unknown): (Vec, Vec) = places.keys().partition(|m| models.source(**m).is_some()); + let mut missing: Vec<(String, usize)> = + unknown.into_iter().map(|m| (rage_formats::names::value(m), places[&m].len())).collect(); + missing.sort_by(|a, b| b.1.cmp(&a.1).then(a.0.cmp(&b.0))); + let loaded = models.load(&wanted, quality, progress); + let models = loaded + .into_iter() + .map(|(model, name, loaded)| (name, loaded, places.remove(&model).unwrap_or_default())) + .collect(); + Ok(MapScene { models, objects: objects.len(), missing }) +} + +fn load_model(game: &Path, rpf: &Rpf9, i: usize, source: &Source, quality: Quality) -> Result<(String, LoadedModel)> { + let (Source::File(vpath) | Source::Child(vpath, _)) = source; + let mut drawables: Vec<(String, Drawable)> = crate::gta6_models::load(rpf, i)?; + if let Source::Child(_, k) = source { + let k = usize::from(*k); + anyhow::ensure!(k < drawables.len(), "no such model in the dictionary"); + drawables = vec![drawables.swap_remove(k)]; + } + let name = match source { + Source::File(_) => vpath.rsplit('/').next().unwrap_or(vpath).to_owned(), + Source::Child(..) => drawables[0].0.clone(), + }; + let textures = crate::gta6_textures::shared_for(game, &drawables, quality.side(), quality == Quality::Close); + let mut model = LoadedModel::from_drawables(drawables); + model.set_shared(textures); + Ok((name.trim_end_matches(".#dr").trim_end_matches(".#ft").to_owned(), model)) +} + +/// The whole map, as it looks from afar. +pub fn overview(game: &Path, progress: &Progress) -> Result { + let map = load(game, &|done, total| progress("Reading the game's map files", done, total))?; + let far: Vec = map.nodes.iter().filter(|n| n.level == FAR).map(|n| n.object.clone()).collect(); + anyhow::ensure!(!far.is_empty(), "the map files of this game have no distant view"); + scene(game, &map, &far, Quality::Far, &|done, total| progress("Loading the map's models", done, total)) +} + +/// Gets what is being done, how much of it is done, and how much there is. +pub type Progress<'a> = dyn Fn(&str, usize, usize) + Sync + 'a; + +/// How far around a map file's objects its surroundings are shown (metres). +pub const AROUND: f32 = 120.0; + +/// A map file, with what the others place around it. +pub fn place(game: &Path, vpath: &str, around: f32, progress: &Progress) -> Result { + let own = read_map(&crate::metadata::load(game, None, vpath)?.text); + let map = load(game, &|done, total| progress("Reading the game's map files", done, total))?; + let (extent, has_close) = (own.extent, own.has_close()); + let mut objects: Vec = + if has_close { own.close().collect() } else { own.entries.into_iter().map(|e| e.object).collect() }; + if let Some([lo, hi]) = extent.filter(|_| has_close) { + let middle = [(lo[0] + hi[0]) / 2.0, (lo[1] + hi[1]) / 2.0]; + let near = |p: &[f32; 3]| (0..2).all(|k| (p[k] - middle[k]).abs() <= around); + let others = map.files.iter().filter(|(path, lo, hi)| { + path != vpath && (0..2).all(|k| lo[k] <= middle[k] + around && hi[k] >= middle[k] - around) + }); + let others = by_archive(others.map(|(path, ..)| (String::new(), path.clone())).collect(), |_| true); + let found = Mutex::new(Vec::new()); + each_file( + game, + &others, + |rpf, i, _| { + let Ok(xml) = crate::metadata::from_rpf9(rpf, i) else { return }; + let near = read_map(&xml.text).close().filter(|o| near(&o.position)); + found.lock().unwrap_or_else(|e| e.into_inner()).extend(near); + }, + &|| {}, + ); + objects.extend(found.into_inner().unwrap_or_else(|e| e.into_inner())); + } + scene(game, &map, &objects, Quality::Near, &|done, total| progress("Loading the map's models", done, total)) +} + +/// How near the camera a map file has to be for its close objects (metres). +const NEAR: f32 = 200.0; +/// How near objects have to be that stand for others but have none above them. +const ALONE: [f32; 4] = [0.0, 800.0, 4000.0, f32::MAX]; + +/// The whole map in the detail that fits where the camera is. +pub struct Lod { + game: PathBuf, + map: Arc, + files: HashMap, + /// Nodes by their key. + by_key: HashMap<(u32, u32), u32>, + /// What each node stands for, among the nodes. + children: Vec>, + roots: Vec, +} + +/// The close objects of a map file, with the node they are part of. +#[derive(Default)] +pub struct Close { + objects: Vec<(Option, Object)>, +} + +/// What to draw: models with their places, and what is missing for more +/// detail, the most wanted first. +#[derive(Default)] +pub struct Cut { + pub draw: HashMap>, + pub wanted: Vec, +} + +fn distance(a: &[f32; 3], b: &[f32; 3]) -> f32 { + (0..3).map(|k| (a[k] - b[k]).powi(2)).sum::().sqrt() +} + +/// How far a point is from a box. +fn distance_to_box(p: &[f32; 3], lo: &[f32; 3], hi: &[f32; 3]) -> f32 { + distance(p, &std::array::from_fn(|k| p[k].clamp(lo[k], hi[k].max(lo[k])))) +} + +impl Lod { + pub fn open(game: &Path, progress: &Progress) -> Result { + let map = load(game, &|done, total| progress("Reading the game's map files", done, total))?; + Ok(Self::new(game, map, model_files(game)?)) + } + + fn new(game: &Path, map: Arc, files: HashMap) -> Self { + let by_key: HashMap<(u32, u32), u32> = map.nodes.iter().enumerate().map(|(i, n)| (n.key, i as u32)).collect(); + let mut children = vec![Vec::new(); map.nodes.len()]; + let mut roots = Vec::new(); + for (i, node) in map.nodes.iter().enumerate() { + // Only of a higher level, so there are no circles. + let parent = node.parent.and_then(|key| by_key.get(&key).copied()); + match parent.filter(|p| map.nodes[*p as usize].level > node.level) { + Some(p) => children[p as usize].push(i as u32), + None => roots.push(i as u32), + } + } + Self { game: game.to_owned(), map, files, by_key, children, roots } + } + + /// The models of the farthest level. + pub fn far(&self) -> Vec { + let far = self.map.nodes.iter().filter(|n| n.level == FAR).map(|n| n.object.model); + far.collect::>().into_iter().collect() + } + + /// Whether the game has this model. + pub fn has_model(&self, model: u32) -> bool { + self.files.contains_key(&model) || self.map.children.contains_key(&model) + } + + /// Loads models. + pub fn load(&self, models: &[u32], quality: Quality, progress: &(dyn Fn(usize, usize) + Sync)) -> Vec { + let of = Models { game: &self.game, files: &self.files, map: &self.map }; + of.load(models, quality, progress) + } + + /// The map files with close objects near a place. + pub fn near(&self, eye: &[f32; 3], range: f32) -> HashSet { + let near = |(_, lo, hi): &&(String, [f32; 3], [f32; 3])| distance_to_box(eye, lo, hi) < NEAR * range; + (0..).zip(&self.map.files).filter(|(_, f)| near(f)).map(|(i, _)| i).collect() + } + + /// Reads the close objects of map files. + pub fn read(&self, files: &[u32]) -> Vec<(u32, Close)> { + let number: HashMap<&str, u32> = files.iter().map(|i| (self.map.files[*i as usize].0.as_str(), *i)).collect(); + let by_archive = by_archive(number.keys().map(|p| (String::new(), (*p).to_owned())).collect(), |_| true); + let found = Mutex::new(Vec::new()); + each_file( + &self.game, + &by_archive, + |rpf, i, vpath| { + let Some(&number) = number.get(vpath.as_str()) else { return }; + let entries = crate::metadata::from_rpf9(rpf, i).map(|x| read_map(&x.text).entries).unwrap_or_default(); + let close = entries.into_iter().filter(|e| CLOSE.contains(&e.level)); + let node = |e: &Entry| e.parent.and_then(|key| self.by_key.get(&key).copied()); + let objects = close.map(|e| (node(&e), e.object)).collect(); + found.lock().unwrap_or_else(|e| e.into_inner()).push((number, Close { objects })); + }, + &|| {}, + ); + found.into_inner().unwrap_or_else(|e| e.into_inner()) + } + + /// What to draw from a place, `range` times as far in detail as the game + /// does, of the models there are, with the close + /// objects read so far. An object gives way to those it stands for when + /// all of them are there. + pub fn cut<'a>( + &self, + eye: &[f32; 3], + range: f32, + loaded: &dyn Fn(u32) -> bool, + unreadable: &dyn Fn(u32) -> bool, + close: impl Iterator, + ) -> Cut { + let mut of_node: HashMap> = HashMap::new(); + let mut cut = Choice { + lod: self, + eye, + range, + loaded, + unreadable, + close: HashMap::new(), + draw: Vec::new(), + wanted: HashMap::new(), + }; + for (node, object) in close.flat_map(|c| &c.objects) { + match node { + Some(node) => of_node.entry(*node).or_default().push(object), + None if distance(eye, &object.position) < NEAR * range && cut.take(object) => cut.draw.push(object), + None => {} + } + } + cut.close = of_node; + for &root in &self.roots { + let node = &self.map.nodes[root as usize]; + if distance(eye, &node.object.position) < ALONE[usize::from(node.level.min(FAR))] { + cut.visit(root); + } + } + let mut wanted: Vec<(u32, f32)> = cut.wanted.into_iter().collect(); + wanted.sort_by(|a, b| a.1.total_cmp(&b.1)); + let mut draw: HashMap> = HashMap::new(); + for object in cut.draw { + draw.entry(object.model).or_default().push(object.transform()); + } + Cut { draw, wanted: wanted.into_iter().map(|(m, _)| m).collect() } + } +} + +/// A cut in the making. +struct Choice<'a> { + lod: &'a Lod, + eye: &'a [f32; 3], + range: f32, + loaded: &'a dyn Fn(u32) -> bool, + unreadable: &'a dyn Fn(u32) -> bool, + close: HashMap>, + draw: Vec<&'a Object>, + /// Models to load, with how near they are. + wanted: HashMap, +} + +impl<'a> Choice<'a> { + fn expects(&self, model: u32) -> bool { + self.lod.has_model(model) && !(self.unreadable)(model) + } + + /// Whether an object's model is loaded; otherwise it is wanted. One the + /// game does not have does not count. + fn take(&mut self, object: &Object) -> bool { + if (self.loaded)(object.model) { + return true; + } + if self.expects(object.model) { + let far = distance(self.eye, &object.position); + let known = self.wanted.entry(object.model).or_insert(far); + *known = known.min(far); + } + false + } + + /// Draws a node or what it stands for; gives whether something stands + /// where it is. + fn visit(&mut self, node: u32) -> bool { + let lod = self.lod; + let (n, children) = (&lod.map.nodes[node as usize], &lod.children[node as usize]); + if distance(self.eye, &n.object.position) < n.reach * self.range { + let before = self.draw.len(); + let mut all = true; + let mut any = false; + for child in children { + any = true; + all &= self.visit(*child); + } + for object in self.close.remove(&node).unwrap_or_default() { + any = true; + if self.take(object) { + self.draw.push(object); + } else { + all &= !self.expects(object.model); + } + } + if any && all { + return true; + } + self.draw.truncate(before); + } + if self.take(&n.object) { + self.draw.push(&n.object); + return true; + } + !self.expects(n.object.model) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + const XML: &str = r#" + hash_00000077 + + hash_00000099 + + + + + + + + Prop_A + + + + + + + + + + + + + hash_0000ABCD + + + + + + + + +"#; + + #[test] + fn map_files_are_read() { + let map = read_map(XML); + assert_eq!((map.name, map.extent), (0x77, Some([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]))); + let [a, b] = &map.entries[..] else { panic!("two entries") }; + assert_eq!((a.level, a.object.model, a.parent), (5, joaat("prop_a"), None)); + assert_eq!(a.object.scale, [2.0, 3.0]); + assert_eq!(a.object.transform()[12..15], [10.0, 20.0, 30.0]); + assert_eq!((b.level, b.object.model, b.parent, b.reach), (2, 0xABCD, Some((0x99, 4)), 60.0)); + } + + fn node(key: (u32, u32), parent: Option<(u32, u32)>, level: u8, model: u32) -> Node { + let object = Object { model, position: [0.0; 3], rotation: [0.0, 0.0, 0.0, 1.0], scale: [1.0; 2] }; + Node { key, parent, level, reach: 100.0, object } + } + + #[test] + fn the_cache_reads_back() { + let map = Map { + files: vec![("a.rpf/b.#map".into(), [1.0; 3], [2.0; 3])], + nodes: vec![node((1, 0), None, 3, 7), node((2, 0), Some((1, 0)), 2, 8)], + children: HashMap::from([(7, ("c.rpf/d.#dd".to_owned(), 3))]), + }; + let data = encode(&map, 5); + assert_eq!(decode(&data, 5).unwrap(), map); + assert!(decode(&data, 6).is_none()); + for n in 0..data.len() { + assert!(decode(&data[..n], 5).is_none()); + } + } + + #[test] + fn detail_follows_the_camera() { + let map = Map { + files: Vec::new(), + nodes: vec![ + node((1, 0), None, 3, 10), + node((2, 0), Some((1, 0)), 2, 20), + node((2, 1), Some((1, 0)), 2, 21), + ], + children: HashMap::from([10, 20, 21, 30].map(|m| (m, (String::new(), 0)))), + }; + let lod = Lod::new(Path::new(""), Arc::new(map), HashMap::new()); + let object = Object { model: 30, position: [0.0; 3], rotation: [0.0, 0.0, 0.0, 1.0], scale: [1.0; 2] }; + let close = Close { objects: vec![(Some(1), object)] }; + let cut = |at: f32, loaded: &[u32]| { + let cut = lod.cut(&[at, 0.0, 0.0], 1.0, &|m| loaded.contains(&m), &|_| false, std::iter::once(&close)); + let mut draw: Vec = cut.draw.into_keys().collect(); + draw.sort_unstable(); + (draw, cut.wanted.len()) + }; + // Afar, the far one; close, what it stands for once all of it is there. + assert_eq!(cut(500.0, &[10, 20, 21, 30]), (vec![10], 0)); + assert_eq!(cut(50.0, &[10, 20]), (vec![10], 2)); + assert_eq!(cut(50.0, &[10, 20, 21]), (vec![20, 21], 1)); + assert_eq!(cut(50.0, &[10, 20, 21, 30]), (vec![21, 30], 0)); + } +} diff --git a/crates/openrage-app/src/lib.rs b/crates/openrage-app/src/lib.rs index d670f98..4eac124 100644 --- a/crates/openrage-app/src/lib.rs +++ b/crates/openrage-app/src/lib.rs @@ -14,6 +14,9 @@ pub mod extract; pub mod gta4; pub mod gta4_cutscene; pub mod gta4_effects; +pub mod gta6_models; +pub mod gta6_textures; +pub mod gta6_world; pub mod install; pub mod journal; pub mod licenses; @@ -33,6 +36,7 @@ pub mod rdr2; pub mod rdr2_install; pub mod render; pub mod repack; +pub mod rpf9; pub mod setup; pub mod suggest; pub mod texttable; diff --git a/crates/openrage-app/src/media.rs b/crates/openrage-app/src/media.rs index 9a74364..632805f 100644 --- a/crates/openrage-app/src/media.rs +++ b/crates/openrage-app/src/media.rs @@ -1,4 +1,4 @@ -//! Facts about Scaleform movies (`.gfx`) and Bink videos (`.bik`) for display. +//! Facts about Scaleform movies (`.gfx`) and Bink videos (`.bik`, `.bk2`) for display. use anyhow::Result; @@ -15,18 +15,26 @@ fn short_list(names: &[String]) -> String { } /// Facts about a media file, as (label, value) rows. -pub fn rows(name: &str, data: &[u8]) -> Result> { +pub fn rows(data: &[u8]) -> Result> { use rage_formats::media; - let lower = name.to_ascii_lowercase(); - Ok(if lower.ends_with(".bik") { - let b = media::bink(data)?; - vec![ - ("Format".into(), format!("Bink video ({})", b.signature)), - ("Resolution".into(), format!("{} × {}", b.width, b.height)), - ("Frames".into(), format!("{} at {:.2} fps", b.frames, b.fps)), - ("Length".into(), format!("{:.1} s", b.duration())), - ("Audio tracks".into(), b.audio_tracks.to_string()), - ] + Ok(if rage_formats::bink::is_bink(data) { + let v = rage_formats::bink::read(data)?; + let mut rows = vec![ + ("Format".into(), format!("Bink {} video, revision {}", v.version, v.revision as char)), + ( + "Resolution".into(), + format!("{} × {}{}", v.width, v.height, if v.has_alpha() { ", with alpha" } else { "" }), + ), + ("Frames".into(), format!("{} at {:.2} fps", v.frames(), v.frames_per_second())), + ("Length".into(), format!("{:.1} s", v.duration())), + ]; + let tracks: Vec = v + .tracks + .iter() + .map(|t| format!("{} Hz, {}", t.sample_rate, if t.channels == 2 { "stereo" } else { "mono" })) + .collect(); + rows.push(("Sound".into(), if tracks.is_empty() { "none".into() } else { tracks.join("; ") })); + rows } else { let g = media::gfx(data)?; vec![ diff --git a/crates/openrage-app/src/metadata.rs b/crates/openrage-app/src/metadata.rs index ef10faa..4ae297a 100644 --- a/crates/openrage-app/src/metadata.rs +++ b/crates/openrage-app/src/metadata.rs @@ -12,7 +12,10 @@ use rage_resource::Resource; use rage_rpf::vfs::Node; /// Extensions of files that hold metadata. -pub const EXTENSIONS: &[&str] = &["ymap", "ytyp", "ymt", "ymf", "cut", "pso"]; +pub const EXTENSIONS: &[&str] = &[ + "ymap", "ytyp", "ymt", "ymf", "cut", "pso", "psin", "rbf0", "#mt", "#map", "#typ", "#ldb", "#ldbmt", "#as", "#cov", + "#kit", "#fc", "#lfc", +]; pub fn is_metadata(name: &str) -> bool { let lower = name.to_ascii_lowercase(); @@ -72,6 +75,11 @@ fn from_bytes_for(data: &[u8], rdr2: bool) -> Result { } return from_resource(&res); } + if rage_formats::psin::is_psin(data) { + let psin = rage_formats::psin::parse(data)?; + let (text, errors) = psin.to_xml(); + return Ok(Xml { text, encoding: Encoding::Pso, root: Some(psin.root_type()), errors }); + } if rage_formats::pso::is_pso(data) { let pso = if rdr2 { rage_formats::pso::parse_rdr2(data)? } else { rage_formats::pso::parse(data)? }; let (text, errors) = pso.to_xml(); @@ -109,6 +117,16 @@ pub fn from_rpf8(rpf: &rage_rpf::Rpf8, i: usize) -> Result { from_bytes_rdr2(&rpf.read(entry)?) } +/// Converts a metadata file in a GTA VI archive (resource or PSO) to XML. +pub fn from_rpf9(rpf: &rage_rpf::Rpf9, i: usize) -> Result { + match crate::rpf9::resource(rpf, i) { + Ok((system, graphics)) if rage_formats::meta::is_gta6(&system) => { + from_resource(&Resource { version: rage_formats::meta::VERSION_RDR2, system, graphics }) + } + _ => from_bytes(&rpf.read_at(i)?), + } +} + /// Reads a metadata file (mods included) and converts it to XML. pub fn load(game_dir: &Path, keys: Option>, vpath: &str) -> Result { let (node, _) = rage_mods::resolve(game_dir, vpath, keys)?; @@ -116,6 +134,7 @@ pub fn load(game_dir: &Path, keys: Option>, vpath: &str) -> Result Node::ArchiveFile(rpf, id) => rpf.read(id)?, Node::PlainFile(p) => std::fs::read(p)?, Node::Rpf8File(rpf, i) => return from_rpf8(&rpf, i), + Node::Rpf9File(rpf, i) => return from_rpf9(&rpf, i), _ => bail!("{vpath} is not a file"), }; from_bytes(&data) diff --git a/crates/openrage-app/src/models.rs b/crates/openrage-app/src/models.rs index 23503de..2cdcc7d 100644 --- a/crates/openrage-app/src/models.rs +++ b/crates/openrage-app/src/models.rs @@ -38,6 +38,8 @@ pub struct LoadedModel { pub parts: Vec, /// Texture dictionaries found next to the model (`.ytd`, `vehshare.ytd`). pub external: Vec<(String, TextureDictionary)>, + /// Textures shared with other models (GTA VI). + shared: Vec>, /// Materials: shaders with the same name across all drawables. pub materials: Vec, /// The skeleton skinned meshes are bound to (for peds: from the `.yft` @@ -111,6 +113,7 @@ impl LoadedModel { parts, external: Vec::new(), materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton: None, expressions: Vec::new(), @@ -123,7 +126,24 @@ impl LoadedModel { /// Finds a texture by name: embedded in the drawable first, then next to the model. pub fn texture<'a>(&'a self, drawable: &'a Drawable, name: &str) -> Option<&'a Texture> { let find = |d: &'a TextureDictionary| d.textures.iter().find(|t| t.name.eq_ignore_ascii_case(name)); - drawable.textures.as_ref().and_then(find).or_else(|| self.external.iter().find_map(|(_, d)| find(d))) + let own = drawable.textures.as_ref().and_then(find).or_else(|| self.external.iter().find_map(|(_, d)| find(d))); + own.or_else(|| self.shared_texture(name).map(|t| &**t)) + } + + /// The texture of this name that is shared with other models. + pub(crate) fn shared_texture(&self, name: &str) -> Option<&Arc> { + self.shared.iter().find(|t| t.name.eq_ignore_ascii_case(name)) + } + + /// Gives the model textures it shares with others. + pub fn set_shared(&mut self, textures: Vec>) { + self.shared = textures; + self.collect_materials(); + } + + /// Lets go of the shared textures: what shows the model has them. + pub fn forget_shared(&mut self) { + self.shared = Vec::new(); } /// Dresses a GTA IV ped: for each (component, drawable, texture) — a @@ -533,6 +553,12 @@ pub fn is_model(name: &str) -> bool { || n.ends_with(".wft") || n.ends_with(".wbn") || n.ends_with(".wbd") + // GTA VI: drawables, fragments and drawable dictionaries. + || n.ends_with(".#dr") + || n.ends_with(".#ft") + || n.ends_with(".#dd") + || n.ends_with(".#bn") + || n.ends_with(".#nv") || rage_formats::paths::is_path_file(&n) } @@ -675,6 +701,38 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu if let Node::Gta4File(archive, id) = node { return load_gta4(&archive, id); } + if let Node::Rpf9File(rpf, i) = node { + if vpath.to_ascii_lowercase().ends_with(".#bn") { + let (system, _) = crate::rpf9::resource(&rpf, i)?; + let (collision, stats) = rage_formats::bn6::parse(&system)?; + for material in stats.materials { + let label = format!("Material {material:04x}"); + let color = material_color(&label, material as u8); + let id = rage_formats::ybn::MATERIAL_BASE + u32::from(material); + rage_formats::shaders::register(id, label, color); + } + return Ok(LoadedModel::from_drawables(vec![("collision".to_owned(), collision)])); + } + if vpath.to_ascii_lowercase().ends_with(".#nv") { + let (mesh, _) = rage_formats::paths::parse_nv6(crate::rpf9::resource(&rpf, i)?.0)?; + return Ok(LoadedModel::from_drawables(vec![("nav mesh".to_owned(), mesh)])); + } + let mut drawables = crate::gta6_models::load(&rpf, i)?; + let textures = crate::gta6_textures::for_drawables(game_dir, &drawables); + let name = vpath.rsplit('/').next().unwrap_or(vpath); + // A dictionary's drawables have skeletons of their own. + let worn_on = crate::gta6_models::bind(game_dir, name, &mut drawables); + let skeleton = worn_on.or_else(|| match drawables.as_slice() { + [(_, d)] => d.skeleton.clone(), + _ => None, + }); + let mut model = LoadedModel::from_drawables(drawables); + model.skeleton = skeleton; + if let Some(textures) = textures { + model.add_textures("texture pools".to_owned(), textures); + } + return Ok(model); + } let Node::ArchiveFile(rpf, id) = node else { bail!("{vpath} is not a file inside an archive") }; let name = rpf.entry(id).name.clone(); let res = rpf.read_resource(id)?; @@ -784,6 +842,7 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu parts, external, materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton, expressions: Vec::new(), @@ -869,6 +928,7 @@ fn load_model(game_dir: &Path, keys: Option>, vpath: &str) -> Resu parts, external, materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton, expressions: Vec::new(), @@ -1345,6 +1405,7 @@ fn load_gta4(archive: &Arc, id: rage_rpf::Gta4EntryId) -> parts, external, materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton, expressions: Vec::new(), @@ -1408,6 +1469,7 @@ fn gta4_player(archive: &rage_rpf::Gta4Archive, skeleton: drawable::Skeleton) -> parts, external, materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton: Some(skeleton), expressions: Vec::new(), @@ -1448,6 +1510,7 @@ pub fn load_gta4_members(game: &Path, vpath: &str, wanted: &[(String, u32)]) -> parts: vec![part], external, materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton: d.skeleton.clone(), expressions: Vec::new(), @@ -1570,6 +1633,7 @@ fn load_rdr2(rpf: &Arc, i: usize) -> Result { parts, external, materials: Vec::new(), + shared: Vec::new(), shader_material: Vec::new(), skeleton, expressions: Vec::new(), @@ -1732,6 +1796,7 @@ fn load_rdr2_ped_inner(game: &Path, ped: &str, outfit: usize) -> Result bail!("{vpath}: not found"), }, Node::Gta4File(a, id) => a.read(id)?, - Node::Dir(_) | Node::ArchiveDir(..) | Node::Rpf8Dir(..) | Node::Gta4Dir(..) => { + Node::Rpf9File(rpf, i) => rpf.read_at(i)?, + Node::Dir(_) | Node::ArchiveDir(..) | Node::Rpf8Dir(..) | Node::Gta4Dir(..) | Node::Rpf9Dir(..) => { bail!("{vpath} is a folder") } _ => bail!("{vpath}: not supported"), @@ -223,7 +224,26 @@ impl GameFiles for GameDir { out.push(DirEntry { name: e.name.clone(), is_dir: e.is_dir(), size: e.size() }); } } - Node::PlainFile(_) | Node::ArchiveFile(..) | Node::Rpf8File(..) | Node::Gta4File(..) => { + Node::Rpf9Dir(rpf, dir) => { + let entries = rpf.entries()?; + let (dirs, files) = rpf.list_dir(&entries, &dir); + for d in dirs { + out.push(DirEntry { name: d, is_dir: true, size: 0 }); + } + for i in files { + let name = rpf.entry_name(&entries[i]); + out.push(DirEntry { + name: name.rsplit('/').next().unwrap_or(&name).to_owned(), + is_dir: false, + size: entries[i].size, + }); + } + } + Node::PlainFile(_) + | Node::ArchiveFile(..) + | Node::Rpf8File(..) + | Node::Gta4File(..) + | Node::Rpf9File(..) => { bail!("{vpath} is a file") } _ => bail!("{vpath}: not supported"), diff --git a/crates/openrage-app/src/render.rs b/crates/openrage-app/src/render.rs index 3b74717..f74ee84 100644 --- a/crates/openrage-app/src/render.rs +++ b/crates/openrage-app/src/render.rs @@ -4,9 +4,12 @@ //! with alpha cut-out, and simple headlight shading. Fast enough for //! interactive previews of game models (tens of thousands of triangles). +use rage_formats::drawable::param; use std::collections::HashMap; +use std::sync::{Arc, LazyLock, Mutex, OnceLock, Weak}; use rage_formats::math; +use rage_formats::texture::Texture; use crate::models::{LoadedModel, Look}; @@ -24,45 +27,112 @@ impl Default for View { } } -struct Image { +/// A picture on a model, shared by those with the same one. +pub struct Image { w: usize, h: usize, - rgba: Vec, + /// Decoded on first use. + rgba: OnceLock>>, + /// As the game has it; let go once it is on the graphics card. + source: Mutex>>, } impl Image { - fn sample(&self, u: f32, v: f32) -> [u8; 4] { + fn decoded(w: usize, h: usize, rgba: Vec) -> Self { + Self { w, h, rgba: OnceLock::from(Some(rgba)), source: Mutex::new(None) } + } + + /// Width and height. + pub fn size(&self) -> (usize, usize) { + (self.w, self.h) + } + + /// RGBA pixels. + pub fn rgba(&self) -> Option<&[u8]> { + let decode = || self.source().and_then(|t| t.to_rgba()); + self.rgba.get_or_init(decode).as_deref() + } + + /// The texture as the game has it, if it is kept. + pub fn source(&self) -> Option> { + self.source.lock().unwrap_or_else(|e| e.into_inner()).clone() + } + + /// Lets go of it: it is elsewhere now. + pub fn release(&self) { + *self.source.lock().unwrap_or_else(|e| e.into_inner()) = None; + } + + /// The picture of a texture that several models share. + fn shared(texture: &Arc) -> Arc { + type Known = HashMap, Weak)>; + static KNOWN: LazyLock> = LazyLock::new(Default::default); + let mut known = KNOWN.lock().unwrap_or_else(|e| e.into_inner()); + let key = Arc::as_ptr(texture) as usize; + if let Some((of, image)) = known.get(&key) + && of.upgrade().is_some_and(|of| Arc::ptr_eq(&of, texture)) + && let Some(image) = image.upgrade() + { + return image; + } + let image = Arc::new(Image { + w: texture.width.max(1) as usize, + h: texture.height.max(1) as usize, + rgba: OnceLock::new(), + source: Mutex::new(Some(Arc::clone(texture))), + }); + if known.len().is_power_of_two() { + known.retain(|_, (_, image)| image.strong_count() > 0); + } + known.insert(key, (Arc::downgrade(texture), Arc::downgrade(&image))); + image + } + + fn sample(&self, rgba: &[u8], u: f32, v: f32) -> [u8; 4] { let x = ((u - u.floor()) * self.w as f32) as usize % self.w; let y = ((v - v.floor()) * self.h as f32) as usize % self.h; let i = (y * self.w + x) * 4; - [self.rgba[i], self.rgba[i + 1], self.rgba[i + 2], self.rgba[i + 3]] + [rgba[i], rgba[i + 1], rgba[i + 2], rgba[i + 3]] } } -/// Decoded textures, shared between frames. +/// The textures of a model, ready to be drawn. pub struct Materials { - images: Vec, - /// Indices into `images` per drawable and shader: base colour and the - /// overlay drawn over it on the second UV set (liveries, signs). - per_shader: Vec, Option)>>, + images: Vec>, + /// Indices into `images` per drawable and shader. + per_shader: Vec>, +} + +/// A shader's textures: indices into [`Materials::images`]. +#[derive(Clone, Copy, Default)] +struct Slots { + base: Option, + /// Drawn over the base on the second UV set (liveries, signs). + overlay: Option, + normal: Option, + specular: Option, } impl Materials { - /// Decodes the base and overlay textures of every shader of every drawable. + /// Decodes the textures of every shader of every drawable. pub fn new(model: &LoadedModel) -> Self { let mut by_name: HashMap> = HashMap::new(); - let mut images: Vec = Vec::new(); + let mut images: Vec> = Vec::new(); // `opaque`: the shader's alpha channel holds other data (skin shaders). let mut decode = |d: &rage_formats::drawable::Drawable, name: Option<&str>, opaque: bool| { let name = name?; let key = format!("{}{}", name.to_ascii_lowercase(), if opaque { "#opaque" } else { "" }); *by_name.entry(key).or_insert_with(|| { let t = model.texture(d, name)?; + if let Some(shared) = model.shared_texture(name).filter(|s| !opaque && std::ptr::eq(&***s, t)) { + images.push(Image::shared(shared)); + return Some(images.len() - 1); + } let mut rgba = t.to_rgba()?; if opaque { rgba.iter_mut().skip(3).step_by(4).for_each(|a| *a = 255); } - images.push(Image { w: t.width.max(1) as usize, h: t.height.max(1) as usize, rgba }); + images.push(Arc::new(Image::decoded(t.width.max(1) as usize, t.height.max(1) as usize, rgba))); Some(images.len() - 1) }) }; @@ -74,7 +144,12 @@ impl Materials { .iter() .map(|s| { let opaque = rage_formats::shaders::alpha_is_not_opacity(s.name_hash); - (decode(d, s.base_texture(), opaque), decode(d, s.overlay_texture(), false)) + Slots { + base: decode(d, s.base_texture(), opaque), + overlay: decode(d, s.overlay_texture(), false), + normal: decode(d, s.sampler(param::BUMP_TEX), false), + specular: decode(d, s.sampler(param::SPECULAR_TEX), false), + } }) .collect() }) @@ -82,31 +157,30 @@ impl Materials { Self { images, per_shader } } - fn slot(&self, drawable: usize, shader: u16) -> (Option, Option) { + fn slot(&self, drawable: usize, shader: u16) -> Slots { self.per_shader.get(drawable).and_then(|s| s.get(shader as usize)).copied().unwrap_or_default() } - fn image(&self, drawable: usize, shader: u16) -> Option<&Image> { - self.slot(drawable, shader).0.map(|i| &self.images[i]) + fn image(&self, drawable: usize, shader: u16) -> Option<(&Image, &[u8])> { + let image = &*self.images[self.slot(drawable, shader).base?]; + Some((image, image.rgba()?)) } - fn overlay_image(&self, drawable: usize, shader: u16) -> Option<&Image> { - self.slot(drawable, shader).1.map(|i| &self.images[i]) + fn overlay_image(&self, drawable: usize, shader: u16) -> Option<(&Image, &[u8])> { + let image = &*self.images[self.slot(drawable, shader).overlay?]; + Some((image, image.rgba()?)) } - /// RGBA pixels of the base texture of a drawable's shader (for GPU upload). - pub fn texture(&self, drawable: usize, shader: u16) -> Option<(usize, usize, usize, &[u8])> { - let i = self.slot(drawable, shader).0?; - let img = &self.images[i]; - Some((i, img.w, img.h, &img.rgba)) + /// The base texture of a drawable's shader, the overlay drawn over it with + /// its alpha on the second UV set, the normal and the specular map. + pub fn pictures(&self, drawable: usize, shader: u16) -> [Option<&Arc>; 4] { + let Slots { base, overlay, normal, specular } = self.slot(drawable, shader); + [base, overlay, normal, specular].map(|i| i.map(|i| &self.images[i])) } - /// RGBA pixels of the overlay texture of a drawable's shader, drawn over - /// the base colour with its alpha on the second UV set (for GPU upload). - pub fn overlay(&self, drawable: usize, shader: u16) -> Option<(usize, usize, usize, &[u8])> { - let i = self.slot(drawable, shader).1?; - let img = &self.images[i]; - Some((i, img.w, img.h, &img.rgba)) + /// Lets go of what is on the graphics card now. + pub fn release(&self) { + self.images.iter().for_each(|i| i.release()); } } @@ -160,12 +234,16 @@ pub fn orbit_camera(lo: [f32; 3], hi: [f32; 3], view: View) -> Camera { let center = [(lo[0] + hi[0]) / 2.0, (lo[1] + hi[1]) / 2.0, (lo[2] + hi[2]) / 2.0]; let radius = (dot(sub(hi, lo), sub(hi, lo)).sqrt() / 2.0).max(1e-3); let fov = 40f32.to_radians(); - let distance = radius / (fov / 2.0).sin() / view.zoom.max(0.05); + // A little room around the model. + let whole = radius / (fov / 2.0).sin() * 1.05; + let distance = whole / view.zoom.max(0.05); let (cp, sp, cy, sy) = (view.pitch.cos(), view.pitch.sin(), view.yaw.cos(), view.yaw.sin()); - let eye = [center[0] + distance * cp * cy, center[1] + distance * cp * sy, center[2] + distance * sp]; - let forward = norm(sub(center, eye)); + let towards = [cp * cy, cp * sy, sp]; + let forward = norm([-towards[0], -towards[1], -towards[2]]); let right = norm(cross(forward, [0.0, 0.0, 1.0])); let up = cross(right, forward); + // Nothing but the angles moves the camera: around the middle, on a circle. + let eye = std::array::from_fn(|k| center[k] + distance * towards[k]); Camera { eye, forward, right, up, distance, radius, fov } } @@ -319,7 +397,7 @@ pub fn render_scene(items: &[SceneItem], camera: &Camera, width: usize, height: if let (Some(img), true) = (img, has_uv) { let u = q0 * mesh.uvs[a][0] + q1 * mesh.uvs[b][0] + q2 * mesh.uvs[c][0]; let v = q0 * mesh.uvs[a][1] + q1 * mesh.uvs[b][1] + q2 * mesh.uvs[c][1]; - let t = img.sample(u, v); + let t = img.0.sample(img.1, u, v); if t[3] < 77 { continue; // alpha cut-out } @@ -332,7 +410,7 @@ pub fn render_scene(items: &[SceneItem], camera: &Camera, width: usize, height: let uv = &mesh.uvs1; let u = q0 * uv[a][0] + q1 * uv[b][0] + q2 * uv[c][0]; let v = q0 * uv[a][1] + q1 * uv[b][1] + q2 * uv[c][1]; - let t = img.sample(u, v); + let t = img.0.sample(img.1, u, v); let alpha = t[3] as f32 / 255.0; for k in 0..3 { base[k] += (t[k] as f32 / 255.0 - base[k]) * alpha; diff --git a/crates/openrage-app/src/rpf9.rs b/crates/openrage-app/src/rpf9.rs new file mode 100644 index 0000000..092d50a --- /dev/null +++ b/crates/openrage-app/src/rpf9.rs @@ -0,0 +1,531 @@ +//! GTA VI archives (RPF9): the stored index of their recovery view, and +//! extraction. +//! +//! The recovery view is for archives whose own table cannot be read. Finding the files of an RPF9 archive means reading all of it (see +//! [`rage_rpf::rpf9`]), which takes minutes for the large ones. The result +//! is kept in the cache directory, one file per archive, and used as long as +//! the archive's size and modification time stay the same. + +use std::collections::HashMap; +use std::fs; +use std::io::{BufWriter, Read, Write}; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::{Arc, Mutex, OnceLock}; +use std::time::UNIX_EPOCH; + +use anyhow::{Context, Result}; +use rage_rpf::rpf9::{self, Entry}; +use rage_rpf::{Rpf9, RpfError, vfs}; + +use crate::extract::ExtractSummary; + +/// Start of an index file; the digit changes with the format. +const INDEX_MAGIC: &[u8; 8] = b"ORP9IDX2"; + +/// Where the index of an archive is stored: +/// `/openrage/rpf9-.idx`. +pub fn index_path(archive: &Path) -> Option { + crate::paths::game_cache(archive, "rpf9", "idx") +} + +/// Size and modification time (seconds) of the archive: an index made for +/// other values is out of date. +fn identity(archive: &Path) -> Option<[u8; 16]> { + let meta = fs::metadata(archive).ok()?; + let modified = meta.modified().ok()?.duration_since(UNIX_EPOCH).ok()?.as_secs(); + let mut id = [0u8; 16]; + id[..8].copy_from_slice(&meta.len().to_le_bytes()); + id[8..].copy_from_slice(&modified.to_le_bytes()); + Some(id) +} + +/// The stored index of an archive, if there is one and it is up to date. +pub fn load_index(archive: &Path) -> Option> { + load_index_from(&index_path(archive)?, archive) +} + +fn load_index_from(index: &Path, archive: &Path) -> Option> { + let data = fs::read(index).ok()?; + let rest = data.strip_prefix(INDEX_MAGIC)?.strip_prefix(&identity(archive)?)?; + let entries = rpf9::decode_index(rest)?; + let mut file = fs::File::open(archive).ok()?; + let size = file.metadata().ok()?.len(); + let mut bytes = [0u8; rpf9::HEADER_LEN]; + file.read_exact(&mut bytes).ok()?; + let header = rpf9::Header::parse(&bytes)?; + entries + .iter() + .all(|entry| entry.offset >= u64::from(header.data_offset) && entry.offset + entry.stored <= size) + .then_some(entries) +} + +/// Stores the index of an archive. +pub fn store_index(archive: &Path, entries: &[Entry]) -> Result<()> { + store_index_to(&index_path(archive).context("no cache directory")?, archive, entries) +} + +fn store_index_to(index: &Path, archive: &Path, entries: &[Entry]) -> Result<()> { + let id = identity(archive).context("archive not readable")?; + if let Some(dir) = index.parent() { + fs::create_dir_all(dir)?; + } + // Written beside and renamed: a stopped write leaves no half index. + let partial = index.with_extension("idx.part"); + let mut data = Vec::from(INDEX_MAGIC); + data.extend_from_slice(&id); + data.extend_from_slice(&rpf9::encode_index(entries)); + fs::write(&partial, data)?; + fs::rename(&partial, index)?; + Ok(()) +} + +/// Start of a names file; the digit changes with the format. +const NAMES_MAGIC: &[u8; 8] = b"ORP9NAM2"; +/// How much of a resource is read to find its name. +const NAME_PREFIX: usize = 256 << 10; + +/// Where the names of an archive's models are stored, beside its index. +pub fn names_path(archive: &Path) -> Option { + crate::paths::game_cache(archive, "rpf9", "names") +} + +/// The stored names of an archive, if there are any and they are up to date. +pub fn load_names(archive: &Path) -> Option { + let data = fs::read(names_path(archive)?).ok()?; + let mut rest = data.strip_prefix(NAMES_MAGIC)?.strip_prefix(&identity(archive)?)?; + let mut found = Vec::new(); + while !rest.is_empty() { + let offset = u64::from_le_bytes(rest.get(..8)?.try_into().ok()?); + let len = usize::from(u16::from_le_bytes(rest.get(8..10)?.try_into().ok()?)); + found.push((offset, String::from_utf8(rest.get(10..10 + len)?.to_vec()).ok()?)); + rest = &rest[10 + len..]; + } + Some(rpf9::Names::new(found)) +} + +/// Stores the names of an archive's models. +pub fn store_names(archive: &Path, names: &[(u64, String)]) -> Result<()> { + let path = names_path(archive).context("no cache directory")?; + let id = identity(archive).context("archive not readable")?; + if let Some(dir) = path.parent() { + fs::create_dir_all(dir)?; + } + let mut data = Vec::from(NAMES_MAGIC); + data.extend_from_slice(&id); + for (offset, name) in names { + data.extend_from_slice(&offset.to_le_bytes()); + data.extend_from_slice(&(name.len().min(usize::from(u16::MAX)) as u16).to_le_bytes()); + data.extend_from_slice(&name.as_bytes()[..name.len().min(usize::from(u16::MAX))]); + } + let partial = path.with_extension("names.part"); + fs::write(&partial, data)?; + fs::rename(&partial, &path)?; + Ok(()) +} + +/// Reads the start of every resource of an archive and returns the names +/// of those that are models; a dictionary of models is named by its offset. `progress` gets the resources read and their +/// number; setting `cancel` stops with what was found so far (`None`). +pub fn scan_names( + rpf: &Rpf9, + entries: &[Entry], + cancel: &AtomicBool, + progress: &(dyn Fn(u64, u64) + Sync), +) -> Option> { + use rayon::prelude::*; + let resources: Vec<&Entry> = entries.iter().filter(|e| e.is_resource()).collect(); + let (done, total) = (std::sync::atomic::AtomicU64::new(0), resources.len() as u64); + let found: Vec<(u64, String)> = resources + .par_iter() + .filter_map(|e| { + if cancel.load(Ordering::Relaxed) { + return None; + } + let n = done.fetch_add(1, Ordering::Relaxed) + 1; + if n.is_multiple_of(256) || n == total { + progress(n, total); + } + let start = rpf.read_start(e, NAME_PREFIX).ok()?; + // A dictionary of models has no name of its own. + let name = match rage_formats::drawable6::root(&start)? { + rage_formats::drawable6::Root::Dictionary => format!("dictionary_{:012x}.#dd", e.offset), + _ => rage_formats::drawable6::name(&start)?, + }; + Some((e.offset, name)) + }) + .collect(); + (!cancel.load(Ordering::Relaxed)).then_some(found) +} + +/// What [`register`] reports to: the archive's file name with the bytes read +/// and to read, or `None` when the scan is over. +pub type Report = dyn Fn(Option<(&str, u64, u64)>) + Send + Sync; + +/// Makes [`Rpf9::entries`] use the stored index, and scan and store it when +/// there is none. `report` gets the archive's file name with the bytes read +/// and to read while scanning, and `None` when the scan is over. +pub fn register(report: Arc) { + let _ = REPORT.set(Arc::clone(&report)); + rpf9::set_indexer(Arc::new(move |rpf: &Rpf9| index(rpf, &AtomicBool::new(false), &*report))); + rpf9::set_namer(Arc::new(|rpf: &Rpf9| load_names(rpf.path()))); + if let Some(learned) = learned_path().and_then(|p| fs::read_to_string(p).ok()) { + rpf9::add_names(learned.lines().map(str::to_owned)); + } +} + +/// Where names that were learned from all of the game's archives are stored. +/// They are checked by their hashes, so they are good for any game folder. +fn learned_path() -> Option { + Some(crate::paths::cache_dir()?.join("gta6-names.txt")) +} + +/// Whether names were learned before. +pub fn knows_names() -> bool { + learned_path().is_some_and(|p| p.is_file()) +} + +/// Names files in a game's index after those in other archives, and keeps the +/// names for when archives are opened. +pub fn learn_names(index: &mut rage_index::Index) -> Result { + let mut found = index.learn_gta6_names()?; + let count = found.len(); + if count == 0 { + return Ok(0); + } + let path = learned_path().context("no cache directory")?; + if let Ok(known) = fs::read_to_string(&path) { + found.extend(known.lines().map(str::to_owned)); + } + found.sort_unstable(); + found.dedup(); + let partial = path.with_extension("txt.part"); + fs::write(&partial, found.join("\n"))?; + fs::rename(&partial, &path)?; + rpf9::add_names(found); + Ok(count) +} + +static REPORT: OnceLock> = OnceLock::new(); + +/// One lock per archive: two threads that want the same index (the window +/// and the background run) scan it once; the second finds it stored. +fn scan_lock(archive: &Path) -> Arc> { + static LOCKS: OnceLock>>>> = OnceLock::new(); + let mut locks = LOCKS.get_or_init(Default::default).lock().unwrap_or_else(|e| e.into_inner()); + Arc::clone(locks.entry(archive.to_path_buf()).or_default()) +} + +/// The entries of an archive: from the stored index, or scanned and stored. +fn index(rpf: &Rpf9, cancel: &AtomicBool, report: &Report) -> Result, RpfError> { + let lock = scan_lock(rpf.path()); + let _scanning = lock.lock().unwrap_or_else(|e| e.into_inner()); + if let Some(entries) = load_index(rpf.path()) { + return Ok(entries); + } + let name = rpf.path().file_name().unwrap_or_default().to_string_lossy().into_owned(); + report(Some((&name, 0, rpf.data_len()))); + let scanned = rpf.scan(cancel, &|done, total| report(Some((&name, done, total)))); + report(None); + let entries = scanned?; + // The index only saves time: failing to store it is no error. + let _ = store_index(rpf.path(), &entries); + Ok(entries) +} + +/// Finds and stores the names of an archive's models, unless they are +/// stored already, and gives them to `rpf`. +pub fn ensure_names(rpf: &Rpf9, entries: &[Entry], cancel: &AtomicBool, report: &Report) { + if rpf.is_native() { + return; + } + let lock = scan_lock(rpf.path()); + let _scanning = lock.lock().unwrap_or_else(|e| e.into_inner()); + if load_names(rpf.path()).is_some() { + return; + } + let name = format!("{} (model names)", rpf.path().file_name().unwrap_or_default().to_string_lossy()); + report(Some((&name, 0, 1))); + let found = scan_names(rpf, entries, cancel, &|done, total| report(Some((&name, done, total)))); + report(None); + if let Some(found) = found { + // The names only help reading the list: failing to store them is no error. + let _ = store_names(rpf.path(), &found); + rpf.set_names(rpf9::Names::new(found)); + } +} + +/// The names for the archive a command works on: read from the models once +/// if they are not stored yet. For programs without a background run. +pub fn names_now(rpf: &Rpf9) { + if let (Ok(entries), Some(report)) = (rpf.entries(), REPORT.get()) { + ensure_names(rpf, &entries, &AtomicBool::new(false), &**report); + } +} + +/// The run started by [`index_in_background`], to stop it. +static BACKGROUND: Mutex>> = Mutex::new(None); + +/// Stops the background run, if one is going. +pub fn stop_background() { + if let Some(stop) = BACKGROUND.lock().unwrap_or_else(|e| e.into_inner()).take() { + stop.store(true, Ordering::Relaxed); + } +} + +/// Indexes the archives below `game_dir` that have no stored index yet, one +/// after the other (smallest first), on a thread of its own. Opening an +/// archive meanwhile waits for its index or makes it. A run started before +/// is stopped. +pub fn index_in_background(game_dir: &Path) { + stop_background(); + let stop = Arc::new(AtomicBool::new(false)); + *BACKGROUND.lock().unwrap_or_else(|e| e.into_inner()) = Some(Arc::clone(&stop)); + let game_dir = game_dir.to_path_buf(); + std::thread::spawn(move || { + let mut archives = Vec::new(); + crate::detect::collect_archives(&game_dir, &["rpf"], &mut archives); + archives.retain(|p| { + Rpf9::file_is_rpf9(p) + && (load_index(p).is_none() || names_path(p).is_none_or(|n| !n.is_file() || load_names(p).is_none())) + }); + archives.sort_by_key(|p| fs::metadata(p).map_or(0, |m| m.len())); + let quiet: &Report = &|_| {}; + let report: &Report = REPORT.get().map_or(quiet, |r| &**r); + for archive in archives { + if stop.load(Ordering::Relaxed) { + break; + } + let Ok(rpf) = Rpf9::open(&archive) else { continue }; + if rpf.is_native() { + continue; + } + let Ok(entries) = index(&rpf, &stop, report) else { continue }; + ensure_names(&rpf, &entries, &stop, report); + } + }); +} + +/// The entries of an archive if they are at hand without scanning it. +pub fn known_entries(rpf: &Rpf9) -> Option>> { + rpf.loaded().or_else(|| if rpf.is_native() { rpf.entries().ok() } else { load_index(rpf.path()).map(Arc::new) }) +} + +/// Totals of an archive's entries. +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +pub struct Coverage { + pub files: u64, + /// Bytes of the archive the files take. + pub stored: u64, + /// Bytes the files unpack to. + pub unpacked: u64, + /// Bytes of the data area that belong to no file: padding, and data that + /// is neither zlib, Bink 2 nor an audio container. + pub unread: u64, +} + +pub fn coverage(rpf: &Rpf9, entries: &[Entry]) -> Coverage { + let stored: u64 = entries.iter().map(|e| e.stored).sum(); + Coverage { + files: entries.len() as u64, + stored, + unpacked: entries.iter().map(|e| e.size).sum(), + unread: rpf.data_len().saturating_sub(stored), + } +} + +/// The system and graphics parts of a resource. +pub fn resource(rpf: &Rpf9, index: usize) -> Result<(Vec, Vec)> { + let entries = rpf.entries()?; + let entry = entries.get(index).context("no such entry")?; + let (system, _) = rpf.resource_parts(entry).context("not a resource")?; + let mut data = rpf.read(entry)?; + if system as usize > data.len() { + anyhow::bail!("the resource is cut off"); + } + let graphics = data.split_off(system as usize); + Ok((data, graphics)) +} + +/// Extracts from a GTA VI archive into `out`: one file (`file`), or +/// everything below folder `dir`. Files are written unpacked, straight to +/// disk; with `expand`, archives inside become folders. Unreadable files are +/// listed in `failures` and skipped. +pub fn extract( + rpf: &Rpf9, + dir: &str, + file: Option, + out: &Path, + expand: bool, + cancel: &AtomicBool, + progress: &mut dyn FnMut(&ExtractSummary, &str), +) -> Result { + let mut summary = ExtractSummary { target: out.to_path_buf(), ..Default::default() }; + if let Some(i) = file { + let entries = rpf.entries()?; + let entry = entries.get(i).context("no such entry")?; + let name = rpf.entry_name(entry); + let base = name.rsplit('/').next().unwrap_or(&name).to_owned(); + extract_entry(rpf, entry, &base, out, expand, cancel, progress, &mut summary)?; + summary.target = out.join(base); + } else { + extract_dir(rpf, dir, out, expand, cancel, progress, &mut summary)?; + } + Ok(summary) +} + +/// Everything below `dir`, with its path from there on. +fn extract_dir( + rpf: &Rpf9, + dir: &str, + out: &Path, + expand: bool, + cancel: &AtomicBool, + progress: &mut dyn FnMut(&ExtractSummary, &str), + summary: &mut ExtractSummary, +) -> Result<()> { + let prefix = if dir.is_empty() { String::new() } else { format!("{dir}/") }; + for e in rpf.entries()?.iter() { + let name = rpf.entry_name(e); + if !name.get(..prefix.len()).is_some_and(|start| start.eq_ignore_ascii_case(&prefix)) { + continue; + } + if cancel.load(Ordering::Relaxed) { + summary.cancelled = true; + break; + } + extract_entry(rpf, e, &name[prefix.len()..], out, expand, cancel, progress, summary)?; + } + Ok(()) +} + +#[expect(clippy::too_many_arguments)] +fn extract_entry( + rpf: &Rpf9, + entry: &Entry, + rel: &str, + out: &Path, + expand: bool, + cancel: &AtomicBool, + progress: &mut dyn FnMut(&ExtractSummary, &str), + summary: &mut ExtractSummary, +) -> Result<()> { + let Some(path) = vfs::safe_relative_path(rel) else { + summary.failures.push(format!("unsafe path {rel}")); + return Ok(()); + }; + let target = out.join(path); + if expand && rpf.is_archive(entry) { + match rpf.open_child(entry) { + Ok(child) => return extract_dir(&child, "", &target, expand, cancel, progress, summary), + Err(e) => summary.failures.push(e.to_string()), + } + return Ok(()); + } + let parent = target.parent().map_or(Ok(()), fs::create_dir_all); + let mut writer = match parent.and_then(|()| fs::File::create(&target)) { + Ok(file) => BufWriter::new(file), + // A full disk stops everything, another bad file only itself. + Err(e) if e.kind() == std::io::ErrorKind::StorageFull => return Err(e.into()), + Err(e) => { + summary.failures.push(format!("{}: {e}", target.display())); + return Ok(()); + } + }; + match rpf.copy_to(entry, &mut writer).and_then(|n| Ok(writer.flush().map(|()| n)?)) { + Ok(bytes) => { + summary.files += 1; + summary.bytes += bytes; + } + Err(e) => { + drop(writer); + let _ = fs::remove_file(&target); + summary.failures.push(e.to_string()); + } + } + progress(summary, rel); + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use flate2::Compression; + use flate2::write::ZlibEncoder; + + fn archive(dir: &Path) -> PathBuf { + let mut data = vec![0u8; 0x40]; + data[..4].copy_from_slice(b"9FPR"); + data[4..8].copy_from_slice(&0x40u32.to_le_bytes()); + for text in [&b""[..], b"PSIN\x00\x01binary"] { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + enc.write_all(text).unwrap(); + data.extend(enc.finish().unwrap()); + data.resize(data.len().next_multiple_of(16), 0); + } + let path = dir.join("test.rpf"); + fs::write(&path, data).unwrap(); + path + } + + fn temp(name: &str) -> PathBuf { + let dir = std::env::temp_dir().join(format!("openrage-app-rpf9-{}-{name}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + fs::create_dir_all(&dir).unwrap(); + dir + } + + #[test] + fn the_index_is_stored_and_dropped_when_the_archive_changes() { + let dir = temp("index"); + let path = archive(&dir); + let rpf = Rpf9::open(&path).unwrap(); + let entries = rpf.scan(&AtomicBool::new(false), &|_, _| {}).unwrap(); + assert_eq!(entries.len(), 2); + let index = dir.join("test.idx"); + assert_eq!(load_index_from(&index, &path), None); + store_index_to(&index, &path, &entries).unwrap(); + assert_eq!(load_index_from(&index, &path).as_deref(), Some(&entries[..])); + let mut outside = entries.clone(); + outside[1].offset = fs::metadata(&path).unwrap().len(); + store_index_to(&index, &path, &outside).unwrap(); + assert_eq!(load_index_from(&index, &path), None); + store_index_to(&index, &path, &entries).unwrap(); + let c = coverage(&rpf, &entries); + assert_eq!((c.files, c.unpacked), (2, 25 + 12)); + assert_eq!(c.stored + c.unread, rpf.data_len()); + + let mut longer = fs::read(&path).unwrap(); + longer.extend([0u8; 16]); + fs::write(&path, longer).unwrap(); + assert_eq!(load_index_from(&index, &path), None); + fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn extracts_a_folder_and_a_single_file() { + let dir = temp("extract"); + let path = archive(&dir); + let rpf = Rpf9::open(&path).unwrap(); + rpf.set_entries(rpf.scan(&AtomicBool::new(false), &|_, _| {}).unwrap()); + let quiet = AtomicBool::new(false); + + let all = extract(&rpf, "", None, &dir.join("all"), false, &quiet, &mut |_, _| {}).unwrap(); + assert_eq!((all.files, all.failures.len()), (2, 0)); + assert_eq!(fs::read(dir.join("all/xml/000000000040.xml")).unwrap(), b""); + + let psin = extract(&rpf, "PSIN", None, &dir.join("psin"), false, &quiet, &mut |_, _| {}).unwrap(); + assert_eq!(psin.files, 1); + assert!( + fs::read_dir(dir.join("psin")) + .unwrap() + .flatten() + .all(|f| f.file_name().to_string_lossy().ends_with(".psin")) + ); + + let one = extract(&rpf, "", Some(0), &dir.join("one"), false, &quiet, &mut |_, _| {}).unwrap(); + assert_eq!(one.target, dir.join("one/000000000040.xml")); + assert!(one.target.is_file()); + fs::remove_dir_all(dir).unwrap(); + } +} diff --git a/crates/openrage-app/src/textures.rs b/crates/openrage-app/src/textures.rs index 656f007..e2b2d9d 100644 --- a/crates/openrage-app/src/textures.rs +++ b/crates/openrage-app/src/textures.rs @@ -93,6 +93,12 @@ pub fn edit_textures( Ok((result, applied.path)) } +/// The textures of a GTA VI dictionary (`.#td`). +pub fn gta6_dictionary(rpf: &rage_rpf::Rpf9, index: usize) -> Result { + let (system, graphics) = crate::rpf9::resource(rpf, index)?; + Ok(rage_formats::td6::parse(&system, &graphics)?) +} + /// The extension of a GTA V model (`ydr`, `yft`, `ydd`) named by `vpath`. pub fn gta5_model_ext(vpath: &str) -> Option<&str> { let ext = vpath.rsplit('.').next()?; diff --git a/crates/openrage-app/src/third_party_licenses.json b/crates/openrage-app/src/third_party_licenses.json index 4002005..27ab2b8 100644 --- a/crates/openrage-app/src/third_party_licenses.json +++ b/crates/openrage-app/src/third_party_licenses.json @@ -1 +1 @@ -{"crates":[{"name":"ab_glyph","version":"0.2.32","license":"Apache-2.0","repository":"https://github.com/alexheretic/ab-glyph","texts":[40]},{"name":"ab_glyph_rasterizer","version":"0.1.10","license":"Apache-2.0","repository":"https://github.com/alexheretic/ab-glyph","texts":[40]},{"name":"accesskit","version":"0.24.1","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_atspi_common","version":"0.19.1","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_consumer","version":"0.38.0","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_unix","version":"0.22.1","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_windows","version":"0.34.0","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_winit","version":"0.33.2","license":"Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"adler2","version":"2.0.1","license":"0BSD OR MIT OR Apache-2.0","repository":"https://github.com/oyvindln/adler2","texts":[0]},{"name":"aes","version":"0.8.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/block-ciphers","texts":[24]},{"name":"ahash","version":"0.8.12","license":"MIT OR Apache-2.0","repository":"https://github.com/tkaitchuck/ahash","texts":[21]},{"name":"allocator-api2","version":"0.2.21","license":"MIT OR Apache-2.0","repository":"https://github.com/zakarumych/allocator-api2","texts":[40]},{"name":"alsa","version":"0.11.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/diwic/alsa-rs","texts":[40]},{"name":"alsa-sys","version":"0.4.0","license":"MIT","repository":"https://github.com/diwic/alsa-sys","texts":[81]},{"name":"annotate-snippets","version":"0.12.17","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/annotate-snippets-rs","texts":[9]},{"name":"anstream","version":"1.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle","version":"1.0.14","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle-parse","version":"1.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle-query","version":"1.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle-wincon","version":"3.0.11","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anyhow","version":"1.0.104","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/anyhow","texts":[40]},{"name":"arbitrary","version":"1.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-fuzz/arbitrary/","texts":[21]},{"name":"arboard","version":"3.7.0","license":"MIT OR Apache-2.0","repository":"https://github.com/1Password/arboard","texts":[40]},{"name":"arrayref","version":"0.3.9","license":"BSD-2-Clause","repository":"https://github.com/droundy/arrayref","texts":[42]},{"name":"arrayvec","version":"0.7.8","license":"MIT OR Apache-2.0","repository":"https://github.com/bluss/arrayvec","texts":[21]},{"name":"as-raw-xcb-connection","version":"1.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/psychon/as-raw-xcb-connection","texts":[3]},{"name":"ash","version":"0.38.0+1.3.281","license":"MIT OR Apache-2.0","repository":"https://github.com/ash-rs/ash","texts":[34]},{"name":"ashpd","version":"0.11.1","license":"MIT","repository":"https://github.com/bilelmoussaoui/ashpd","texts":[84]},{"name":"async-broadcast","version":"0.7.2","license":"MIT OR Apache-2.0","repository":"https://github.com/smol-rs/async-broadcast","texts":[11]},{"name":"async-channel","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-channel","texts":[21]},{"name":"async-executor","version":"1.14.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-executor","texts":[21]},{"name":"async-fs","version":"2.2.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-fs","texts":[21]},{"name":"async-io","version":"2.6.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-io","texts":[21]},{"name":"async-lock","version":"3.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-lock","texts":[21]},{"name":"async-net","version":"2.0.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-net","texts":[21]},{"name":"async-process","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-process","texts":[21]},{"name":"async-recursion","version":"1.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/dcchut/async-recursion","texts":[20]},{"name":"async-signal","version":"0.2.14","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-signal","texts":[21]},{"name":"async-task","version":"4.7.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-task","texts":[21]},{"name":"async-trait","version":"0.1.92","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/async-trait","texts":[40]},{"name":"atomic-waker","version":"1.1.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/atomic-waker","texts":[21]},{"name":"atspi","version":"0.29.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/odilia-app/atspi","texts":[35]},{"name":"atspi-common","version":"0.13.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/odilia-app/atspi","texts":[35]},{"name":"atspi-proxies","version":"0.13.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/odilia-app/atspi","texts":[35]},{"name":"autocfg","version":"1.5.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/cuviper/autocfg","texts":[21]},{"name":"base64","version":"0.23.1","license":"MIT OR Apache-2.0","repository":"https://github.com/marshallpierce/rust-base64","texts":[21]},{"name":"bit-set","version":"0.10.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/contain-rs/bit-set","texts":[23]},{"name":"bit-vec","version":"0.9.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/contain-rs/bit-vec","texts":[23]},{"name":"bitflags","version":"2.13.2","license":"MIT OR Apache-2.0","repository":"https://github.com/bitflags/bitflags","texts":[21]},{"name":"block-buffer","version":"0.10.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"blocking","version":"1.7.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/blocking","texts":[21]},{"name":"bumpalo","version":"3.20.3","license":"MIT OR Apache-2.0","repository":"https://github.com/fitzgen/bumpalo","texts":[21]},{"name":"by_address","version":"1.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/mbrubeck/by_address","texts":[21]},{"name":"bytemuck","version":"1.25.2","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/bytemuck","texts":[39]},{"name":"bytemuck_derive","version":"1.12.1","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/bytemuck","texts":[39]},{"name":"byteorder","version":"1.5.0","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/byteorder","texts":[100]},{"name":"byteorder-lite","version":"0.1.0","license":"Unlicense OR MIT","repository":"https://github.com/image-rs/byteorder-lite","texts":[100]},{"name":"bytes","version":"1.12.1","license":"MIT","repository":"https://github.com/tokio-rs/bytes","texts":[61]},{"name":"calloop","version":"0.13.0","license":"MIT","repository":"https://github.com/Smithay/calloop","texts":[63]},{"name":"calloop-wayland-source","version":"0.3.0","license":"MIT","repository":"https://github.com/smithay/calloop-wayland-source","texts":[70]},{"name":"cc","version":"1.11.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/cc-rs","texts":[21]},{"name":"cfg-if","version":"1.0.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/cfg-if","texts":[21]},{"name":"cfg_aliases","version":"0.2.2","license":"MIT","repository":"https://github.com/katharostech/cfg_aliases","texts":[51,85]},{"name":"chacha20","version":"0.10.2","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/stream-ciphers","texts":[24]},{"name":"chrono","version":"0.4.45","license":"MIT OR Apache-2.0","repository":"https://github.com/chronotope/chrono","texts":[41]},{"name":"cipher","version":"0.4.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/traits","texts":[24]},{"name":"clap","version":"4.6.7","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clap_builder","version":"4.6.7","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clap_derive","version":"4.6.7","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clap_lex","version":"1.1.1","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clipboard-win","version":"5.4.3","license":"BSL-1.0","repository":"https://github.com/DoumanAsh/clipboard-win","texts":[47]},{"name":"clru","version":"0.6.3","license":"MIT","repository":"https://github.com/marmeladema/clru-rs","texts":[68]},{"name":"cobs","version":"0.3.0","license":"MIT OR Apache-2.0","repository":"https://github.com/jamesmunns/cobs.rs","texts":[10]},{"name":"codespan-reporting","version":"0.13.1","license":"Apache-2.0","repository":"https://github.com/brendanzab/codespan","texts":[8]},{"name":"color_quant","version":"1.1.0","license":"MIT","repository":"https://github.com/image-rs/color_quant.git","texts":[103]},{"name":"colorchoice","version":"1.0.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"concurrent-queue","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/concurrent-queue","texts":[21]},{"name":"const-field-offset","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"const-field-offset-macro","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"constant_time_eq","version":"0.6.1","license":"CC0-1.0 OR MIT-0 OR Apache-2.0","repository":"https://codeberg.org/cesarb/constant_time_eq","texts":[40]},{"name":"convert_case","version":"0.10.0","license":"MIT","repository":"https://github.com/rutrum/convert-case","texts":[88]},{"name":"core_detect","version":"1.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/thomcc/core_detect","texts":[20]},{"name":"countme","version":"3.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/matklad/countme","texts":[21]},{"name":"cpal","version":"0.18.2","license":"Apache-2.0","repository":"https://github.com/RustAudio/cpal","texts":[8]},{"name":"cpufeatures","version":"0.2.17","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"cpufeatures","version":"0.3.1","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"cranelift-assembler-x64","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"","texts":[40]},{"name":"cranelift-assembler-x64-meta","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"","texts":[40]},{"name":"cranelift-bforest","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-bitset","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"cranelift-codegen","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-codegen-meta","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-codegen-shared","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-control","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-entity","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-frontend","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-isle","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime/tree/main/cranelift/isle","texts":[40]},{"name":"cranelift-native","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-srcgen","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"crc32fast","version":"1.5.5","license":"MIT OR Apache-2.0","repository":"https://github.com/srijs/rust-crc32fast","texts":[10]},{"name":"critical-section","version":"1.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-embedded/critical-section","texts":[21]},{"name":"crossbeam-channel","version":"0.5.17","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crossbeam-deque","version":"0.8.8","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crossbeam-epoch","version":"0.9.21","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crossbeam-utils","version":"0.8.23","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crypto-common","version":"0.1.7","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/traits","texts":[24]},{"name":"ctor","version":"0.10.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/mmastrac/rust-ctor","texts":[38]},{"name":"cursor-icon","version":"1.2.0","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/rust-windowing/cursor-icon","texts":[2]},{"name":"dasp_sample","version":"0.11.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rustaudio/sample.git","texts":[40]},{"name":"data-url","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url","texts":[21]},{"name":"derive_more","version":"2.1.1","license":"MIT","repository":"https://github.com/JelteF/derive_more","texts":[102]},{"name":"derive_more-impl","version":"2.1.1","license":"MIT","repository":"https://github.com/JelteF/derive_more","texts":[102]},{"name":"digest","version":"0.10.7","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/traits","texts":[24]},{"name":"dirs","version":"6.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/soc/dirs-rs","texts":[40]},{"name":"dirs-sys","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/dirs-dev/dirs-sys-rs","texts":[40]},{"name":"displaydoc","version":"0.2.7","license":"MIT OR Apache-2.0","repository":"https://github.com/yaahc/displaydoc","texts":[21]},{"name":"dlib","version":"0.5.3","license":"MIT","repository":"https://github.com/elinorbgr/dlib","texts":[59]},{"name":"document-features","version":"0.2.12","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/document-features","texts":[40]},{"name":"downcast-rs","version":"1.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/marcianx/downcast-rs","texts":[23]},{"name":"dpi","version":"0.1.2","license":"Apache-2.0 AND MIT","repository":"https://github.com/rust-windowing/winit","texts":[37,89]},{"name":"either","version":"1.19.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rayon-rs/either","texts":[21]},{"name":"encoding_rs","version":"0.8.44","license":"(Apache-2.0 OR MIT) AND BSD-3-Clause","repository":"https://github.com/hsivonen/encoding_rs","texts":[3,43,45]},{"name":"endi","version":"1.1.1","license":"MIT","repository":"https://github.com/zeenix/endi","texts":[93]},{"name":"enumflags2","version":"0.7.12","license":"MIT OR Apache-2.0","repository":"https://github.com/meithecatte/enumflags2","texts":[32]},{"name":"enumflags2_derive","version":"0.7.12","license":"MIT OR Apache-2.0","repository":"https://github.com/meithecatte/enumflags2","texts":[33]},{"name":"env_filter","version":"2.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/env_logger","texts":[10]},{"name":"env_logger","version":"0.11.11","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/env_logger","texts":[10]},{"name":"equivalent","version":"1.0.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/indexmap-rs/equivalent","texts":[21]},{"name":"errno","version":"0.3.14","license":"MIT OR Apache-2.0","repository":"https://github.com/lambda-fairy/rust-errno","texts":[21]},{"name":"error-code","version":"3.4.0","license":"BSL-1.0","repository":"https://github.com/DoumanAsh/error-code","texts":[46]},{"name":"euclid","version":"0.22.14","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/euclid","texts":[21]},{"name":"event-listener","version":"5.4.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/event-listener","texts":[21]},{"name":"event-listener-strategy","version":"0.5.4","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/event-listener-strategy","texts":[21]},{"name":"fallible-iterator","version":"0.3.0","license":"MIT OR Apache-2.0","repository":"https://github.com/sfackler/rust-fallible-iterator","texts":[10]},{"name":"fallible-streaming-iterator","version":"0.1.9","license":"MIT OR Apache-2.0","repository":"https://github.com/sfackler/fallible-streaming-iterator","texts":[10]},{"name":"fastrand","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/fastrand","texts":[21]},{"name":"fdeflate","version":"0.3.7","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/fdeflate","texts":[40]},{"name":"femtovg","version":"0.27.0","license":"MIT OR Apache-2.0","repository":"https://github.com/femtovg/femtovg","texts":[40]},{"name":"field-offset","version":"0.3.6","license":"MIT OR Apache-2.0","repository":"https://github.com/Diggsey/rust-field-offset","texts":[40]},{"name":"find-msvc-tools","version":"0.1.15","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/cc-rs","texts":[21]},{"name":"fixed_decimal","version":"0.7.3","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"fixedbitset","version":"0.5.9","license":"MIT OR Apache-2.0","repository":"https://github.com/petgraph/fixedbitset","texts":[21]},{"name":"flate2","version":"1.1.11","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/flate2-rs","texts":[21]},{"name":"float-cmp","version":"0.9.0","license":"MIT","repository":"https://github.com/mikedilger/float-cmp","texts":[56]},{"name":"fnv","version":"1.0.7","license":"Apache-2.0 OR MIT","repository":"https://github.com/servo/rust-fnv","texts":[21]},{"name":"foldhash","version":"0.1.5","license":"Zlib","repository":"https://github.com/orlp/foldhash","texts":[119]},{"name":"foldhash","version":"0.2.0","license":"Zlib","repository":"https://github.com/orlp/foldhash","texts":[119]},{"name":"font-types","version":"0.12.7","license":"MIT OR Apache-2.0","repository":"https://github.com/googlefonts/fontations","texts":[31]},{"name":"fontdb","version":"0.24.0","license":"MIT","repository":"https://github.com/RazrFalcon/fontdb","texts":[106]},{"name":"fontique","version":"0.11.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"form_urlencoded","version":"1.2.2","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url","texts":[21]},{"name":"futures","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-channel","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-core","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-executor","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-io","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-lite","version":"2.6.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/futures-lite","texts":[21]},{"name":"futures-macro","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-sink","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-task","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-util","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"generic-array","version":"0.14.7","license":"MIT","repository":"https://github.com/fizyk20/generic-array.git","texts":[111]},{"name":"gethostname","version":"1.1.0","license":"Apache-2.0","repository":"https://codeberg.org/swsnr/gethostname.rs.git","texts":[21]},{"name":"getrandom","version":"0.3.4","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/getrandom","texts":[27]},{"name":"getrandom","version":"0.4.3","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/getrandom","texts":[27]},{"name":"gif","version":"0.14.2","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image-gif","texts":[20]},{"name":"gimli","version":"0.33.0","license":"MIT OR Apache-2.0","repository":"https://github.com/gimli-rs/gimli","texts":[21]},{"name":"gl_generator","version":"0.14.0","license":"Apache-2.0","repository":"https://github.com/brendanzab/gl-rs/","texts":[40]},{"name":"glow","version":"0.17.0","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/grovesNL/glow","texts":[20]},{"name":"glow","version":"0.18.0","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/grovesNL/glow","texts":[20]},{"name":"glutin","version":"0.32.3","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"glutin-winit","version":"0.5.0","license":"MIT","repository":"https://github.com/rust-windowing/glutin","texts":[77]},{"name":"glutin_egl_sys","version":"0.7.1","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"glutin_glx_sys","version":"0.6.1","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"glutin_wgl_sys","version":"0.6.1","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"gpu-allocator","version":"0.28.0","license":"MIT OR Apache-2.0","repository":"https://github.com/Traverse-Research/gpu-allocator","texts":[18]},{"name":"half","version":"2.7.1","license":"MIT OR Apache-2.0","repository":"https://github.com/VoidStarKat/half-rs","texts":[40]},{"name":"harfrust","version":"0.12.0","license":"MIT","repository":"https://github.com/harfbuzz/harfrust","texts":[108]},{"name":"hashbrown","version":"0.14.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashbrown","version":"0.15.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashbrown","version":"0.16.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashbrown","version":"0.17.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashlink","version":"0.12.2","license":"MIT OR Apache-2.0","repository":"https://github.com/djc/hashlink","texts":[22]},{"name":"heck","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/withoutboats/heck","texts":[21]},{"name":"hex","version":"0.4.3","license":"MIT OR Apache-2.0","repository":"https://github.com/KokaKiwi/rust-hex","texts":[10]},{"name":"htmlparser","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/jdrouet/htmlparser.git","texts":[21]},{"name":"i-slint-backend-selector","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-backend-winit","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-common","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-compiler","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-core","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-core-macros","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-renderer-femtovg","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"i-slint-renderer-software","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"iana-time-zone","version":"0.1.65","license":"MIT OR Apache-2.0","repository":"https://github.com/strawlab/iana-time-zone","texts":[17]},{"name":"icu_collections","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_decimal","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_decimal_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_locale_core","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_locale_fallback","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_locale_fallback_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_normalizer","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_normalizer_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_properties","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_properties_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_provider","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_segmenter","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"icu_segmenter_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"id-arena","version":"2.3.0","license":"MIT OR Apache-2.0","repository":"https://github.com/fitzgen/id-arena","texts":[21]},{"name":"idna","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url/","texts":[21]},{"name":"idna_adapter","version":"1.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/idna_adapter","texts":[21]},{"name":"image","version":"0.25.10","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image","texts":[40]},{"name":"image-webp","version":"0.2.4","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image-webp","texts":[40]},{"name":"imagesize","version":"0.15.0","license":"MIT","repository":"https://github.com/Roughsketch/imagesize","texts":[80]},{"name":"imgref","version":"1.12.3","license":"CC0-1.0 OR Apache-2.0","repository":"https://github.com/kornelski/imgref","texts":[8]},{"name":"indexmap","version":"2.14.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/indexmap-rs/indexmap","texts":[21]},{"name":"inout","version":"0.1.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"is_terminal_polyfill","version":"1.70.2","license":"MIT OR Apache-2.0","repository":"https://github.com/polyfill-rs/is_terminal_polyfill","texts":[10]},{"name":"itertools","version":"0.14.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-itertools/itertools","texts":[21]},{"name":"itertools","version":"0.15.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-itertools/itertools","texts":[21]},{"name":"itoa","version":"1.0.19","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/itoa","texts":[40]},{"name":"keyboard-types","version":"0.7.0","license":"MIT OR Apache-2.0","repository":"https://github.com/pyfisch/keyboard-types","texts":[20]},{"name":"khronos-egl","version":"6.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/timothee-haudebourg/khronos-egl","texts":[21]},{"name":"khronos_api","version":"3.1.0","license":"Apache-2.0","repository":"https://github.com/brendanzab/gl-rs/","texts":[40]},{"name":"kurbo","version":"0.13.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/kurbo","texts":[3]},{"name":"lazy_static","version":"1.5.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang-nursery/lazy-static.rs","texts":[21]},{"name":"leb128fmt","version":"0.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/bluk/leb128fmt","texts":[21]},{"name":"lewton","version":"0.10.2","license":"MIT OR Apache-2.0","repository":"https://github.com/RustAudio/lewton","texts":[40]},{"name":"libc","version":"0.2.191","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/libc","texts":[40]},{"name":"libloading","version":"0.8.9","license":"ISC","repository":"https://github.com/nagisa/rust_libloading/","texts":[49]},{"name":"libm","version":"0.2.16","license":"MIT","repository":"https://github.com/rust-lang/compiler-builtins","texts":[89]},{"name":"libsqlite3-sys","version":"0.39.1","license":"MIT","repository":"https://github.com/rusqlite/rusqlite","texts":[54]},{"name":"linebender_resource_handle","version":"0.1.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/raw_resource_handle","texts":[40]},{"name":"linux-raw-sys","version":"0.12.1","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/sunfishcode/linux-raw-sys","texts":[4,21]},{"name":"linux-raw-sys","version":"0.4.15","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/sunfishcode/linux-raw-sys","texts":[4,21]},{"name":"litemap","version":"0.8.3","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"litrs","version":"1.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/LukasKalbertodt/litrs","texts":[40]},{"name":"lock_api","version":"0.4.14","license":"MIT OR Apache-2.0","repository":"https://github.com/Amanieu/parking_lot","texts":[21]},{"name":"log","version":"0.4.35","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/log","texts":[21]},{"name":"lyon_algorithms","version":"1.0.22","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"lyon_extra","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"lyon_geom","version":"1.0.20","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"lyon_path","version":"1.0.19","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"memchr","version":"2.8.3","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/memchr","texts":[100]},{"name":"memfd","version":"0.6.6","license":"MIT OR Apache-2.0","repository":"https://github.com/lucab/memfd-rs","texts":[8]},{"name":"memmap2","version":"0.9.12","license":"MIT OR Apache-2.0","repository":"https://github.com/RazrFalcon/memmap2-rs","texts":[19]},{"name":"memoffset","version":"0.9.1","license":"MIT","repository":"https://github.com/Gilnaa/memoffset","texts":[60]},{"name":"miniz_oxide","version":"0.8.9","license":"MIT OR Zlib OR Apache-2.0","repository":"https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide","texts":[40]},{"name":"miniz_oxide","version":"0.9.1","license":"MIT OR Zlib OR Apache-2.0","repository":"https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide","texts":[40]},{"name":"mio","version":"1.2.4","license":"MIT","repository":"https://github.com/tokio-rs/mio","texts":[53]},{"name":"moxcms","version":"0.8.1","license":"BSD-3-Clause OR Apache-2.0","repository":"https://github.com/awxkee/moxcms.git","texts":[7]},{"name":"muda","version":"0.19.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/tauri-apps/muda","texts":[21]},{"name":"multiversion_no_op","version":"1.0.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/multiversion_no_op","texts":[3]},{"name":"naga","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"naga-types","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"natord","version":"1.0.9","license":"MIT","repository":"https://github.com/lifthrasiir/rust-natord","texts":[98]},{"name":"nom","version":"8.0.0","license":"MIT","repository":"https://github.com/rust-bakery/nom","texts":[55]},{"name":"num-bigint","version":"0.4.8","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-bigint","texts":[21]},{"name":"num-complex","version":"0.4.6","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-complex","texts":[21]},{"name":"num-integer","version":"0.1.47","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-integer","texts":[21]},{"name":"num-rational","version":"0.4.2","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-rational","texts":[21]},{"name":"num-traits","version":"0.2.19","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-traits","texts":[21]},{"name":"num_enum","version":"0.7.6","license":"BSD-3-Clause OR MIT OR Apache-2.0","repository":"https://github.com/illicitonion/num_enum","texts":[40]},{"name":"num_enum_derive","version":"0.7.6","license":"BSD-3-Clause OR MIT OR Apache-2.0","repository":"https://github.com/illicitonion/num_enum","texts":[40]},{"name":"object","version":"0.40.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/gimli-rs/object","texts":[21]},{"name":"once_cell","version":"1.21.4","license":"MIT OR Apache-2.0","repository":"https://github.com/matklad/once_cell","texts":[21]},{"name":"once_cell_polyfill","version":"1.70.2","license":"MIT OR Apache-2.0","repository":"https://github.com/polyfill-rs/once_cell_polyfill","texts":[10]},{"name":"oozextract","version":"0.5.7","license":"MIT","repository":"https://github.com/lvlvllvlvllvlvl/oozextract","texts":[89]},{"name":"option-ext","version":"0.2.0","license":"MPL-2.0","repository":"https://github.com/soc/option-ext.git","texts":[115]},{"name":"ordered-float","version":"5.5.1","license":"MIT","repository":"https://github.com/reem/rust-ordered-float","texts":[58]},{"name":"ordered-stream","version":"0.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/danieldg/ordered-stream","texts":[21]},{"name":"os_pipe","version":"1.2.3","license":"MIT","repository":"https://github.com/oconnor663/os_pipe.rs","texts":[110]},{"name":"owned_ttf_parser","version":"0.25.1","license":"Apache-2.0","repository":"https://github.com/alexheretic/owned-ttf-parser","texts":[40]},{"name":"parking","version":"2.2.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/parking","texts":[21]},{"name":"parking_lot","version":"0.12.5","license":"MIT OR Apache-2.0","repository":"https://github.com/Amanieu/parking_lot","texts":[21]},{"name":"parking_lot_core","version":"0.9.12","license":"MIT OR Apache-2.0","repository":"https://github.com/Amanieu/parking_lot","texts":[21]},{"name":"parlance","version":"0.1.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"parley","version":"0.11.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"parley_data","version":"0.11.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"paste","version":"1.0.15","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/paste","texts":[40]},{"name":"percent-encoding","version":"2.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url/","texts":[21]},{"name":"petgraph","version":"0.8.3","license":"MIT OR Apache-2.0","repository":"https://github.com/petgraph/petgraph","texts":[21]},{"name":"phf","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[99]},{"name":"phf_generator","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[99]},{"name":"phf_macros","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[99]},{"name":"phf_shared","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[99]},{"name":"pico-args","version":"0.5.0","license":"MIT","repository":"https://github.com/RazrFalcon/pico-args","texts":[66]},{"name":"pin-project","version":"1.1.13","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/pin-project","texts":[40]},{"name":"pin-project-internal","version":"1.1.13","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/pin-project","texts":[40]},{"name":"pin-project-lite","version":"0.2.17","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/pin-project-lite","texts":[40]},{"name":"pin-utils","version":"0.1.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/pin-utils","texts":[14]},{"name":"pin-weak","version":"1.1.0","license":"MIT","repository":"https://github.com/sixtyfpsui/pin-weak","texts":[67]},{"name":"piper","version":"0.2.5","license":"MIT OR Apache-2.0","repository":"https://github.com/smol-rs/piper","texts":[21]},{"name":"pkg-config","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/pkg-config-rs","texts":[21]},{"name":"png","version":"0.18.1","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image-png","texts":[21]},{"name":"polling","version":"3.11.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/polling","texts":[21]},{"name":"pollster","version":"0.4.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/zesterer/pollster","texts":[21]},{"name":"pollster","version":"1.0.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/zesterer/pollster","texts":[21]},{"name":"polycool","version":"0.4.0","license":"MIT OR Apache-2.0","repository":"https://github.com/linebender/kurbo","texts":[3]},{"name":"portable-atomic","version":"1.15.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/portable-atomic","texts":[40]},{"name":"postcard","version":"1.1.3","license":"MIT OR Apache-2.0","repository":"https://github.com/jamesmunns/postcard","texts":[21]},{"name":"potential_utf","version":"0.1.6","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"ppv-lite86","version":"0.2.21","license":"MIT OR Apache-2.0","repository":"https://github.com/cryptocorrosion/cryptocorrosion","texts":[15]},{"name":"presser","version":"0.3.1","license":"MIT OR Apache-2.0","repository":"https://github.com/EmbarkStudios/presser","texts":[23]},{"name":"proc-macro-crate","version":"3.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/bkchr/proc-macro-crate","texts":[28]},{"name":"proc-macro2","version":"1.0.107","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/proc-macro2","texts":[40]},{"name":"profiling","version":"1.0.18","license":"MIT OR Apache-2.0","repository":"https://github.com/aclysma/profiling","texts":[40]},{"name":"pulldown-cmark","version":"0.13.6","license":"MIT","repository":"https://github.com/raphlinus/pulldown-cmark","texts":[95]},{"name":"pulley-interpreter","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime/tree/main/pulley","texts":[40]},{"name":"pulley-macros","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime/tree/main/pulley/macros","texts":[40]},{"name":"pxfm","version":"0.1.30","license":"BSD-3-Clause OR Apache-2.0","repository":"https://github.com/awxkee/pxfm","texts":[7]},{"name":"quick-error","version":"2.0.1","license":"MIT OR Apache-2.0","repository":"http://github.com/tailhook/quick-error","texts":[10]},{"name":"quick-xml","version":"0.41.0","license":"MIT","repository":"https://github.com/tafia/quick-xml","texts":[112]},{"name":"quote","version":"1.0.47","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/quote","texts":[40]},{"name":"rand","version":"0.10.3","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[40]},{"name":"rand","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[40]},{"name":"rand_chacha","version":"0.9.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[40]},{"name":"rand_core","version":"0.10.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand_core","texts":[26]},{"name":"rand_core","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[26]},{"name":"range-alloc","version":"0.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/range-alloc","texts":[40]},{"name":"raw-window-handle","version":"0.6.2","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/rust-windowing/raw-window-handle","texts":[40]},{"name":"rayon","version":"1.12.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rayon-rs/rayon","texts":[21]},{"name":"rayon-core","version":"1.13.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rayon-rs/rayon","texts":[21]},{"name":"read-fonts","version":"0.41.0","license":"MIT OR Apache-2.0","repository":"https://github.com/googlefonts/fontations","texts":[31]},{"name":"regalloc2","version":"0.15.2","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/regalloc2","texts":[4]},{"name":"regex-lite","version":"0.1.9","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/regex","texts":[21]},{"name":"renderdoc-sys","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/ebkalderon/renderdoc-rs","texts":[21]},{"name":"resvg","version":"0.48.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/resvg","texts":[40]},{"name":"rfd","version":"0.15.4","license":"MIT","repository":"https://github.com/PolyMeilex/rfd","texts":[87]},{"name":"rgb","version":"0.8.53","license":"MIT","repository":"https://github.com/kornelski/rust-rgb","texts":[82]},{"name":"rodio","version":"0.23.0","license":"MIT OR Apache-2.0","repository":"https://github.com/RustAudio/rodio","texts":[40]},{"name":"rowan","version":"0.17.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-analyzer/rowan","texts":[21]},{"name":"roxmltree","version":"0.21.2","license":"MIT OR Apache-2.0","repository":"https://github.com/RazrFalcon/roxmltree","texts":[21]},{"name":"rspolib","version":"0.1.2","license":"MIT","repository":"https://github.com/mondeja/rspolib","texts":[89]},{"name":"rusqlite","version":"0.41.1","license":"MIT","repository":"https://github.com/rusqlite/rusqlite","texts":[54]},{"name":"rustc-hash","version":"1.1.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/rust-lang-nursery/rustc-hash","texts":[21]},{"name":"rustc-hash","version":"2.1.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/rust-lang/rustc-hash","texts":[40]},{"name":"rustc_version","version":"0.4.1","license":"MIT OR Apache-2.0","repository":"https://github.com/djc/rustc-version-rs","texts":[21]},{"name":"rustix","version":"0.38.44","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/rustix","texts":[4,21]},{"name":"rustix","version":"1.1.6","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/rustix","texts":[4,21]},{"name":"rustix-linux-procfs","version":"0.1.1","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/sunfishcode/rustix-linux-procfs","texts":[4,21]},{"name":"rustversion","version":"1.0.23","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/rustversion","texts":[40]},{"name":"safe_arch","version":"0.7.4","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/safe_arch","texts":[39]},{"name":"scoped-tls","version":"1.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/alexcrichton/scoped-tls","texts":[21]},{"name":"scoped-tls-hkt","version":"0.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/Diggsey/scoped-tls-hkt","texts":[21]},{"name":"scopeguard","version":"1.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/bluss/scopeguard","texts":[21]},{"name":"sctk-adwaita","version":"0.10.1","license":"MIT","repository":"https://github.com/PolyMeilex/sctk-adwaita","texts":[87]},{"name":"semver","version":"1.0.28","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/semver","texts":[40]},{"name":"serde","version":"1.0.229","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/serde","texts":[40]},{"name":"serde_core","version":"1.0.229","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/serde","texts":[40]},{"name":"serde_derive","version":"1.0.229","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/serde","texts":[40]},{"name":"serde_json","version":"1.0.154","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/json","texts":[40]},{"name":"serde_repr","version":"0.1.21","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/serde-repr","texts":[40]},{"name":"serde_spanned","version":"1.1.3","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"sha1","version":"0.10.7","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/hashes","texts":[24]},{"name":"sha2","version":"0.10.9","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/hashes","texts":[24]},{"name":"shlex","version":"2.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/comex/rust-shlex","texts":[40]},{"name":"signal-hook-registry","version":"1.4.8","license":"MIT OR Apache-2.0","repository":"https://github.com/vorner/signal-hook","texts":[21]},{"name":"simd-adler32","version":"0.3.10","license":"MIT","repository":"https://github.com/mcountryman/simd-adler32","texts":[91]},{"name":"simdutf8","version":"0.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rusticstuff/simdutf8","texts":[40]},{"name":"simplecss","version":"0.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/simplecss","texts":[21]},{"name":"siphasher","version":"1.0.4","license":"MIT OR Apache-2.0","repository":"https://github.com/jedisct1/rust-siphash","texts":[3]},{"name":"skrifa","version":"0.44.0","license":"MIT OR Apache-2.0","repository":"https://github.com/googlefonts/fontations","texts":[31]},{"name":"slab","version":"0.4.12","license":"MIT","repository":"https://github.com/tokio-rs/slab","texts":[64]},{"name":"slint","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"slint-build","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"slint-macros","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[48]},{"name":"slotmap","version":"1.1.1","license":"Zlib","repository":"https://github.com/orlp/slotmap","texts":[118]},{"name":"smallvec","version":"1.16.5","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-smallvec","texts":[21]},{"name":"smithay-client-toolkit","version":"0.19.2","license":"MIT","repository":"https://github.com/smithay/client-toolkit","texts":[62]},{"name":"smol_str","version":"0.2.2","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-analyzer/smol_str","texts":[21]},{"name":"smol_str","version":"0.3.7","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/rust-analyzer/tree/master/lib/smol_str","texts":[21]},{"name":"snafu","version":"0.8.9","license":"MIT OR Apache-2.0","repository":"https://github.com/shepmaster/snafu","texts":[16]},{"name":"snafu-derive","version":"0.8.9","license":"MIT OR Apache-2.0","repository":"https://github.com/shepmaster/snafu","texts":[16]},{"name":"socket2","version":"0.6.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/socket2","texts":[21]},{"name":"softbuffer","version":"0.4.8","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-windowing/softbuffer","texts":[36]},{"name":"spin_on","version":"0.1.1","license":"Apache-2.0 OR MIT","repository":"","texts":[21]},{"name":"spirv","version":"0.4.0+sdk-1.4.341.0","license":"Apache-2.0","repository":"https://github.com/gfx-rs/rspirv","texts":[40]},{"name":"stable_deref_trait","version":"1.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/storyyeller/stable_deref_trait","texts":[21]},{"name":"static_assertions","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/nvzqz/static-assertions-rs","texts":[3]},{"name":"strict-num","version":"0.1.1","license":"MIT","repository":"https://github.com/RazrFalcon/strict-num","texts":[69]},{"name":"strsim","version":"0.11.1","license":"MIT","repository":"https://github.com/rapidfuzz/strsim-rs","texts":[101]},{"name":"strum","version":"0.28.0","license":"MIT","repository":"https://github.com/Peternator7/strum","texts":[83]},{"name":"strum_macros","version":"0.28.0","license":"MIT","repository":"https://github.com/Peternator7/strum","texts":[83]},{"name":"svgtypes","version":"0.16.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/svgtypes","texts":[21]},{"name":"swash","version":"0.2.10","license":"Apache-2.0 OR MIT","repository":"https://github.com/dfrg/swash","texts":[21]},{"name":"symphonia","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[114]},{"name":"symphonia-bundle-mp3","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[114]},{"name":"symphonia-core","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[114]},{"name":"symphonia-metadata","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[114]},{"name":"syn","version":"2.0.119","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/syn","texts":[40]},{"name":"syn","version":"3.0.10","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/syn","texts":[40]},{"name":"synstructure","version":"0.14.0","license":"MIT","repository":"https://github.com/mystor/synstructure","texts":[75]},{"name":"sys-locale","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/1Password/sys-locale","texts":[8]},{"name":"taffy","version":"0.10.1","license":"MIT","repository":"https://github.com/DioxusLabs/taffy","texts":[89]},{"name":"target-lexicon","version":"0.13.5","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/target-lexicon","texts":[4]},{"name":"tempfile","version":"3.27.0","license":"MIT OR Apache-2.0","repository":"https://github.com/Stebalien/tempfile","texts":[21]},{"name":"termcolor","version":"1.4.1","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/termcolor","texts":[100]},{"name":"test-log","version":"0.2.21","license":"Apache-2.0 OR MIT","repository":"https://github.com/d-e-s-o/test-log.git","texts":[27]},{"name":"test-log-core","version":"0.2.21","license":"Apache-2.0 OR MIT","repository":"https://github.com/d-e-s-o/test-log.git","texts":[27]},{"name":"test-log-macros","version":"0.2.21","license":"Apache-2.0 OR MIT","repository":"https://github.com/d-e-s-o/test-log.git","texts":[27]},{"name":"texpresso","version":"2.0.2","license":"MIT","repository":"https://github.com/jansol/texpresso","texts":[52,78]},{"name":"text-size","version":"1.1.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-analyzer/text-size","texts":[21]},{"name":"texture2ddecoder","version":"0.1.2","license":"MIT OR Apache-2.0","repository":"https://github.com/UniversalGameExtraction/texture2ddecoder","texts":[40]},{"name":"thiserror","version":"1.0.69","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"thiserror","version":"2.0.21","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"thiserror-impl","version":"1.0.69","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"thiserror-impl","version":"2.0.21","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"tiny-skia","version":"0.11.4","license":"BSD-3-Clause","repository":"https://github.com/RazrFalcon/tiny-skia","texts":[44]},{"name":"tiny-skia","version":"0.12.0","license":"BSD-3-Clause","repository":"https://github.com/linebender/tiny-skia","texts":[44]},{"name":"tiny-skia-path","version":"0.11.4","license":"BSD-3-Clause","repository":"https://github.com/RazrFalcon/tiny-skia/tree/master/path","texts":[44]},{"name":"tiny-skia-path","version":"0.12.0","license":"BSD-3-Clause","repository":"https://github.com/linebender/tiny-skia/tree/master/path","texts":[44]},{"name":"tiny-xlib","version":"0.2.5","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/rust-windowing/tiny-xlib","texts":[40]},{"name":"tinystr","version":"0.8.5","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"tinyvec","version":"1.13.3","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/tinyvec","texts":[3]},{"name":"tokio","version":"1.54.1","license":"MIT","repository":"https://github.com/tokio-rs/tokio","texts":[90]},{"name":"toml","version":"1.2.1+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_datetime","version":"1.1.3+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_edit","version":"0.25.19+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_parser","version":"1.1.5+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_writer","version":"1.2.0+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"tracing","version":"0.1.44","license":"MIT","repository":"https://github.com/tokio-rs/tracing","texts":[65]},{"name":"tracing-attributes","version":"0.1.31","license":"MIT","repository":"https://github.com/tokio-rs/tracing","texts":[65]},{"name":"tracing-core","version":"0.1.36","license":"MIT","repository":"https://github.com/tokio-rs/tracing","texts":[65,96]},{"name":"tree_magic_mini","version":"3.2.2","license":"MIT","repository":"https://github.com/mbrubeck/tree_magic/","texts":[79]},{"name":"ttf-parser","version":"0.25.1","license":"MIT OR Apache-2.0","repository":"https://github.com/harfbuzz/ttf-parser","texts":[21]},{"name":"typed-index-collections","version":"3.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/zheland/typed-index-collections","texts":[40]},{"name":"typed-path","version":"0.13.0","license":"MIT OR Apache-2.0","repository":"https://github.com/chipsenkbeil/typed-path","texts":[40]},{"name":"typenum","version":"1.20.1","license":"MIT OR Apache-2.0","repository":"https://github.com/paholg/typenum","texts":[13]},{"name":"uds_windows","version":"1.2.1","license":"MIT","repository":"https://github.com/haraldh/rust_uds_windows","texts":[50]},{"name":"unicase","version":"2.10.0","license":"MIT OR Apache-2.0","repository":"https://github.com/seanmonstar/unicase","texts":[21]},{"name":"unicode-bidi","version":"0.3.18","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/unicode-bidi","texts":[21]},{"name":"unicode-ident","version":"1.0.27","license":"(MIT OR Apache-2.0) AND Unicode-3.0","repository":"https://github.com/dtolnay/unicode-ident","texts":[40,116]},{"name":"unicode-linebreak","version":"0.1.5","license":"Apache-2.0","repository":"https://github.com/axelf4/unicode-linebreak","texts":[8]},{"name":"unicode-script","version":"0.5.9","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-script","texts":[29]},{"name":"unicode-segmentation","version":"1.13.3","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-segmentation","texts":[21]},{"name":"unicode-vo","version":"0.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/RazrFalcon/unicode-vo","texts":[21]},{"name":"unicode-width","version":"0.2.3","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-width","texts":[21]},{"name":"unicode-xid","version":"0.2.6","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-xid","texts":[21]},{"name":"url","version":"2.5.8","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url","texts":[21]},{"name":"urlencoding","version":"2.1.3","license":"MIT","repository":"https://github.com/kornelski/rust_urlencoding","texts":[113]},{"name":"usvg","version":"0.48.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/resvg","texts":[40]},{"name":"utf8_iter","version":"1.1.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/utf8_iter","texts":[3]},{"name":"utf8parse","version":"0.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/alacritty/vte","texts":[40]},{"name":"utf_types","version":"1.0.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/utf_types","texts":[3]},{"name":"uuid","version":"1.29.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/uuid-rs/uuid","texts":[21]},{"name":"vcpkg","version":"0.2.15","license":"MIT OR Apache-2.0","repository":"https://github.com/mcgoo/vcpkg-rs","texts":[30]},{"name":"version_check","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/SergioBenitez/version_check","texts":[21]},{"name":"vtable","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"vtable-macro","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"wasm-encoder","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-encoder","texts":[4,21]},{"name":"wasm-metadata","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-metadata","texts":[4,21]},{"name":"wasmparser","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser","texts":[4,21]},{"name":"wasmprinter","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmprinter","texts":[4,21]},{"name":"wasmtime","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-environ","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-component-macro","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-component-util","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-core","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"","texts":[40]},{"name":"wasmtime-internal-cranelift","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-fiber","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-jit-icache-coherence","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-unwinder","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-versioned-export-macros","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-wit-bindgen","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-wasi","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-wasi-io","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wayland-backend","version":"0.3.17","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57]},{"name":"wayland-client","version":"0.31.15","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57]},{"name":"wayland-csd-frame","version":"0.3.0","license":"MIT","repository":"https://github.com/rust-windowing/wayland-csd-frame","texts":[71]},{"name":"wayland-cursor","version":"0.31.14","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57]},{"name":"wayland-protocols","version":"0.32.13","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57,76]},{"name":"wayland-protocols-plasma","version":"0.3.12","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57,92]},{"name":"wayland-protocols-wlr","version":"0.3.12","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57]},{"name":"wayland-scanner","version":"0.31.11","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57]},{"name":"wayland-sys","version":"0.31.11","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[57]},{"name":"webbrowser","version":"1.2.6","license":"MIT OR Apache-2.0","repository":"https://github.com/amodm/webbrowser-rs","texts":[25]},{"name":"weezl","version":"0.1.12","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/weezl","texts":[20]},{"name":"wgpu","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-core","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-core-deps-windows-linux-android","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-hal","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-naga-bridge","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-types","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wide","version":"0.7.33","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/wide","texts":[40]},{"name":"winapi-util","version":"0.1.11","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/winapi-util","texts":[104]},{"name":"windows","version":"0.62.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-collections","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-core","version":"0.62.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-future","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-implement","version":"0.60.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-interface","version":"0.59.3","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-link","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-numerics","version":"0.3.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-result","version":"0.4.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-strings","version":"0.5.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-sys","version":"0.52.0","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-sys","version":"0.59.0","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-sys","version":"0.61.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-targets","version":"0.52.6","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-threading","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows_x86_64_gnu","version":"0.52.6","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows_x86_64_msvc","version":"0.52.6","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"winit","version":"0.30.13","license":"Apache-2.0","repository":"https://github.com/rust-windowing/winit","texts":[37]},{"name":"winnow","version":"1.0.5","license":"MIT","repository":"https://github.com/winnow-rs/winnow","texts":[94]},{"name":"winresource","version":"0.1.34","license":"MIT","repository":"https://github.com/BenjaminRi/winresource","texts":[74]},{"name":"wit-component","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-component","texts":[4,21]},{"name":"wit-parser","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-parser","texts":[4,21]},{"name":"wl-clipboard-rs","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/YaLTeR/wl-clipboard-rs","texts":[21]},{"name":"writeable","version":"0.6.4","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"x11-dl","version":"2.21.0","license":"MIT","repository":"https://github.com/AltF02/x11-rs.git","texts":[93]},{"name":"x11rb","version":"0.13.2","license":"MIT OR Apache-2.0","repository":"https://github.com/psychon/x11rb","texts":[3]},{"name":"x11rb-protocol","version":"0.13.2","license":"MIT OR Apache-2.0","repository":"https://github.com/psychon/x11rb","texts":[3]},{"name":"xcursor","version":"0.3.11","license":"MIT","repository":"https://github.com/esposm03/xcursor-rs","texts":[86]},{"name":"xkbcommon-dl","version":"0.4.2","license":"MIT","repository":"https://github.com/rust-windowing/xkbcommon-dl","texts":[107]},{"name":"xkeysym","version":"0.2.1","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/notgull/xkeysym","texts":[1]},{"name":"xml-rs","version":"0.8.29","license":"MIT","repository":"https://github.com/kornelski/xml-rs","texts":[97]},{"name":"xmlwriter","version":"0.1.0","license":"MIT","repository":"https://github.com/RazrFalcon/xmlwriter","texts":[105]},{"name":"yazi","version":"0.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/dfrg/yazi","texts":[21]},{"name":"yeslogic-fontconfig-sys","version":"6.0.1","license":"MIT","repository":"https://github.com/yeslogic/fontconfig-rs","texts":[109]},{"name":"yoke","version":"0.8.4","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"yoke-derive","version":"0.8.4","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"zbus","version":"5.19.0","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[72]},{"name":"zbus-lockstep","version":"0.5.2","license":"MIT","repository":"https://github.com/luukvanderduim/zbus-lockstep","texts":[93]},{"name":"zbus-lockstep-macros","version":"0.5.2","license":"MIT","repository":"https://github.com/luukvanderduim/zbus-lockstep","texts":[93]},{"name":"zbus_macros","version":"5.19.0","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[72]},{"name":"zbus_names","version":"4.3.5","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[72]},{"name":"zbus_xml","version":"5.2.1","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[72]},{"name":"zcheapstr","version":"1.2.0","license":"MIT","repository":"https://github.com/z-galaxy/zcheapstr/","texts":[73]},{"name":"zeno","version":"0.3.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/dfrg/zeno","texts":[21]},{"name":"zerocopy","version":"0.8.63","license":"BSD-2-Clause OR Apache-2.0 OR MIT","repository":"https://github.com/google/zerocopy","texts":[6]},{"name":"zerocopy-derive","version":"0.8.63","license":"BSD-2-Clause OR Apache-2.0 OR MIT","repository":"https://github.com/google/zerocopy","texts":[6]},{"name":"zerofrom","version":"0.1.8","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"zerofrom-derive","version":"0.1.8","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"zeroize","version":"1.9.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/RustCrypto/utils","texts":[3]},{"name":"zeroize_derive","version":"1.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/RustCrypto/utils","texts":[3]},{"name":"zerotrie","version":"0.2.5","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"zerovec","version":"0.11.9","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"zerovec-derive","version":"0.11.7","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[117]},{"name":"zip","version":"9.5.0","license":"MIT","repository":"https://github.com/zip-rs/zip2","texts":[96]},{"name":"zmij","version":"1.0.23","license":"MIT","repository":"https://github.com/dtolnay/zmij","texts":[93]},{"name":"zune-core","version":"0.5.3","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/etemesi254/zune-image","texts":[8]},{"name":"zune-jpeg","version":"0.5.15","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/etemesi254/zune-image/tree/dev/crates/zune-jpeg","texts":[8]},{"name":"zvariant","version":"5.15.1","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[72]},{"name":"zvariant_derive","version":"5.15.1","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[72]},{"name":"zvariant_utils","version":"4.2.0","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[93]}],"licenses":[{"id":"0BSD","name":"BSD Zero Clause License","text":"Copyright (C) Jonas Schievink \n\nPermission to use, copy, modify, and/or distribute this software for\nany purpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN\nAN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\nOF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2022-2023 John Nunley\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2023 Kirill Chibisov\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n--- LLVM Exceptions to the Apache 2.0 License ----\n\nAs an exception, if, as a result of your compiling your source code, portions\nof this Software are embedded into an Object form of such source code, you\nmay redistribute such embedded portions in such Object form without complying\nwith the conditions of Sections 4(a), 4(b) and 4(d) of the License.\n\nIn addition, if you combine or link compiled forms of this Software with\nsoftware that is licensed under the GPLv2 (\"Combined Software\") and if a\ncourt of competent jurisdiction determines that the patent provision (Section\n3), the indemnity provision (Section 9) or other Section of the License\nconflicts with the conditions of the GPLv2, you may retroactively and\nprospectively choose to deem waived or otherwise exclude such Section(s) of\nthe License, but only in their entirety and only with respect to the Combined\nSoftware.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright (c) Microsoft Corporation.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2023 The Fuchsia Authors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2024 Radzivon Bartoshyk\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright Individual contributors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright {yyyy} {name of copyright owner}\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n Copyright 2020 Yoshua Wuyts\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright (c) 2016 Alex Crichton\nCopyright (c) 2017 The Tokio Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2014 Paho Lurie-Gregg\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2018 The pin-utils authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2019 The CryptoCorrosion Contributors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2019- Jake Goulding\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2020 Andrew Straw\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2021 Traverse Research B.V.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [2015] [Dan Burkert]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nCopyright (c) 2015-2022 Amod Malviya\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n https://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n https://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n https://www.apache.org/licenses/LICENSE-2.0\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2021 The Unicode-rs Developers\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nCopyright 2019 Fontations Developers\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\n\nCopyright 2017-2023 Maik Klein, Maja Kądziołka\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\n\nCopyright [2017] [Maik Klein]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nCopyright 2016 Maik Klein\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2022 Kirill Chibisov\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright {yyyy} {name of copyright owner}\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright {yyyy} {name of copyright owner}\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Rust-chrono is dual-licensed under The MIT License [1] and\nApache 2.0 License [2]. Copyright (c) 2014--2026, Kang Seonghoon and\ncontributors.\n\nNota Bene: This is same as the Rust Project's own license.\n\n\n[1]: , which is reproduced below:\n\n~~~~\nThe MIT License (MIT)\n\nCopyright (c) 2014, Kang Seonghoon.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n~~~~\n\n\n[2]: , which is reproduced below:\n\n~~~~\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n~~~~\n\n"},{"id":"BSD-2-Clause","name":"BSD 2-Clause \"Simplified\" License","text":"Copyright (c) 2015 David Roundy \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the\n distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"// Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice, this\n// list of conditions and the following disclaimer.\n//\n// 2. Redistributions in binary form must reproduce the above copyright notice,\n// this list of conditions and the following disclaimer in the documentation\n// and/or other materials provided with the distribution.\n//\n// 3. Neither the name of the copyright holder nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/// The PUA code points special-cased in the GB18030 encoder.\npub(crate) static GB18030_2022_OVERRIDE_PUA: [u16; 18] = [\n 0xE78D, 0xE78E, 0xE78F, 0xE790, 0xE791, 0xE792, 0xE793, 0xE794, 0xE795, 0xE796, 0xE81E, 0xE826,\n 0xE82B, 0xE82C, 0xE832, 0xE843, 0xE854, 0xE864,\n];\n\n/// The bytes corresponding to the PUA code points special-cased in the GB18030 encoder.\npub(crate) static GB18030_2022_OVERRIDE_BYTES: [[u8; 2]; 18] = [\n [0xA6, 0xD9],\n [0xA6, 0xDA],\n [0xA6, 0xDB],\n [0xA6, 0xDC],\n [0xA6, 0xDD],\n [0xA6, 0xDE],\n [0xA6, 0xDF],\n [0xA6, 0xEC],\n [0xA6, 0xED],\n [0xA6, 0xF3],\n [0xFE, 0x59],\n [0xFE, 0x61],\n [0xFE, 0x66],\n [0xFE, 0x67],\n [0xFE, 0x6D],\n [0xFE, 0x7E],\n [0xFE, 0x90],\n [0xFE, 0xA0],\n];\n"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"Copyright (c) 2011 Google Inc. All rights reserved.\nCopyright (c) 2020 Yevhenii Reizner All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived\n from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"},{"id":"BSL-1.0","name":"Boost Software License 1.0","text":"Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization\nobtaining a copy of the software and accompanying documentation covered by\nthis license (the \"Software\") to use, reproduce, display, distribute,\nexecute, and transmit the Software, and to prepare derivative works of the\nSoftware, and to permit third-parties to whom the Software is furnished to\ndo so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including\nthe above license grant, this restriction and the following disclaimer,\nmust be included in all copies of the Software, in whole or in part, and\nall derivative works of the Software, unless such copies or derivative\nworks are solely in the form of machine-executable object code generated by\na source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\nSHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\nFOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"BSL-1.0","name":"Boost Software License 1.0","text":"Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the \"Software\") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"GPL-3.0-only","name":"GNU General Public License v3.0 only","text":"GNU GENERAL PUBLIC LICENSE\nVersion 3, 29 June 2007\n\nCopyright © 2007 Free Software Foundation, Inc. \n\nEveryone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\n\nPreamble\n\nThe GNU General Public License is a free, copyleft license for software and other kinds of works.\n\nThe licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\n\nWhen we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\n\nTo protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\n\nFor example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\n\nDevelopers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\n\nFor the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\n\nSome devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\n\nFinally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\n\nThe precise terms and conditions for copying, distribution and modification follow.\n\nTERMS AND CONDITIONS\n\n0. Definitions.\n\n“This License” refers to version 3 of the GNU General Public License.\n\n“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\n\n“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.\n\nTo “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.\n\nA “covered work” means either the unmodified Program or a work based on the Program.\n\nTo “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\n\nTo “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\n\nAn interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\n\n1. Source Code.\nThe “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.\n\nA “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\n\nThe “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\n\nThe “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\n\nThe Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\n\nThe Corresponding Source for a work in source code form is that same work.\n\n2. Basic Permissions.\nAll rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\n\nYou may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\n\nConveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\n\n3. Protecting Users' Legal Rights From Anti-Circumvention Law.\nNo covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\n\nWhen you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\n\n4. Conveying Verbatim Copies.\nYou may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\n\nYou may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\n\n5. Conveying Modified Source Versions.\nYou may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.\n\n c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\n\nA compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\n\n6. Conveying Non-Source Forms.\nYou may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\n\n d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\n\nA separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\n\nA “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\n\n“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\n\nIf you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\n\nThe requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\n\nCorresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\n\n7. Additional Terms.\n“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\n\nWhen you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\n\nNotwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\n\nAll other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\n\nIf you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\n\nAdditional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\n\n8. Termination.\nYou may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\n\nHowever, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\n\nMoreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\n\nTermination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\n\n9. Acceptance Not Required for Having Copies.\nYou are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\n\n10. Automatic Licensing of Downstream Recipients.\nEach time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\n\nAn “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\n\nYou may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\n\n11. Patents.\nA “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.\n\nA contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\n\nEach contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\n\nIn the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\n\nIf you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\n\nIf, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\n\nA patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\n\nNothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\n\n12. No Surrender of Others' Freedom.\nIf conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\n\n13. Use with the GNU Affero General Public License.\nNotwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\n\n14. Revised Versions of this License.\nThe Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\n\nIf the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\n\nLater license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\n\n15. Disclaimer of Warranty.\nTHERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n16. Limitation of Liability.\nIN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\n17. Interpretation of Sections 15 and 16.\nIf the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\n\nEND OF TERMS AND CONDITIONS\n\nHow to Apply These Terms to Your New Programs\n\nIf you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\n\nTo do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.\n\n \n Copyright (C) \n\n This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\n\n Copyright (C) \n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.\n\nYou should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .\n\nThe GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .\n"},{"id":"ISC","name":"ISC License","text":"Copyright © 2015, Simonas Kazlauskas\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without\nfee is hereby granted, provided that the above copyright notice and this permission notice appear\nin all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS\nSOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\nAUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\nNEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":" MIT License\n\n Copyright (c) Microsoft Corporation. All rights reserved.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE\n"},{"id":"MIT","name":"MIT License","text":"# 3rd Party Notices\n\nThe `cfg_aliases!` macro uses a lot of the code from [`tectonic_cfg_support::target_cfg!`] macro which is under the following license:\n\n[`tectonic_cfg_support::target_cfg!`]: https://github.com/tectonic-typesetting/tectonic/blob/f2439b936470ad27bdf92882064bc4702ee01899/cfg_support/src/lib.rs#L166\n\n tectonic_cfg_support is licensed under the MIT License.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the “Software”), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n---\n"},{"id":"MIT","name":"MIT License","text":"// Copyright (c) 2006 Simon Brown \n// Copyright (c) 2018-2021 Jan Solanti \n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to\tdeal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmod cluster;\nmod range;\nmod single;\nmod single_lut;\n\npub use self::cluster::ClusterFit;\npub use self::range::RangeFit;\npub use self::single::SingleColourFit;\n\npub trait ColourFit<'a> {\n fn compress(&'a mut self, block: &mut [u8]);\n}\n\npub trait ColourFitImpl<'a> {\n fn is_bc1(&self) -> bool;\n fn is_transparent(&self) -> bool;\n fn compress3(&mut self);\n fn compress4(&mut self);\n fn best_compressed(&'a self) -> &'a [u8];\n}\n\nimpl<'a, T> ColourFit<'a> for T\nwhere\n T: ColourFitImpl<'a>,\n{\n fn compress(&'a mut self, block: &mut [u8]) {\n if self.is_bc1() {\n self.compress3();\n if !self.is_transparent() {\n self.compress4();\n }\n } else {\n self.compress4();\n }\n\n block.copy_from_slice(self.best_compressed());\n }\n}\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014 Carl Lerche and other MIO contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014 The rusqlite developers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014-2019 Geoffroy Couprie\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014-2020 Optimal Computing (NZ) Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2015 Elinor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2015 Jonathan Reem\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2015 Victor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2017 Gilad Naaman\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2018 Carl Lerche\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2018 Victor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2018 Victor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2019 Carl Lerche\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2019 Tokio Contributors\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2019 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2020 Olivier Goffart \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2020 Élie ROUDNINSKI (marmeladema) \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2022 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2023 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2023 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2026 Zeeshan Ali Khan & zcheapstr contributors\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright 2016 Max Resch\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright 2016 Nika Layzell\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright © 2008-2013 Kristian Høgsberg\nCopyright © 2010-2013 Intel Corporation\nCopyright © 2013 Rafael Antognolli\nCopyright © 2013 Jasper St. Pierre\nCopyright © 2014 Jonas Ådahl\nCopyright © 2014 Jason Ekstrand\nCopyright © 2014-2015 Collabora, Ltd.\nCopyright © 2015 Red Hat Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice (including the next\nparagraph) shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n\n---\n\nThe above is the version of the MIT \"Expat\" License used by X.org:\n\n http://cgit.freedesktop.org/xorg/xserver/tree/COPYING\n"},{"id":"MIT","name":"MIT License","text":"Copyright © 2022 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2006 Simon Brown \nCopyright (c) 2018-2021 Jan Solanti \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2017 Aaron Hancock\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2017 Maiddog\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2018 diwic\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2019 Kornel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2019 Peter Glotfelty\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2020 Bilal Elmoussaoui\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2020 Katharos Technology\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2020 Samuele Esposito\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2022 Bartłomiej Maryńczak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2025 rutrum\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) \n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the \"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial\nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\nLIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO\nEVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) Tokio Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) [2021] [Marvin Countryman]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License Copyright (c) \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice (including the next\nparagraph) shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\nOR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF\nOR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Permission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License\n\nCopyright 2015 Google Inc. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014 Mathijs van de Nes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014 Vladimir Matveev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014, Kang Seonghoon.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014-2022 Steven Fackler, Yuki Okushi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2015 Andrew Gallant\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2015 Danny Guo\nCopyright (c) 2016 Titus Wormer \nCopyright (c) 2018 Akash Kurdekar\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2016 Jelte Fennema\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2016 PistonDevelopers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2017 Andrew Gallant\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2019 Reizner Evgeniy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2020 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2023 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) HarfBuzz developers\nCopyright (c) 2020 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright 2019 YesLogic Pty. Ltd.\nCopyright 2016 Manuel Reinhardt\nCopyright 2014 Austin Bonander\nCopyright 2013 The Servo Project Developers.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2015 Bartłomiej Kamiński\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2016 Johann Tuffe\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"© 2016 Bertram Truong\n© 2021 Kornel Lesiński\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MPL-2.0","name":"Mozilla Public License 2.0","text":"Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n means\n\n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n\n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n\n1.6. \"Executable Form\"\n means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n means a work that combines Covered Software with other material, in \n a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n means this document.\n\n1.9. \"Licensable\"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n means any of the following:\n\n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n\n (b) any new file in Source Code Form that contains any Covered\n Software.\n\n1.11. \"Patent Claims\" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n\n1.12. \"Secondary License\"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n\n1.13. \"Source Code Form\"\n means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, \"You\" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, \"control\" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n or\n\n(b) for infringements caused by: (i) Your and any other third party's\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n* *\n* 6. Disclaimer of Warranty *\n* ------------------------- *\n* *\n* Covered Software is provided under this License on an \"as is\" *\n* basis, without warranty of any kind, either expressed, implied, or *\n* statutory, including, without limitation, warranties that the *\n* Covered Software is free of defects, merchantable, fit for a *\n* particular purpose or non-infringing. The entire risk as to the *\n* quality and performance of the Covered Software is with You. *\n* Should any Covered Software prove defective in any respect, You *\n* (not any Contributor) assume the cost of any necessary servicing, *\n* repair, or correction. This disclaimer of warranty constitutes an *\n* essential part of this License. No use of any Covered Software is *\n* authorized under this License except under this disclaimer. *\n* *\n************************************************************************\n\n************************************************************************\n* *\n* 7. Limitation of Liability *\n* -------------------------- *\n* *\n* Under no circumstances and under no legal theory, whether tort *\n* (including negligence), contract, or otherwise, shall any *\n* Contributor, or anyone who distributes Covered Software as *\n* permitted above, be liable to You for any direct, indirect, *\n* special, incidental, or consequential damages of any character *\n* including, without limitation, damages for lost profits, loss of *\n* goodwill, work stoppage, computer failure or malfunction, or any *\n* and all other commercial damages or losses, even if such party *\n* shall have been informed of the possibility of such damages. This *\n* limitation of liability shall not apply to liability for death or *\n* personal injury resulting from such party's negligence to the *\n* extent applicable law prohibits such limitation. Some *\n* jurisdictions do not allow the exclusion or limitation of *\n* incidental or consequential damages, so this exclusion and *\n* limitation may not apply to You. *\n* *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n This Source Code Form is \"Incompatible With Secondary Licenses\", as\n defined by the Mozilla Public License, v. 2.0."},{"id":"MPL-2.0","name":"Mozilla Public License 2.0","text":"Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n means\n\n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n\n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n\n1.6. \"Executable Form\"\n means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n means a work that combines Covered Software with other material, in \n a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n means this document.\n\n1.9. \"Licensable\"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n means any of the following:\n\n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n\n (b) any new file in Source Code Form that contains any Covered\n Software.\n\n1.11. \"Patent Claims\" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n\n1.12. \"Secondary License\"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n\n1.13. \"Source Code Form\"\n means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, \"You\" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, \"control\" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n or\n\n(b) for infringements caused by: (i) Your and any other third party's\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n* *\n* 6. Disclaimer of Warranty *\n* ------------------------- *\n* *\n* Covered Software is provided under this License on an \"as is\" *\n* basis, without warranty of any kind, either expressed, implied, or *\n* statutory, including, without limitation, warranties that the *\n* Covered Software is free of defects, merchantable, fit for a *\n* particular purpose or non-infringing. The entire risk as to the *\n* quality and performance of the Covered Software is with You. *\n* Should any Covered Software prove defective in any respect, You *\n* (not any Contributor) assume the cost of any necessary servicing, *\n* repair, or correction. This disclaimer of warranty constitutes an *\n* essential part of this License. No use of any Covered Software is *\n* authorized under this License except under this disclaimer. *\n* *\n************************************************************************\n\n************************************************************************\n* *\n* 7. Limitation of Liability *\n* -------------------------- *\n* *\n* Under no circumstances and under no legal theory, whether tort *\n* (including negligence), contract, or otherwise, shall any *\n* Contributor, or anyone who distributes Covered Software as *\n* permitted above, be liable to You for any direct, indirect, *\n* special, incidental, or consequential damages of any character *\n* including, without limitation, damages for lost profits, loss of *\n* goodwill, work stoppage, computer failure or malfunction, or any *\n* and all other commercial damages or losses, even if such party *\n* shall have been informed of the possibility of such damages. This *\n* limitation of liability shall not apply to liability for death or *\n* personal injury resulting from such party's negligence to the *\n* extent applicable law prohibits such limitation. Some *\n* jurisdictions do not allow the exclusion or limitation of *\n* incidental or consequential damages, so this exclusion and *\n* limitation may not apply to You. *\n* *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n This Source Code Form is \"Incompatible With Secondary Licenses\", as\n defined by the Mozilla Public License, v. 2.0.\n"},{"id":"Unicode-3.0","name":"Unicode License v3","text":"UNICODE LICENSE V3\n\nCOPYRIGHT AND PERMISSION NOTICE\n\nCopyright © 1991-2023 Unicode, Inc.\n\nNOTICE TO USER: Carefully read the following legal agreement. BY\nDOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR\nSOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE\nTERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT\nDOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of data files and any associated documentation (the \"Data Files\") or\nsoftware and any associated documentation (the \"Software\") to deal in the\nData Files or Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, and/or sell\ncopies of the Data Files or Software, and to permit persons to whom the\nData Files or Software are furnished to do so, provided that either (a)\nthis copyright and permission notice appear with all copies of the Data\nFiles or Software, or (b) this copyright and permission notice appear in\nassociated Documentation.\n\nTHE DATA FILES AND SOFTWARE ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\nKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\nTHIRD PARTY RIGHTS.\n\nIN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE\nBE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA\nFILES OR SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall\nnot be used in advertising or otherwise to promote the sale, use or other\ndealings in these Data Files or Software without prior written\nauthorization of the copyright holder.\n"},{"id":"Unicode-3.0","name":"Unicode License v3","text":"UNICODE LICENSE V3\n\nCOPYRIGHT AND PERMISSION NOTICE\n\nCopyright © 2020-2024 Unicode, Inc.\n\nNOTICE TO USER: Carefully read the following legal agreement. BY\nDOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR\nSOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE\nTERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT\nDOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of data files and any associated documentation (the \"Data Files\") or\nsoftware and any associated documentation (the \"Software\") to deal in the\nData Files or Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, and/or sell\ncopies of the Data Files or Software, and to permit persons to whom the\nData Files or Software are furnished to do so, provided that either (a)\nthis copyright and permission notice appear with all copies of the Data\nFiles or Software, or (b) this copyright and permission notice appear in\nassociated Documentation.\n\nTHE DATA FILES AND SOFTWARE ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\nKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\nTHIRD PARTY RIGHTS.\n\nIN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE\nBE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA\nFILES OR SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall\nnot be used in advertising or otherwise to promote the sale, use or other\ndealings in these Data Files or Software without prior written\nauthorization of the copyright holder.\n\nSPDX-License-Identifier: Unicode-3.0\n\n—\n\nPortions of ICU4X may have been adapted from ICU4C and/or ICU4J.\nICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others.\n"},{"id":"Zlib","name":"zlib License","text":"Copyright (c) 2021 Orson Peters \n\nThis software is provided 'as-is', without any express or implied warranty. In\nno event will the authors be held liable for any damages arising from the use of\nthis software.\n\nPermission is granted to anyone to use this software for any purpose, including\ncommercial applications, and to alter it and redistribute it freely, subject to\nthe following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not claim\n that you wrote the original software. If you use this software in a product,\n an acknowledgment in the product documentation would be appreciated but is\n not required.\n\n 2. Altered source versions must be plainly marked as such, and must not be\n misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source distribution.\n"},{"id":"Zlib","name":"zlib License","text":"Copyright (c) 2024 Orson Peters\n\nThis software is provided 'as-is', without any express or implied warranty. In\nno event will the authors be held liable for any damages arising from the use of\nthis software.\n\nPermission is granted to anyone to use this software for any purpose, including\ncommercial applications, and to alter it and redistribute it freely, subject to\nthe following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim\n that you wrote the original software. If you use this software in a product,\n an acknowledgment in the product documentation would be appreciated but is\n not required.\n\n2. Altered source versions must be plainly marked as such, and must not be\n misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source distribution."}]} +{"crates":[{"name":"ab_glyph","version":"0.2.32","license":"Apache-2.0","repository":"https://github.com/alexheretic/ab-glyph","texts":[40]},{"name":"ab_glyph_rasterizer","version":"0.1.10","license":"Apache-2.0","repository":"https://github.com/alexheretic/ab-glyph","texts":[40]},{"name":"accesskit","version":"0.24.1","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_atspi_common","version":"0.19.1","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_consumer","version":"0.38.0","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_unix","version":"0.22.1","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_windows","version":"0.34.0","license":"MIT OR Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"accesskit_winit","version":"0.33.2","license":"Apache-2.0","repository":"https://github.com/AccessKit/accesskit","texts":[40]},{"name":"adler2","version":"2.0.1","license":"0BSD OR MIT OR Apache-2.0","repository":"https://github.com/oyvindln/adler2","texts":[0]},{"name":"aes","version":"0.8.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/block-ciphers","texts":[24]},{"name":"ahash","version":"0.8.12","license":"MIT OR Apache-2.0","repository":"https://github.com/tkaitchuck/ahash","texts":[21]},{"name":"allocator-api2","version":"0.2.21","license":"MIT OR Apache-2.0","repository":"https://github.com/zakarumych/allocator-api2","texts":[40]},{"name":"alsa","version":"0.11.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/diwic/alsa-rs","texts":[40]},{"name":"alsa-sys","version":"0.4.0","license":"MIT","repository":"https://github.com/diwic/alsa-sys","texts":[82]},{"name":"annotate-snippets","version":"0.12.17","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/annotate-snippets-rs","texts":[9]},{"name":"anstream","version":"1.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle","version":"1.0.14","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle-parse","version":"1.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle-query","version":"1.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anstyle-wincon","version":"3.0.11","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"anyhow","version":"1.0.104","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/anyhow","texts":[40]},{"name":"arbitrary","version":"1.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-fuzz/arbitrary/","texts":[21]},{"name":"arboard","version":"3.7.0","license":"MIT OR Apache-2.0","repository":"https://github.com/1Password/arboard","texts":[40]},{"name":"arrayref","version":"0.3.9","license":"BSD-2-Clause","repository":"https://github.com/droundy/arrayref","texts":[42]},{"name":"arrayvec","version":"0.7.8","license":"MIT OR Apache-2.0","repository":"https://github.com/bluss/arrayvec","texts":[21]},{"name":"as-raw-xcb-connection","version":"1.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/psychon/as-raw-xcb-connection","texts":[3]},{"name":"ash","version":"0.38.0+1.3.281","license":"MIT OR Apache-2.0","repository":"https://github.com/ash-rs/ash","texts":[34]},{"name":"ashpd","version":"0.11.1","license":"MIT","repository":"https://github.com/bilelmoussaoui/ashpd","texts":[85]},{"name":"async-broadcast","version":"0.7.2","license":"MIT OR Apache-2.0","repository":"https://github.com/smol-rs/async-broadcast","texts":[11]},{"name":"async-channel","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-channel","texts":[21]},{"name":"async-executor","version":"1.14.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-executor","texts":[21]},{"name":"async-fs","version":"2.2.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-fs","texts":[21]},{"name":"async-io","version":"2.6.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-io","texts":[21]},{"name":"async-lock","version":"3.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-lock","texts":[21]},{"name":"async-net","version":"2.0.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-net","texts":[21]},{"name":"async-process","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-process","texts":[21]},{"name":"async-recursion","version":"1.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/dcchut/async-recursion","texts":[20]},{"name":"async-signal","version":"0.2.14","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-signal","texts":[21]},{"name":"async-task","version":"4.7.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/async-task","texts":[21]},{"name":"async-trait","version":"0.1.92","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/async-trait","texts":[40]},{"name":"atomic-waker","version":"1.1.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/atomic-waker","texts":[21]},{"name":"atspi","version":"0.29.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/odilia-app/atspi","texts":[35]},{"name":"atspi-common","version":"0.13.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/odilia-app/atspi","texts":[35]},{"name":"atspi-proxies","version":"0.13.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/odilia-app/atspi","texts":[35]},{"name":"autocfg","version":"1.5.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/cuviper/autocfg","texts":[21]},{"name":"base64","version":"0.23.1","license":"MIT OR Apache-2.0","repository":"https://github.com/marshallpierce/rust-base64","texts":[21]},{"name":"bit-set","version":"0.10.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/contain-rs/bit-set","texts":[23]},{"name":"bit-vec","version":"0.9.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/contain-rs/bit-vec","texts":[23]},{"name":"bitflags","version":"2.13.2","license":"MIT OR Apache-2.0","repository":"https://github.com/bitflags/bitflags","texts":[21]},{"name":"block-buffer","version":"0.10.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"blocking","version":"1.7.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/blocking","texts":[21]},{"name":"bumpalo","version":"3.20.3","license":"MIT OR Apache-2.0","repository":"https://github.com/fitzgen/bumpalo","texts":[21]},{"name":"by_address","version":"1.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/mbrubeck/by_address","texts":[21]},{"name":"bytemuck","version":"1.25.2","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/bytemuck","texts":[39]},{"name":"bytemuck_derive","version":"1.12.1","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/bytemuck","texts":[39]},{"name":"byteorder","version":"1.5.0","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/byteorder","texts":[101]},{"name":"byteorder-lite","version":"0.1.0","license":"Unlicense OR MIT","repository":"https://github.com/image-rs/byteorder-lite","texts":[101]},{"name":"bytes","version":"1.12.1","license":"MIT","repository":"https://github.com/tokio-rs/bytes","texts":[62]},{"name":"calloop","version":"0.13.0","license":"MIT","repository":"https://github.com/Smithay/calloop","texts":[64]},{"name":"calloop-wayland-source","version":"0.3.0","license":"MIT","repository":"https://github.com/smithay/calloop-wayland-source","texts":[71]},{"name":"cc","version":"1.11.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/cc-rs","texts":[21]},{"name":"cfg-if","version":"1.0.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/cfg-if","texts":[21]},{"name":"cfg_aliases","version":"0.2.2","license":"MIT","repository":"https://github.com/katharostech/cfg_aliases","texts":[52,86]},{"name":"chacha20","version":"0.10.2","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/stream-ciphers","texts":[24]},{"name":"chrono","version":"0.4.45","license":"MIT OR Apache-2.0","repository":"https://github.com/chronotope/chrono","texts":[41]},{"name":"cipher","version":"0.4.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/traits","texts":[24]},{"name":"clap","version":"4.6.7","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clap_builder","version":"4.6.7","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clap_derive","version":"4.6.7","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clap_lex","version":"1.1.1","license":"MIT OR Apache-2.0","repository":"https://github.com/clap-rs/clap","texts":[9]},{"name":"clipboard-win","version":"5.4.3","license":"BSL-1.0","repository":"https://github.com/DoumanAsh/clipboard-win","texts":[48]},{"name":"clru","version":"0.6.3","license":"MIT","repository":"https://github.com/marmeladema/clru-rs","texts":[69]},{"name":"cobs","version":"0.3.0","license":"MIT OR Apache-2.0","repository":"https://github.com/jamesmunns/cobs.rs","texts":[10]},{"name":"codespan-reporting","version":"0.13.1","license":"Apache-2.0","repository":"https://github.com/brendanzab/codespan","texts":[8]},{"name":"color_quant","version":"1.1.0","license":"MIT","repository":"https://github.com/image-rs/color_quant.git","texts":[104]},{"name":"colorchoice","version":"1.0.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/anstyle.git","texts":[10]},{"name":"concurrent-queue","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/concurrent-queue","texts":[21]},{"name":"const-field-offset","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"const-field-offset-macro","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"constant_time_eq","version":"0.6.1","license":"CC0-1.0 OR MIT-0 OR Apache-2.0","repository":"https://codeberg.org/cesarb/constant_time_eq","texts":[40]},{"name":"convert_case","version":"0.10.0","license":"MIT","repository":"https://github.com/rutrum/convert-case","texts":[89]},{"name":"core_detect","version":"1.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/thomcc/core_detect","texts":[20]},{"name":"countme","version":"3.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/matklad/countme","texts":[21]},{"name":"cpal","version":"0.18.2","license":"Apache-2.0","repository":"https://github.com/RustAudio/cpal","texts":[8]},{"name":"cpufeatures","version":"0.2.17","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"cpufeatures","version":"0.3.1","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"cranelift-assembler-x64","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"","texts":[40]},{"name":"cranelift-assembler-x64-meta","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"","texts":[40]},{"name":"cranelift-bforest","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-bitset","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"cranelift-codegen","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-codegen-meta","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-codegen-shared","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-control","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-entity","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-frontend","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-isle","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime/tree/main/cranelift/isle","texts":[40]},{"name":"cranelift-native","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"cranelift-srcgen","version":"0.137.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"crc32fast","version":"1.5.5","license":"MIT OR Apache-2.0","repository":"https://github.com/srijs/rust-crc32fast","texts":[10]},{"name":"critical-section","version":"1.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-embedded/critical-section","texts":[21]},{"name":"crossbeam-channel","version":"0.5.17","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crossbeam-deque","version":"0.8.8","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crossbeam-epoch","version":"0.9.21","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crossbeam-utils","version":"0.8.23","license":"MIT OR Apache-2.0","repository":"https://github.com/crossbeam-rs/crossbeam","texts":[21]},{"name":"crypto-common","version":"0.1.7","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/traits","texts":[24]},{"name":"ctor","version":"0.10.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/mmastrac/rust-ctor","texts":[38]},{"name":"cursor-icon","version":"1.2.0","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/rust-windowing/cursor-icon","texts":[2]},{"name":"dasp_sample","version":"0.11.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rustaudio/sample.git","texts":[40]},{"name":"data-url","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url","texts":[21]},{"name":"derive_more","version":"2.1.1","license":"MIT","repository":"https://github.com/JelteF/derive_more","texts":[103]},{"name":"derive_more-impl","version":"2.1.1","license":"MIT","repository":"https://github.com/JelteF/derive_more","texts":[103]},{"name":"digest","version":"0.10.7","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/traits","texts":[24]},{"name":"dirs","version":"6.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/soc/dirs-rs","texts":[40]},{"name":"dirs-sys","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/dirs-dev/dirs-sys-rs","texts":[40]},{"name":"displaydoc","version":"0.2.7","license":"MIT OR Apache-2.0","repository":"https://github.com/yaahc/displaydoc","texts":[21]},{"name":"dlib","version":"0.5.3","license":"MIT","repository":"https://github.com/elinorbgr/dlib","texts":[60]},{"name":"document-features","version":"0.2.12","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/document-features","texts":[40]},{"name":"downcast-rs","version":"1.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/marcianx/downcast-rs","texts":[23]},{"name":"dpi","version":"0.1.2","license":"Apache-2.0 AND MIT","repository":"https://github.com/rust-windowing/winit","texts":[37,90]},{"name":"either","version":"1.19.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rayon-rs/either","texts":[21]},{"name":"encoding_rs","version":"0.8.44","license":"(Apache-2.0 OR MIT) AND BSD-3-Clause","repository":"https://github.com/hsivonen/encoding_rs","texts":[3,44,46]},{"name":"endi","version":"1.1.1","license":"MIT","repository":"https://github.com/zeenix/endi","texts":[94]},{"name":"enumflags2","version":"0.7.12","license":"MIT OR Apache-2.0","repository":"https://github.com/meithecatte/enumflags2","texts":[32]},{"name":"enumflags2_derive","version":"0.7.12","license":"MIT OR Apache-2.0","repository":"https://github.com/meithecatte/enumflags2","texts":[33]},{"name":"env_filter","version":"2.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/env_logger","texts":[10]},{"name":"env_logger","version":"0.11.11","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-cli/env_logger","texts":[10]},{"name":"equivalent","version":"1.0.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/indexmap-rs/equivalent","texts":[21]},{"name":"errno","version":"0.3.14","license":"MIT OR Apache-2.0","repository":"https://github.com/lambda-fairy/rust-errno","texts":[21]},{"name":"error-code","version":"3.4.0","license":"BSL-1.0","repository":"https://github.com/DoumanAsh/error-code","texts":[47]},{"name":"euclid","version":"0.22.14","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/euclid","texts":[21]},{"name":"event-listener","version":"5.4.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/event-listener","texts":[21]},{"name":"event-listener-strategy","version":"0.5.4","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/event-listener-strategy","texts":[21]},{"name":"fallible-iterator","version":"0.3.0","license":"MIT OR Apache-2.0","repository":"https://github.com/sfackler/rust-fallible-iterator","texts":[10]},{"name":"fallible-streaming-iterator","version":"0.1.9","license":"MIT OR Apache-2.0","repository":"https://github.com/sfackler/fallible-streaming-iterator","texts":[10]},{"name":"fastrand","version":"2.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/fastrand","texts":[21]},{"name":"fdeflate","version":"0.3.7","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/fdeflate","texts":[40]},{"name":"femtovg","version":"0.27.0","license":"MIT OR Apache-2.0","repository":"https://github.com/femtovg/femtovg","texts":[40]},{"name":"field-offset","version":"0.3.6","license":"MIT OR Apache-2.0","repository":"https://github.com/Diggsey/rust-field-offset","texts":[40]},{"name":"find-msvc-tools","version":"0.1.15","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/cc-rs","texts":[21]},{"name":"fixed_decimal","version":"0.7.3","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"fixedbitset","version":"0.5.9","license":"MIT OR Apache-2.0","repository":"https://github.com/petgraph/fixedbitset","texts":[21]},{"name":"flate2","version":"1.1.11","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/flate2-rs","texts":[21]},{"name":"float-cmp","version":"0.9.0","license":"MIT","repository":"https://github.com/mikedilger/float-cmp","texts":[57]},{"name":"fnv","version":"1.0.7","license":"Apache-2.0 OR MIT","repository":"https://github.com/servo/rust-fnv","texts":[21]},{"name":"foldhash","version":"0.1.5","license":"Zlib","repository":"https://github.com/orlp/foldhash","texts":[120]},{"name":"foldhash","version":"0.2.0","license":"Zlib","repository":"https://github.com/orlp/foldhash","texts":[120]},{"name":"font-types","version":"0.12.7","license":"MIT OR Apache-2.0","repository":"https://github.com/googlefonts/fontations","texts":[31]},{"name":"fontdb","version":"0.24.0","license":"MIT","repository":"https://github.com/RazrFalcon/fontdb","texts":[107]},{"name":"fontique","version":"0.11.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"form_urlencoded","version":"1.2.2","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url","texts":[21]},{"name":"futures","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-channel","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-core","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-executor","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-io","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-lite","version":"2.6.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/futures-lite","texts":[21]},{"name":"futures-macro","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-sink","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-task","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"futures-util","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/futures-rs","texts":[12]},{"name":"generic-array","version":"0.14.7","license":"MIT","repository":"https://github.com/fizyk20/generic-array.git","texts":[112]},{"name":"gethostname","version":"1.1.0","license":"Apache-2.0","repository":"https://codeberg.org/swsnr/gethostname.rs.git","texts":[21]},{"name":"getrandom","version":"0.3.4","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/getrandom","texts":[27]},{"name":"getrandom","version":"0.4.3","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/getrandom","texts":[27]},{"name":"gif","version":"0.14.2","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image-gif","texts":[20]},{"name":"gimli","version":"0.33.0","license":"MIT OR Apache-2.0","repository":"https://github.com/gimli-rs/gimli","texts":[21]},{"name":"gl_generator","version":"0.14.0","license":"Apache-2.0","repository":"https://github.com/brendanzab/gl-rs/","texts":[40]},{"name":"glow","version":"0.17.0","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/grovesNL/glow","texts":[20]},{"name":"glow","version":"0.18.0","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/grovesNL/glow","texts":[20]},{"name":"glutin","version":"0.32.3","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"glutin-winit","version":"0.5.0","license":"MIT","repository":"https://github.com/rust-windowing/glutin","texts":[78]},{"name":"glutin_egl_sys","version":"0.7.1","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"glutin_glx_sys","version":"0.6.1","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"glutin_wgl_sys","version":"0.6.1","license":"Apache-2.0","repository":"https://github.com/rust-windowing/glutin","texts":[36]},{"name":"gpu-allocator","version":"0.28.0","license":"MIT OR Apache-2.0","repository":"https://github.com/Traverse-Research/gpu-allocator","texts":[18]},{"name":"half","version":"2.7.1","license":"MIT OR Apache-2.0","repository":"https://github.com/VoidStarKat/half-rs","texts":[40]},{"name":"harfrust","version":"0.12.0","license":"MIT","repository":"https://github.com/harfbuzz/harfrust","texts":[109]},{"name":"hashbrown","version":"0.14.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashbrown","version":"0.15.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashbrown","version":"0.16.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashbrown","version":"0.17.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/hashbrown","texts":[21]},{"name":"hashlink","version":"0.12.2","license":"MIT OR Apache-2.0","repository":"https://github.com/djc/hashlink","texts":[22]},{"name":"heck","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/withoutboats/heck","texts":[21]},{"name":"hex","version":"0.4.3","license":"MIT OR Apache-2.0","repository":"https://github.com/KokaKiwi/rust-hex","texts":[10]},{"name":"htmlparser","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/jdrouet/htmlparser.git","texts":[21]},{"name":"i-slint-backend-selector","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-backend-winit","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-common","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-compiler","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-core","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-core-macros","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-renderer-femtovg","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"i-slint-renderer-software","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"iana-time-zone","version":"0.1.65","license":"MIT OR Apache-2.0","repository":"https://github.com/strawlab/iana-time-zone","texts":[17]},{"name":"icu_collections","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_decimal","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_decimal_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_locale_core","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_locale_fallback","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_locale_fallback_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_normalizer","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_normalizer_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_properties","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_properties_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_provider","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_segmenter","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"icu_segmenter_data","version":"2.4.0","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"id-arena","version":"2.3.0","license":"MIT OR Apache-2.0","repository":"https://github.com/fitzgen/id-arena","texts":[21]},{"name":"idna","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url/","texts":[21]},{"name":"idna_adapter","version":"1.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/idna_adapter","texts":[21]},{"name":"image","version":"0.25.10","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image","texts":[40]},{"name":"image-webp","version":"0.2.4","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image-webp","texts":[40]},{"name":"imagesize","version":"0.15.0","license":"MIT","repository":"https://github.com/Roughsketch/imagesize","texts":[81]},{"name":"imgref","version":"1.12.3","license":"CC0-1.0 OR Apache-2.0","repository":"https://github.com/kornelski/imgref","texts":[8]},{"name":"indexmap","version":"2.14.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/indexmap-rs/indexmap","texts":[21]},{"name":"inout","version":"0.1.4","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/utils","texts":[24]},{"name":"is_terminal_polyfill","version":"1.70.2","license":"MIT OR Apache-2.0","repository":"https://github.com/polyfill-rs/is_terminal_polyfill","texts":[10]},{"name":"itertools","version":"0.14.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-itertools/itertools","texts":[21]},{"name":"itertools","version":"0.15.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-itertools/itertools","texts":[21]},{"name":"itoa","version":"1.0.19","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/itoa","texts":[40]},{"name":"keyboard-types","version":"0.7.0","license":"MIT OR Apache-2.0","repository":"https://github.com/pyfisch/keyboard-types","texts":[20]},{"name":"khronos-egl","version":"6.0.0","license":"MIT OR Apache-2.0","repository":"https://github.com/timothee-haudebourg/khronos-egl","texts":[21]},{"name":"khronos_api","version":"3.1.0","license":"Apache-2.0","repository":"https://github.com/brendanzab/gl-rs/","texts":[40]},{"name":"kurbo","version":"0.13.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/kurbo","texts":[3]},{"name":"lazy_static","version":"1.5.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang-nursery/lazy-static.rs","texts":[21]},{"name":"leb128fmt","version":"0.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/bluk/leb128fmt","texts":[21]},{"name":"lewton","version":"0.10.2","license":"MIT OR Apache-2.0","repository":"https://github.com/RustAudio/lewton","texts":[40]},{"name":"libc","version":"0.2.191","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/libc","texts":[40]},{"name":"libloading","version":"0.8.9","license":"ISC","repository":"https://github.com/nagisa/rust_libloading/","texts":[50]},{"name":"libm","version":"0.2.16","license":"MIT","repository":"https://github.com/rust-lang/compiler-builtins","texts":[90]},{"name":"libsqlite3-sys","version":"0.39.1","license":"MIT","repository":"https://github.com/rusqlite/rusqlite","texts":[55]},{"name":"linebender_resource_handle","version":"0.1.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/raw_resource_handle","texts":[40]},{"name":"linux-raw-sys","version":"0.12.1","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/sunfishcode/linux-raw-sys","texts":[4,21]},{"name":"linux-raw-sys","version":"0.4.15","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/sunfishcode/linux-raw-sys","texts":[4,21]},{"name":"litemap","version":"0.8.3","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"litrs","version":"1.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/LukasKalbertodt/litrs","texts":[40]},{"name":"lock_api","version":"0.4.14","license":"MIT OR Apache-2.0","repository":"https://github.com/Amanieu/parking_lot","texts":[21]},{"name":"log","version":"0.4.35","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/log","texts":[21]},{"name":"lyon_algorithms","version":"1.0.22","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"lyon_extra","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"lyon_geom","version":"1.0.20","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"lyon_path","version":"1.0.19","license":"MIT OR Apache-2.0","repository":"https://github.com/nical/lyon","texts":[40]},{"name":"memchr","version":"2.8.3","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/memchr","texts":[101]},{"name":"memfd","version":"0.6.6","license":"MIT OR Apache-2.0","repository":"https://github.com/lucab/memfd-rs","texts":[8]},{"name":"memmap2","version":"0.9.12","license":"MIT OR Apache-2.0","repository":"https://github.com/RazrFalcon/memmap2-rs","texts":[19]},{"name":"memoffset","version":"0.9.1","license":"MIT","repository":"https://github.com/Gilnaa/memoffset","texts":[61]},{"name":"miniz_oxide","version":"0.8.9","license":"MIT OR Zlib OR Apache-2.0","repository":"https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide","texts":[40]},{"name":"miniz_oxide","version":"0.9.1","license":"MIT OR Zlib OR Apache-2.0","repository":"https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide","texts":[40]},{"name":"mio","version":"1.2.4","license":"MIT","repository":"https://github.com/tokio-rs/mio","texts":[54]},{"name":"moxcms","version":"0.8.1","license":"BSD-3-Clause OR Apache-2.0","repository":"https://github.com/awxkee/moxcms.git","texts":[7]},{"name":"muda","version":"0.19.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/tauri-apps/muda","texts":[21]},{"name":"multiversion_no_op","version":"1.0.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/multiversion_no_op","texts":[3]},{"name":"naga","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"naga-types","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"natord","version":"1.0.9","license":"MIT","repository":"https://github.com/lifthrasiir/rust-natord","texts":[99]},{"name":"nom","version":"8.0.0","license":"MIT","repository":"https://github.com/rust-bakery/nom","texts":[56]},{"name":"num-bigint","version":"0.4.8","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-bigint","texts":[21]},{"name":"num-complex","version":"0.4.6","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-complex","texts":[21]},{"name":"num-integer","version":"0.1.47","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-integer","texts":[21]},{"name":"num-rational","version":"0.4.2","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-rational","texts":[21]},{"name":"num-traits","version":"0.2.19","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-num/num-traits","texts":[21]},{"name":"num_enum","version":"0.7.6","license":"BSD-3-Clause OR MIT OR Apache-2.0","repository":"https://github.com/illicitonion/num_enum","texts":[40]},{"name":"num_enum_derive","version":"0.7.6","license":"BSD-3-Clause OR MIT OR Apache-2.0","repository":"https://github.com/illicitonion/num_enum","texts":[40]},{"name":"object","version":"0.40.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/gimli-rs/object","texts":[21]},{"name":"once_cell","version":"1.21.4","license":"MIT OR Apache-2.0","repository":"https://github.com/matklad/once_cell","texts":[21]},{"name":"once_cell_polyfill","version":"1.70.2","license":"MIT OR Apache-2.0","repository":"https://github.com/polyfill-rs/once_cell_polyfill","texts":[10]},{"name":"oozextract","version":"0.5.7","license":"MIT","repository":"https://github.com/lvlvllvlvllvlvl/oozextract","texts":[90]},{"name":"option-ext","version":"0.2.0","license":"MPL-2.0","repository":"https://github.com/soc/option-ext.git","texts":[116]},{"name":"opus-rs","version":"0.1.42","license":"BSD-3-Clause","repository":"https://github.com/restsend/opus-rs","texts":[43]},{"name":"ordered-float","version":"5.5.1","license":"MIT","repository":"https://github.com/reem/rust-ordered-float","texts":[59]},{"name":"ordered-stream","version":"0.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/danieldg/ordered-stream","texts":[21]},{"name":"os_pipe","version":"1.2.3","license":"MIT","repository":"https://github.com/oconnor663/os_pipe.rs","texts":[111]},{"name":"owned_ttf_parser","version":"0.25.1","license":"Apache-2.0","repository":"https://github.com/alexheretic/owned-ttf-parser","texts":[40]},{"name":"parking","version":"2.2.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/parking","texts":[21]},{"name":"parking_lot","version":"0.12.5","license":"MIT OR Apache-2.0","repository":"https://github.com/Amanieu/parking_lot","texts":[21]},{"name":"parking_lot_core","version":"0.9.12","license":"MIT OR Apache-2.0","repository":"https://github.com/Amanieu/parking_lot","texts":[21]},{"name":"parlance","version":"0.1.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"parley","version":"0.11.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"parley_data","version":"0.11.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/parley","texts":[21]},{"name":"paste","version":"1.0.15","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/paste","texts":[40]},{"name":"percent-encoding","version":"2.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url/","texts":[21]},{"name":"petgraph","version":"0.8.3","license":"MIT OR Apache-2.0","repository":"https://github.com/petgraph/petgraph","texts":[21]},{"name":"phf","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[100]},{"name":"phf_generator","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[100]},{"name":"phf_macros","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[100]},{"name":"phf_shared","version":"0.13.1","license":"MIT","repository":"https://github.com/rust-phf/rust-phf","texts":[100]},{"name":"pico-args","version":"0.5.0","license":"MIT","repository":"https://github.com/RazrFalcon/pico-args","texts":[67]},{"name":"pin-project","version":"1.1.13","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/pin-project","texts":[40]},{"name":"pin-project-internal","version":"1.1.13","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/pin-project","texts":[40]},{"name":"pin-project-lite","version":"0.2.17","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/pin-project-lite","texts":[40]},{"name":"pin-utils","version":"0.1.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/pin-utils","texts":[14]},{"name":"pin-weak","version":"1.1.0","license":"MIT","repository":"https://github.com/sixtyfpsui/pin-weak","texts":[68]},{"name":"piper","version":"0.2.5","license":"MIT OR Apache-2.0","repository":"https://github.com/smol-rs/piper","texts":[21]},{"name":"pkg-config","version":"0.3.34","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/pkg-config-rs","texts":[21]},{"name":"png","version":"0.18.1","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/image-png","texts":[21]},{"name":"polling","version":"3.11.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/smol-rs/polling","texts":[21]},{"name":"pollster","version":"0.4.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/zesterer/pollster","texts":[21]},{"name":"pollster","version":"1.0.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/zesterer/pollster","texts":[21]},{"name":"polycool","version":"0.4.0","license":"MIT OR Apache-2.0","repository":"https://github.com/linebender/kurbo","texts":[3]},{"name":"portable-atomic","version":"1.15.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/taiki-e/portable-atomic","texts":[40]},{"name":"postcard","version":"1.1.3","license":"MIT OR Apache-2.0","repository":"https://github.com/jamesmunns/postcard","texts":[21]},{"name":"potential_utf","version":"0.1.6","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"ppv-lite86","version":"0.2.21","license":"MIT OR Apache-2.0","repository":"https://github.com/cryptocorrosion/cryptocorrosion","texts":[15]},{"name":"presser","version":"0.3.1","license":"MIT OR Apache-2.0","repository":"https://github.com/EmbarkStudios/presser","texts":[23]},{"name":"proc-macro-crate","version":"3.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/bkchr/proc-macro-crate","texts":[28]},{"name":"proc-macro2","version":"1.0.107","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/proc-macro2","texts":[40]},{"name":"profiling","version":"1.0.18","license":"MIT OR Apache-2.0","repository":"https://github.com/aclysma/profiling","texts":[40]},{"name":"pulldown-cmark","version":"0.13.6","license":"MIT","repository":"https://github.com/raphlinus/pulldown-cmark","texts":[96]},{"name":"pulley-interpreter","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime/tree/main/pulley","texts":[40]},{"name":"pulley-macros","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime/tree/main/pulley/macros","texts":[40]},{"name":"pxfm","version":"0.1.30","license":"BSD-3-Clause OR Apache-2.0","repository":"https://github.com/awxkee/pxfm","texts":[7]},{"name":"quick-error","version":"2.0.1","license":"MIT OR Apache-2.0","repository":"http://github.com/tailhook/quick-error","texts":[10]},{"name":"quick-xml","version":"0.41.0","license":"MIT","repository":"https://github.com/tafia/quick-xml","texts":[113]},{"name":"quote","version":"1.0.47","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/quote","texts":[40]},{"name":"rand","version":"0.10.3","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[40]},{"name":"rand","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[40]},{"name":"rand_chacha","version":"0.9.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[40]},{"name":"rand_core","version":"0.10.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand_core","texts":[26]},{"name":"rand_core","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-random/rand","texts":[26]},{"name":"range-alloc","version":"0.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/range-alloc","texts":[40]},{"name":"raw-window-handle","version":"0.6.2","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/rust-windowing/raw-window-handle","texts":[40]},{"name":"rayon","version":"1.12.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rayon-rs/rayon","texts":[21]},{"name":"rayon-core","version":"1.13.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rayon-rs/rayon","texts":[21]},{"name":"read-fonts","version":"0.41.0","license":"MIT OR Apache-2.0","repository":"https://github.com/googlefonts/fontations","texts":[31]},{"name":"regalloc2","version":"0.15.2","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/regalloc2","texts":[4]},{"name":"regex-lite","version":"0.1.9","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/regex","texts":[21]},{"name":"renderdoc-sys","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/ebkalderon/renderdoc-rs","texts":[21]},{"name":"resvg","version":"0.48.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/resvg","texts":[40]},{"name":"rfd","version":"0.15.4","license":"MIT","repository":"https://github.com/PolyMeilex/rfd","texts":[88]},{"name":"rgb","version":"0.8.53","license":"MIT","repository":"https://github.com/kornelski/rust-rgb","texts":[83]},{"name":"rodio","version":"0.23.0","license":"MIT OR Apache-2.0","repository":"https://github.com/RustAudio/rodio","texts":[40]},{"name":"rowan","version":"0.17.0","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-analyzer/rowan","texts":[21]},{"name":"roxmltree","version":"0.21.2","license":"MIT OR Apache-2.0","repository":"https://github.com/RazrFalcon/roxmltree","texts":[21]},{"name":"rspolib","version":"0.1.2","license":"MIT","repository":"https://github.com/mondeja/rspolib","texts":[90]},{"name":"rusqlite","version":"0.41.1","license":"MIT","repository":"https://github.com/rusqlite/rusqlite","texts":[55]},{"name":"rustc-hash","version":"1.1.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/rust-lang-nursery/rustc-hash","texts":[21]},{"name":"rustc-hash","version":"2.1.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/rust-lang/rustc-hash","texts":[40]},{"name":"rustc_version","version":"0.4.1","license":"MIT OR Apache-2.0","repository":"https://github.com/djc/rustc-version-rs","texts":[21]},{"name":"rustix","version":"0.38.44","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/rustix","texts":[4,21]},{"name":"rustix","version":"1.1.6","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/rustix","texts":[4,21]},{"name":"rustix-linux-procfs","version":"0.1.1","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/sunfishcode/rustix-linux-procfs","texts":[4,21]},{"name":"rustversion","version":"1.0.23","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/rustversion","texts":[40]},{"name":"safe_arch","version":"0.7.4","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/safe_arch","texts":[39]},{"name":"scoped-tls","version":"1.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/alexcrichton/scoped-tls","texts":[21]},{"name":"scoped-tls-hkt","version":"0.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/Diggsey/scoped-tls-hkt","texts":[21]},{"name":"scopeguard","version":"1.2.0","license":"MIT OR Apache-2.0","repository":"https://github.com/bluss/scopeguard","texts":[21]},{"name":"sctk-adwaita","version":"0.10.1","license":"MIT","repository":"https://github.com/PolyMeilex/sctk-adwaita","texts":[88]},{"name":"semver","version":"1.0.28","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/semver","texts":[40]},{"name":"serde","version":"1.0.229","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/serde","texts":[40]},{"name":"serde_core","version":"1.0.229","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/serde","texts":[40]},{"name":"serde_derive","version":"1.0.229","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/serde","texts":[40]},{"name":"serde_json","version":"1.0.154","license":"MIT OR Apache-2.0","repository":"https://github.com/serde-rs/json","texts":[40]},{"name":"serde_repr","version":"0.1.21","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/serde-repr","texts":[40]},{"name":"serde_spanned","version":"1.1.3","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"sha1","version":"0.10.7","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/hashes","texts":[24]},{"name":"sha2","version":"0.10.9","license":"MIT OR Apache-2.0","repository":"https://github.com/RustCrypto/hashes","texts":[24]},{"name":"shlex","version":"2.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/comex/rust-shlex","texts":[40]},{"name":"signal-hook-registry","version":"1.4.8","license":"MIT OR Apache-2.0","repository":"https://github.com/vorner/signal-hook","texts":[21]},{"name":"simd-adler32","version":"0.3.10","license":"MIT","repository":"https://github.com/mcountryman/simd-adler32","texts":[92]},{"name":"simdutf8","version":"0.1.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rusticstuff/simdutf8","texts":[40]},{"name":"simplecss","version":"0.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/simplecss","texts":[21]},{"name":"siphasher","version":"1.0.4","license":"MIT OR Apache-2.0","repository":"https://github.com/jedisct1/rust-siphash","texts":[3]},{"name":"skrifa","version":"0.44.0","license":"MIT OR Apache-2.0","repository":"https://github.com/googlefonts/fontations","texts":[31]},{"name":"slab","version":"0.4.12","license":"MIT","repository":"https://github.com/tokio-rs/slab","texts":[65]},{"name":"slint","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"slint-build","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"slint-macros","version":"1.18.1","license":"GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0","repository":"https://github.com/slint-ui/slint","texts":[49]},{"name":"slotmap","version":"1.1.1","license":"Zlib","repository":"https://github.com/orlp/slotmap","texts":[119]},{"name":"smallvec","version":"1.16.5","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-smallvec","texts":[21]},{"name":"smithay-client-toolkit","version":"0.19.2","license":"MIT","repository":"https://github.com/smithay/client-toolkit","texts":[63]},{"name":"smol_str","version":"0.2.2","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-analyzer/smol_str","texts":[21]},{"name":"smol_str","version":"0.3.7","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/rust-analyzer/tree/master/lib/smol_str","texts":[21]},{"name":"snafu","version":"0.8.9","license":"MIT OR Apache-2.0","repository":"https://github.com/shepmaster/snafu","texts":[16]},{"name":"snafu-derive","version":"0.8.9","license":"MIT OR Apache-2.0","repository":"https://github.com/shepmaster/snafu","texts":[16]},{"name":"socket2","version":"0.6.5","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-lang/socket2","texts":[21]},{"name":"softbuffer","version":"0.4.8","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-windowing/softbuffer","texts":[36]},{"name":"spin_on","version":"0.1.1","license":"Apache-2.0 OR MIT","repository":"","texts":[21]},{"name":"spirv","version":"0.4.0+sdk-1.4.341.0","license":"Apache-2.0","repository":"https://github.com/gfx-rs/rspirv","texts":[40]},{"name":"stable_deref_trait","version":"1.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/storyyeller/stable_deref_trait","texts":[21]},{"name":"static_assertions","version":"1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/nvzqz/static-assertions-rs","texts":[3]},{"name":"strict-num","version":"0.1.1","license":"MIT","repository":"https://github.com/RazrFalcon/strict-num","texts":[70]},{"name":"strsim","version":"0.11.1","license":"MIT","repository":"https://github.com/rapidfuzz/strsim-rs","texts":[102]},{"name":"strum","version":"0.28.0","license":"MIT","repository":"https://github.com/Peternator7/strum","texts":[84]},{"name":"strum_macros","version":"0.28.0","license":"MIT","repository":"https://github.com/Peternator7/strum","texts":[84]},{"name":"svgtypes","version":"0.16.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/svgtypes","texts":[21]},{"name":"swash","version":"0.2.10","license":"Apache-2.0 OR MIT","repository":"https://github.com/dfrg/swash","texts":[21]},{"name":"symphonia","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[115]},{"name":"symphonia-bundle-mp3","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[115]},{"name":"symphonia-core","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[115]},{"name":"symphonia-metadata","version":"0.6.1","license":"MPL-2.0","repository":"https://github.com/pdeljanov/Symphonia","texts":[115]},{"name":"syn","version":"2.0.119","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/syn","texts":[40]},{"name":"syn","version":"3.0.10","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/syn","texts":[40]},{"name":"synstructure","version":"0.14.0","license":"MIT","repository":"https://github.com/mystor/synstructure","texts":[76]},{"name":"sys-locale","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/1Password/sys-locale","texts":[8]},{"name":"taffy","version":"0.10.1","license":"MIT","repository":"https://github.com/DioxusLabs/taffy","texts":[90]},{"name":"target-lexicon","version":"0.13.5","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/target-lexicon","texts":[4]},{"name":"tempfile","version":"3.27.0","license":"MIT OR Apache-2.0","repository":"https://github.com/Stebalien/tempfile","texts":[21]},{"name":"termcolor","version":"1.4.1","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/termcolor","texts":[101]},{"name":"test-log","version":"0.2.21","license":"Apache-2.0 OR MIT","repository":"https://github.com/d-e-s-o/test-log.git","texts":[27]},{"name":"test-log-core","version":"0.2.21","license":"Apache-2.0 OR MIT","repository":"https://github.com/d-e-s-o/test-log.git","texts":[27]},{"name":"test-log-macros","version":"0.2.21","license":"Apache-2.0 OR MIT","repository":"https://github.com/d-e-s-o/test-log.git","texts":[27]},{"name":"texpresso","version":"2.0.2","license":"MIT","repository":"https://github.com/jansol/texpresso","texts":[53,79]},{"name":"text-size","version":"1.1.1","license":"MIT OR Apache-2.0","repository":"https://github.com/rust-analyzer/text-size","texts":[21]},{"name":"texture2ddecoder","version":"0.1.2","license":"MIT OR Apache-2.0","repository":"https://github.com/UniversalGameExtraction/texture2ddecoder","texts":[40]},{"name":"thiserror","version":"1.0.69","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"thiserror","version":"2.0.21","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"thiserror-impl","version":"1.0.69","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"thiserror-impl","version":"2.0.21","license":"MIT OR Apache-2.0","repository":"https://github.com/dtolnay/thiserror","texts":[40]},{"name":"tiny-skia","version":"0.11.4","license":"BSD-3-Clause","repository":"https://github.com/RazrFalcon/tiny-skia","texts":[45]},{"name":"tiny-skia","version":"0.12.0","license":"BSD-3-Clause","repository":"https://github.com/linebender/tiny-skia","texts":[45]},{"name":"tiny-skia-path","version":"0.11.4","license":"BSD-3-Clause","repository":"https://github.com/RazrFalcon/tiny-skia/tree/master/path","texts":[45]},{"name":"tiny-skia-path","version":"0.12.0","license":"BSD-3-Clause","repository":"https://github.com/linebender/tiny-skia/tree/master/path","texts":[45]},{"name":"tiny-xlib","version":"0.2.5","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/rust-windowing/tiny-xlib","texts":[40]},{"name":"tinystr","version":"0.8.5","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"tinyvec","version":"1.13.3","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/tinyvec","texts":[3]},{"name":"tokio","version":"1.54.1","license":"MIT","repository":"https://github.com/tokio-rs/tokio","texts":[91]},{"name":"toml","version":"1.2.1+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_datetime","version":"1.1.3+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_edit","version":"0.25.19+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_parser","version":"1.1.5+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"toml_writer","version":"1.2.0+spec-1.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/toml-rs/toml","texts":[9]},{"name":"tracing","version":"0.1.44","license":"MIT","repository":"https://github.com/tokio-rs/tracing","texts":[66]},{"name":"tracing-attributes","version":"0.1.31","license":"MIT","repository":"https://github.com/tokio-rs/tracing","texts":[66]},{"name":"tracing-core","version":"0.1.36","license":"MIT","repository":"https://github.com/tokio-rs/tracing","texts":[66,97]},{"name":"tree_magic_mini","version":"3.2.2","license":"MIT","repository":"https://github.com/mbrubeck/tree_magic/","texts":[80]},{"name":"ttf-parser","version":"0.25.1","license":"MIT OR Apache-2.0","repository":"https://github.com/harfbuzz/ttf-parser","texts":[21]},{"name":"typed-index-collections","version":"3.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/zheland/typed-index-collections","texts":[40]},{"name":"typed-path","version":"0.13.0","license":"MIT OR Apache-2.0","repository":"https://github.com/chipsenkbeil/typed-path","texts":[40]},{"name":"typenum","version":"1.20.1","license":"MIT OR Apache-2.0","repository":"https://github.com/paholg/typenum","texts":[13]},{"name":"uds_windows","version":"1.2.1","license":"MIT","repository":"https://github.com/haraldh/rust_uds_windows","texts":[51]},{"name":"unicase","version":"2.10.0","license":"MIT OR Apache-2.0","repository":"https://github.com/seanmonstar/unicase","texts":[21]},{"name":"unicode-bidi","version":"0.3.18","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/unicode-bidi","texts":[21]},{"name":"unicode-ident","version":"1.0.27","license":"(MIT OR Apache-2.0) AND Unicode-3.0","repository":"https://github.com/dtolnay/unicode-ident","texts":[40,117]},{"name":"unicode-linebreak","version":"0.1.5","license":"Apache-2.0","repository":"https://github.com/axelf4/unicode-linebreak","texts":[8]},{"name":"unicode-script","version":"0.5.9","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-script","texts":[29]},{"name":"unicode-segmentation","version":"1.13.3","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-segmentation","texts":[21]},{"name":"unicode-vo","version":"0.1.0","license":"MIT OR Apache-2.0","repository":"https://github.com/RazrFalcon/unicode-vo","texts":[21]},{"name":"unicode-width","version":"0.2.3","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-width","texts":[21]},{"name":"unicode-xid","version":"0.2.6","license":"MIT OR Apache-2.0","repository":"https://github.com/unicode-rs/unicode-xid","texts":[21]},{"name":"url","version":"2.5.8","license":"MIT OR Apache-2.0","repository":"https://github.com/servo/rust-url","texts":[21]},{"name":"urlencoding","version":"2.1.3","license":"MIT","repository":"https://github.com/kornelski/rust_urlencoding","texts":[114]},{"name":"usvg","version":"0.48.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/linebender/resvg","texts":[40]},{"name":"utf8_iter","version":"1.1.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/utf8_iter","texts":[3]},{"name":"utf8parse","version":"0.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/alacritty/vte","texts":[40]},{"name":"utf_types","version":"1.0.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/hsivonen/utf_types","texts":[3]},{"name":"uuid","version":"1.29.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/uuid-rs/uuid","texts":[21]},{"name":"vcpkg","version":"0.2.15","license":"MIT OR Apache-2.0","repository":"https://github.com/mcgoo/vcpkg-rs","texts":[30]},{"name":"version_check","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/SergioBenitez/version_check","texts":[21]},{"name":"vtable","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"vtable-macro","version":"0.5.0","license":"MIT OR Apache-2.0","repository":"https://github.com/slint-ui/slint","texts":[40]},{"name":"wasm-encoder","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-encoder","texts":[4,21]},{"name":"wasm-metadata","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-metadata","texts":[4,21]},{"name":"wasmparser","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser","texts":[4,21]},{"name":"wasmprinter","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmprinter","texts":[4,21]},{"name":"wasmtime","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-environ","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-component-macro","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-component-util","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-core","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"","texts":[40]},{"name":"wasmtime-internal-cranelift","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-fiber","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-jit-icache-coherence","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-unwinder","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-internal-versioned-export-macros","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-internal-wit-bindgen","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wasmtime-wasi","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[4]},{"name":"wasmtime-wasi-io","version":"50.0.1","license":"Apache-2.0 WITH LLVM-exception","repository":"https://github.com/bytecodealliance/wasmtime","texts":[40]},{"name":"wayland-backend","version":"0.3.17","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58]},{"name":"wayland-client","version":"0.31.15","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58]},{"name":"wayland-csd-frame","version":"0.3.0","license":"MIT","repository":"https://github.com/rust-windowing/wayland-csd-frame","texts":[72]},{"name":"wayland-cursor","version":"0.31.14","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58]},{"name":"wayland-protocols","version":"0.32.13","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58,77]},{"name":"wayland-protocols-plasma","version":"0.3.12","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58,93]},{"name":"wayland-protocols-wlr","version":"0.3.12","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58]},{"name":"wayland-scanner","version":"0.31.11","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58]},{"name":"wayland-sys","version":"0.31.11","license":"MIT","repository":"https://github.com/smithay/wayland-rs","texts":[58]},{"name":"webbrowser","version":"1.2.6","license":"MIT OR Apache-2.0","repository":"https://github.com/amodm/webbrowser-rs","texts":[25]},{"name":"weezl","version":"0.1.12","license":"MIT OR Apache-2.0","repository":"https://github.com/image-rs/weezl","texts":[20]},{"name":"wgpu","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-core","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-core-deps-windows-linux-android","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-hal","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-naga-bridge","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wgpu-types","version":"30.0.1","license":"MIT OR Apache-2.0","repository":"https://github.com/gfx-rs/wgpu","texts":[40]},{"name":"wide","version":"0.7.33","license":"Zlib OR Apache-2.0 OR MIT","repository":"https://github.com/Lokathor/wide","texts":[40]},{"name":"winapi-util","version":"0.1.11","license":"Unlicense OR MIT","repository":"https://github.com/BurntSushi/winapi-util","texts":[105]},{"name":"windows","version":"0.62.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-collections","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-core","version":"0.62.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-future","version":"0.3.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-implement","version":"0.60.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-interface","version":"0.59.3","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-link","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-numerics","version":"0.3.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-result","version":"0.4.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-strings","version":"0.5.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-sys","version":"0.52.0","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-sys","version":"0.59.0","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-sys","version":"0.61.2","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-targets","version":"0.52.6","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows-threading","version":"0.2.1","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows_x86_64_gnu","version":"0.52.6","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"windows_x86_64_msvc","version":"0.52.6","license":"MIT OR Apache-2.0","repository":"https://github.com/microsoft/windows-rs","texts":[5]},{"name":"winit","version":"0.30.13","license":"Apache-2.0","repository":"https://github.com/rust-windowing/winit","texts":[37]},{"name":"winnow","version":"1.0.5","license":"MIT","repository":"https://github.com/winnow-rs/winnow","texts":[95]},{"name":"winresource","version":"0.1.34","license":"MIT","repository":"https://github.com/BenjaminRi/winresource","texts":[75]},{"name":"wit-component","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-component","texts":[4,21]},{"name":"wit-parser","version":"0.261.0","license":"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT","repository":"https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-parser","texts":[4,21]},{"name":"wl-clipboard-rs","version":"0.9.5","license":"MIT OR Apache-2.0","repository":"https://github.com/YaLTeR/wl-clipboard-rs","texts":[21]},{"name":"writeable","version":"0.6.4","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"x11-dl","version":"2.21.0","license":"MIT","repository":"https://github.com/AltF02/x11-rs.git","texts":[94]},{"name":"x11rb","version":"0.13.2","license":"MIT OR Apache-2.0","repository":"https://github.com/psychon/x11rb","texts":[3]},{"name":"x11rb-protocol","version":"0.13.2","license":"MIT OR Apache-2.0","repository":"https://github.com/psychon/x11rb","texts":[3]},{"name":"xcursor","version":"0.3.11","license":"MIT","repository":"https://github.com/esposm03/xcursor-rs","texts":[87]},{"name":"xkbcommon-dl","version":"0.4.2","license":"MIT","repository":"https://github.com/rust-windowing/xkbcommon-dl","texts":[108]},{"name":"xkeysym","version":"0.2.1","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/notgull/xkeysym","texts":[1]},{"name":"xml-rs","version":"0.8.29","license":"MIT","repository":"https://github.com/kornelski/xml-rs","texts":[98]},{"name":"xmlwriter","version":"0.1.0","license":"MIT","repository":"https://github.com/RazrFalcon/xmlwriter","texts":[106]},{"name":"yazi","version":"0.2.2","license":"Apache-2.0 OR MIT","repository":"https://github.com/dfrg/yazi","texts":[21]},{"name":"yeslogic-fontconfig-sys","version":"6.0.1","license":"MIT","repository":"https://github.com/yeslogic/fontconfig-rs","texts":[110]},{"name":"yoke","version":"0.8.4","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"yoke-derive","version":"0.8.4","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"zbus","version":"5.19.0","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[73]},{"name":"zbus-lockstep","version":"0.5.2","license":"MIT","repository":"https://github.com/luukvanderduim/zbus-lockstep","texts":[94]},{"name":"zbus-lockstep-macros","version":"0.5.2","license":"MIT","repository":"https://github.com/luukvanderduim/zbus-lockstep","texts":[94]},{"name":"zbus_macros","version":"5.19.0","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[73]},{"name":"zbus_names","version":"4.3.5","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[73]},{"name":"zbus_xml","version":"5.2.1","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[73]},{"name":"zcheapstr","version":"1.2.0","license":"MIT","repository":"https://github.com/z-galaxy/zcheapstr/","texts":[74]},{"name":"zeno","version":"0.3.3","license":"Apache-2.0 OR MIT","repository":"https://github.com/dfrg/zeno","texts":[21]},{"name":"zerocopy","version":"0.8.63","license":"BSD-2-Clause OR Apache-2.0 OR MIT","repository":"https://github.com/google/zerocopy","texts":[6]},{"name":"zerocopy-derive","version":"0.8.63","license":"BSD-2-Clause OR Apache-2.0 OR MIT","repository":"https://github.com/google/zerocopy","texts":[6]},{"name":"zerofrom","version":"0.1.8","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"zerofrom-derive","version":"0.1.8","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"zeroize","version":"1.9.1","license":"Apache-2.0 OR MIT","repository":"https://github.com/RustCrypto/utils","texts":[3]},{"name":"zeroize_derive","version":"1.5.0","license":"Apache-2.0 OR MIT","repository":"https://github.com/RustCrypto/utils","texts":[3]},{"name":"zerotrie","version":"0.2.5","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"zerovec","version":"0.11.9","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"zerovec-derive","version":"0.11.7","license":"Unicode-3.0","repository":"https://github.com/unicode-org/icu4x","texts":[118]},{"name":"zip","version":"9.5.0","license":"MIT","repository":"https://github.com/zip-rs/zip2","texts":[97]},{"name":"zmij","version":"1.0.23","license":"MIT","repository":"https://github.com/dtolnay/zmij","texts":[94]},{"name":"zune-core","version":"0.5.3","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/etemesi254/zune-image","texts":[8]},{"name":"zune-jpeg","version":"0.5.15","license":"MIT OR Apache-2.0 OR Zlib","repository":"https://github.com/etemesi254/zune-image/tree/dev/crates/zune-jpeg","texts":[8]},{"name":"zvariant","version":"5.15.1","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[73]},{"name":"zvariant_derive","version":"5.15.1","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[73]},{"name":"zvariant_utils","version":"4.2.0","license":"MIT","repository":"https://github.com/z-galaxy/zbus/","texts":[94]}],"licenses":[{"id":"0BSD","name":"BSD Zero Clause License","text":"Copyright (C) Jonas Schievink \n\nPermission to use, copy, modify, and/or distribute this software for\nany purpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN\nAN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\nOF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2022-2023 John Nunley\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2023 Kirill Chibisov\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n--- LLVM Exceptions to the Apache 2.0 License ----\n\nAs an exception, if, as a result of your compiling your source code, portions\nof this Software are embedded into an Object form of such source code, you\nmay redistribute such embedded portions in such Object form without complying\nwith the conditions of Sections 4(a), 4(b) and 4(d) of the License.\n\nIn addition, if you combine or link compiled forms of this Software with\nsoftware that is licensed under the GPLv2 (\"Combined Software\") and if a\ncourt of competent jurisdiction determines that the patent provision (Section\n3), the indemnity provision (Section 9) or other Section of the License\nconflicts with the conditions of the GPLv2, you may retroactively and\nprospectively choose to deem waived or otherwise exclude such Section(s) of\nthe License, but only in their entirety and only with respect to the Combined\nSoftware.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright (c) Microsoft Corporation.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2023 The Fuchsia Authors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2024 Radzivon Bartoshyk\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright Individual contributors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright {yyyy} {name of copyright owner}\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n Copyright 2020 Yoshua Wuyts\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright (c) 2016 Alex Crichton\nCopyright (c) 2017 The Tokio Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2014 Paho Lurie-Gregg\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2018 The pin-utils authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2019 The CryptoCorrosion Contributors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2019- Jake Goulding\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2020 Andrew Straw\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2021 Traverse Research B.V.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [2015] [Dan Burkert]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nCopyright (c) 2015-2022 Amod Malviya\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n https://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n https://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n https://www.apache.org/licenses/LICENSE-2.0\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright 2021 The Unicode-rs Developers\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":" Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nCopyright 2019 Fontations Developers\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\n\nCopyright 2017-2023 Maik Klein, Maja Kądziołka\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\n\nCopyright [2017] [Maik Klein]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and\nYou must cause any modified files to carry prominent notices stating that You changed the files; and\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nCopyright 2016 Maik Klein\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright 2022 Kirill Chibisov\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright {yyyy} {name of copyright owner}\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License."},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"{}\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright {yyyy} {name of copyright owner}\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"},{"id":"Apache-2.0","name":"Apache License 2.0","text":"Rust-chrono is dual-licensed under The MIT License [1] and\nApache 2.0 License [2]. Copyright (c) 2014--2026, Kang Seonghoon and\ncontributors.\n\nNota Bene: This is same as the Rust Project's own license.\n\n\n[1]: , which is reproduced below:\n\n~~~~\nThe MIT License (MIT)\n\nCopyright (c) 2014, Kang Seonghoon.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n~~~~\n\n\n[2]: , which is reproduced below:\n\n~~~~\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n~~~~\n\n"},{"id":"BSD-2-Clause","name":"BSD 2-Clause \"Simplified\" License","text":"Copyright (c) 2015 David Roundy \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the\n distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"\nCopyright 2026 restsend.com\n\nCopyright 2001-2023 Xiph.Org, Skype Limited, Octasic,\n Jean-Marc Valin, Timothy B. Terriberry,\n CSIRO, Gregory Maxwell, Mark Borgerding,\n Erik de Castro Lopo, Mozilla, Amazon\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n- Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n- Neither the name of Internet Society, IETF or IETF Trust, nor the\nnames of specific contributors, may be used to endorse or promote\nproducts derived from this software without specific prior written\npermission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nOpus is subject to the royalty-free patent licenses which are\nspecified at:\n\nXiph.Org Foundation:\nhttps://datatracker.ietf.org/ipr/1524/\n\nMicrosoft Corporation:\nhttps://datatracker.ietf.org/ipr/1914/\n\nBroadcom Corporation:\nhttps://datatracker.ietf.org/ipr/1526/"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"// Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice, this\n// list of conditions and the following disclaimer.\n//\n// 2. Redistributions in binary form must reproduce the above copyright notice,\n// this list of conditions and the following disclaimer in the documentation\n// and/or other materials provided with the distribution.\n//\n// 3. Neither the name of the copyright holder nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/// The PUA code points special-cased in the GB18030 encoder.\npub(crate) static GB18030_2022_OVERRIDE_PUA: [u16; 18] = [\n 0xE78D, 0xE78E, 0xE78F, 0xE790, 0xE791, 0xE792, 0xE793, 0xE794, 0xE795, 0xE796, 0xE81E, 0xE826,\n 0xE82B, 0xE82C, 0xE832, 0xE843, 0xE854, 0xE864,\n];\n\n/// The bytes corresponding to the PUA code points special-cased in the GB18030 encoder.\npub(crate) static GB18030_2022_OVERRIDE_BYTES: [[u8; 2]; 18] = [\n [0xA6, 0xD9],\n [0xA6, 0xDA],\n [0xA6, 0xDB],\n [0xA6, 0xDC],\n [0xA6, 0xDD],\n [0xA6, 0xDE],\n [0xA6, 0xDF],\n [0xA6, 0xEC],\n [0xA6, 0xED],\n [0xA6, 0xF3],\n [0xFE, 0x59],\n [0xFE, 0x61],\n [0xFE, 0x66],\n [0xFE, 0x67],\n [0xFE, 0x6D],\n [0xFE, 0x7E],\n [0xFE, 0x90],\n [0xFE, 0xA0],\n];\n"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"Copyright (c) 2011 Google Inc. All rights reserved.\nCopyright (c) 2020 Yevhenii Reizner All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived\n from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"},{"id":"BSD-3-Clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","text":"Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"},{"id":"BSL-1.0","name":"Boost Software License 1.0","text":"Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization\nobtaining a copy of the software and accompanying documentation covered by\nthis license (the \"Software\") to use, reproduce, display, distribute,\nexecute, and transmit the Software, and to prepare derivative works of the\nSoftware, and to permit third-parties to whom the Software is furnished to\ndo so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including\nthe above license grant, this restriction and the following disclaimer,\nmust be included in all copies of the Software, in whole or in part, and\nall derivative works of the Software, unless such copies or derivative\nworks are solely in the form of machine-executable object code generated by\na source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\nSHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\nFOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"BSL-1.0","name":"Boost Software License 1.0","text":"Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the \"Software\") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"GPL-3.0-only","name":"GNU General Public License v3.0 only","text":"GNU GENERAL PUBLIC LICENSE\nVersion 3, 29 June 2007\n\nCopyright © 2007 Free Software Foundation, Inc. \n\nEveryone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\n\nPreamble\n\nThe GNU General Public License is a free, copyleft license for software and other kinds of works.\n\nThe licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\n\nWhen we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\n\nTo protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\n\nFor example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\n\nDevelopers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\n\nFor the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\n\nSome devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\n\nFinally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\n\nThe precise terms and conditions for copying, distribution and modification follow.\n\nTERMS AND CONDITIONS\n\n0. Definitions.\n\n“This License” refers to version 3 of the GNU General Public License.\n\n“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\n\n“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.\n\nTo “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.\n\nA “covered work” means either the unmodified Program or a work based on the Program.\n\nTo “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\n\nTo “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\n\nAn interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\n\n1. Source Code.\nThe “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.\n\nA “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\n\nThe “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\n\nThe “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\n\nThe Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\n\nThe Corresponding Source for a work in source code form is that same work.\n\n2. Basic Permissions.\nAll rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\n\nYou may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\n\nConveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\n\n3. Protecting Users' Legal Rights From Anti-Circumvention Law.\nNo covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\n\nWhen you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\n\n4. Conveying Verbatim Copies.\nYou may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\n\nYou may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\n\n5. Conveying Modified Source Versions.\nYou may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.\n\n c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\n\nA compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\n\n6. Conveying Non-Source Forms.\nYou may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\n\n d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\n\nA separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\n\nA “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\n\n“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\n\nIf you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\n\nThe requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\n\nCorresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\n\n7. Additional Terms.\n“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\n\nWhen you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\n\nNotwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\n\nAll other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\n\nIf you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\n\nAdditional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\n\n8. Termination.\nYou may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\n\nHowever, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\n\nMoreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\n\nTermination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\n\n9. Acceptance Not Required for Having Copies.\nYou are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\n\n10. Automatic Licensing of Downstream Recipients.\nEach time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\n\nAn “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\n\nYou may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\n\n11. Patents.\nA “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.\n\nA contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\n\nEach contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\n\nIn the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\n\nIf you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\n\nIf, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\n\nA patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\n\nNothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\n\n12. No Surrender of Others' Freedom.\nIf conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\n\n13. Use with the GNU Affero General Public License.\nNotwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\n\n14. Revised Versions of this License.\nThe Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\n\nIf the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\n\nLater license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\n\n15. Disclaimer of Warranty.\nTHERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n16. Limitation of Liability.\nIN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\n17. Interpretation of Sections 15 and 16.\nIf the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\n\nEND OF TERMS AND CONDITIONS\n\nHow to Apply These Terms to Your New Programs\n\nIf you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\n\nTo do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.\n\n \n Copyright (C) \n\n This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\n\n Copyright (C) \n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.\n\nYou should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .\n\nThe GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .\n"},{"id":"ISC","name":"ISC License","text":"Copyright © 2015, Simonas Kazlauskas\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without\nfee is hereby granted, provided that the above copyright notice and this permission notice appear\nin all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS\nSOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\nAUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\nNEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":" MIT License\n\n Copyright (c) Microsoft Corporation. All rights reserved.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE\n"},{"id":"MIT","name":"MIT License","text":"# 3rd Party Notices\n\nThe `cfg_aliases!` macro uses a lot of the code from [`tectonic_cfg_support::target_cfg!`] macro which is under the following license:\n\n[`tectonic_cfg_support::target_cfg!`]: https://github.com/tectonic-typesetting/tectonic/blob/f2439b936470ad27bdf92882064bc4702ee01899/cfg_support/src/lib.rs#L166\n\n tectonic_cfg_support is licensed under the MIT License.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the “Software”), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n---\n"},{"id":"MIT","name":"MIT License","text":"// Copyright (c) 2006 Simon Brown \n// Copyright (c) 2018-2021 Jan Solanti \n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to\tdeal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmod cluster;\nmod range;\nmod single;\nmod single_lut;\n\npub use self::cluster::ClusterFit;\npub use self::range::RangeFit;\npub use self::single::SingleColourFit;\n\npub trait ColourFit<'a> {\n fn compress(&'a mut self, block: &mut [u8]);\n}\n\npub trait ColourFitImpl<'a> {\n fn is_bc1(&self) -> bool;\n fn is_transparent(&self) -> bool;\n fn compress3(&mut self);\n fn compress4(&mut self);\n fn best_compressed(&'a self) -> &'a [u8];\n}\n\nimpl<'a, T> ColourFit<'a> for T\nwhere\n T: ColourFitImpl<'a>,\n{\n fn compress(&'a mut self, block: &mut [u8]) {\n if self.is_bc1() {\n self.compress3();\n if !self.is_transparent() {\n self.compress4();\n }\n } else {\n self.compress4();\n }\n\n block.copy_from_slice(self.best_compressed());\n }\n}\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014 Carl Lerche and other MIO contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014 The rusqlite developers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014-2019 Geoffroy Couprie\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2014-2020 Optimal Computing (NZ) Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2015 Elinor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2015 Jonathan Reem\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2015 Victor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2017 Gilad Naaman\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2018 Carl Lerche\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2018 Victor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2018 Victor Berger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2019 Carl Lerche\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2019 Tokio Contributors\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2019 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2020 Olivier Goffart \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2020 Élie ROUDNINSKI (marmeladema) \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2022 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2023 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2023 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2024 Zeeshan Ali Khan & zbus contributors\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright (c) 2026 Zeeshan Ali Khan & zcheapstr contributors\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright 2016 Max Resch\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright 2016 Nika Layzell\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Copyright © 2008-2013 Kristian Høgsberg\nCopyright © 2010-2013 Intel Corporation\nCopyright © 2013 Rafael Antognolli\nCopyright © 2013 Jasper St. Pierre\nCopyright © 2014 Jonas Ådahl\nCopyright © 2014 Jason Ekstrand\nCopyright © 2014-2015 Collabora, Ltd.\nCopyright © 2015 Red Hat Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice (including the next\nparagraph) shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n\n---\n\nThe above is the version of the MIT \"Expat\" License used by X.org:\n\n http://cgit.freedesktop.org/xorg/xserver/tree/COPYING\n"},{"id":"MIT","name":"MIT License","text":"Copyright © 2022 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2006 Simon Brown \nCopyright (c) 2018-2021 Jan Solanti \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2017 Aaron Hancock\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2017 Maiddog\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2018 diwic\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2019 Kornel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2019 Peter Glotfelty\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2020 Bilal Elmoussaoui\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2020 Katharos Technology\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2020 Samuele Esposito\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2022 Bartłomiej Maryńczak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) 2025 rutrum\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) \n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the \"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial\nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\nLIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO\nEVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\nUSE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) Tokio Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License\n\nCopyright (c) [2021] [Marvin Countryman]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"MIT License Copyright (c) \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice (including the next\nparagraph) shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\nOR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF\nOR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"Permission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License\n\nCopyright 2015 Google Inc. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014 Mathijs van de Nes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014 Vladimir Matveev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014, Kang Seonghoon.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2014-2022 Steven Fackler, Yuki Okushi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2015 Andrew Gallant\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2015 Danny Guo\nCopyright (c) 2016 Titus Wormer \nCopyright (c) 2018 Akash Kurdekar\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2016 Jelte Fennema\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2016 PistonDevelopers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2017 Andrew Gallant\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2019 Reizner Evgeniy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2020 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2023 Kirill Chibisov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) HarfBuzz developers\nCopyright (c) 2020 Yevhenii Reizner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright 2019 YesLogic Pty. Ltd.\nCopyright 2016 Manuel Reinhardt\nCopyright 2014 Austin Bonander\nCopyright 2013 The Servo Project Developers.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2015 Bartłomiej Kamiński\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."},{"id":"MIT","name":"MIT License","text":"The MIT License (MIT)\n\nCopyright (c) 2016 Johann Tuffe\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MIT","name":"MIT License","text":"© 2016 Bertram Truong\n© 2021 Kornel Lesiński\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"},{"id":"MPL-2.0","name":"Mozilla Public License 2.0","text":"Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n means\n\n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n\n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n\n1.6. \"Executable Form\"\n means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n means a work that combines Covered Software with other material, in \n a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n means this document.\n\n1.9. \"Licensable\"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n means any of the following:\n\n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n\n (b) any new file in Source Code Form that contains any Covered\n Software.\n\n1.11. \"Patent Claims\" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n\n1.12. \"Secondary License\"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n\n1.13. \"Source Code Form\"\n means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, \"You\" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, \"control\" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n or\n\n(b) for infringements caused by: (i) Your and any other third party's\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n* *\n* 6. Disclaimer of Warranty *\n* ------------------------- *\n* *\n* Covered Software is provided under this License on an \"as is\" *\n* basis, without warranty of any kind, either expressed, implied, or *\n* statutory, including, without limitation, warranties that the *\n* Covered Software is free of defects, merchantable, fit for a *\n* particular purpose or non-infringing. The entire risk as to the *\n* quality and performance of the Covered Software is with You. *\n* Should any Covered Software prove defective in any respect, You *\n* (not any Contributor) assume the cost of any necessary servicing, *\n* repair, or correction. This disclaimer of warranty constitutes an *\n* essential part of this License. No use of any Covered Software is *\n* authorized under this License except under this disclaimer. *\n* *\n************************************************************************\n\n************************************************************************\n* *\n* 7. Limitation of Liability *\n* -------------------------- *\n* *\n* Under no circumstances and under no legal theory, whether tort *\n* (including negligence), contract, or otherwise, shall any *\n* Contributor, or anyone who distributes Covered Software as *\n* permitted above, be liable to You for any direct, indirect, *\n* special, incidental, or consequential damages of any character *\n* including, without limitation, damages for lost profits, loss of *\n* goodwill, work stoppage, computer failure or malfunction, or any *\n* and all other commercial damages or losses, even if such party *\n* shall have been informed of the possibility of such damages. This *\n* limitation of liability shall not apply to liability for death or *\n* personal injury resulting from such party's negligence to the *\n* extent applicable law prohibits such limitation. Some *\n* jurisdictions do not allow the exclusion or limitation of *\n* incidental or consequential damages, so this exclusion and *\n* limitation may not apply to You. *\n* *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n This Source Code Form is \"Incompatible With Secondary Licenses\", as\n defined by the Mozilla Public License, v. 2.0."},{"id":"MPL-2.0","name":"Mozilla Public License 2.0","text":"Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n means\n\n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n\n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n\n1.6. \"Executable Form\"\n means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n means a work that combines Covered Software with other material, in \n a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n means this document.\n\n1.9. \"Licensable\"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n means any of the following:\n\n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n\n (b) any new file in Source Code Form that contains any Covered\n Software.\n\n1.11. \"Patent Claims\" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n\n1.12. \"Secondary License\"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n\n1.13. \"Source Code Form\"\n means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, \"You\" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, \"control\" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n or\n\n(b) for infringements caused by: (i) Your and any other third party's\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n* *\n* 6. Disclaimer of Warranty *\n* ------------------------- *\n* *\n* Covered Software is provided under this License on an \"as is\" *\n* basis, without warranty of any kind, either expressed, implied, or *\n* statutory, including, without limitation, warranties that the *\n* Covered Software is free of defects, merchantable, fit for a *\n* particular purpose or non-infringing. The entire risk as to the *\n* quality and performance of the Covered Software is with You. *\n* Should any Covered Software prove defective in any respect, You *\n* (not any Contributor) assume the cost of any necessary servicing, *\n* repair, or correction. This disclaimer of warranty constitutes an *\n* essential part of this License. No use of any Covered Software is *\n* authorized under this License except under this disclaimer. *\n* *\n************************************************************************\n\n************************************************************************\n* *\n* 7. Limitation of Liability *\n* -------------------------- *\n* *\n* Under no circumstances and under no legal theory, whether tort *\n* (including negligence), contract, or otherwise, shall any *\n* Contributor, or anyone who distributes Covered Software as *\n* permitted above, be liable to You for any direct, indirect, *\n* special, incidental, or consequential damages of any character *\n* including, without limitation, damages for lost profits, loss of *\n* goodwill, work stoppage, computer failure or malfunction, or any *\n* and all other commercial damages or losses, even if such party *\n* shall have been informed of the possibility of such damages. This *\n* limitation of liability shall not apply to liability for death or *\n* personal injury resulting from such party's negligence to the *\n* extent applicable law prohibits such limitation. Some *\n* jurisdictions do not allow the exclusion or limitation of *\n* incidental or consequential damages, so this exclusion and *\n* limitation may not apply to You. *\n* *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n This Source Code Form is \"Incompatible With Secondary Licenses\", as\n defined by the Mozilla Public License, v. 2.0.\n"},{"id":"Unicode-3.0","name":"Unicode License v3","text":"UNICODE LICENSE V3\n\nCOPYRIGHT AND PERMISSION NOTICE\n\nCopyright © 1991-2023 Unicode, Inc.\n\nNOTICE TO USER: Carefully read the following legal agreement. BY\nDOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR\nSOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE\nTERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT\nDOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of data files and any associated documentation (the \"Data Files\") or\nsoftware and any associated documentation (the \"Software\") to deal in the\nData Files or Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, and/or sell\ncopies of the Data Files or Software, and to permit persons to whom the\nData Files or Software are furnished to do so, provided that either (a)\nthis copyright and permission notice appear with all copies of the Data\nFiles or Software, or (b) this copyright and permission notice appear in\nassociated Documentation.\n\nTHE DATA FILES AND SOFTWARE ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\nKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\nTHIRD PARTY RIGHTS.\n\nIN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE\nBE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA\nFILES OR SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall\nnot be used in advertising or otherwise to promote the sale, use or other\ndealings in these Data Files or Software without prior written\nauthorization of the copyright holder.\n"},{"id":"Unicode-3.0","name":"Unicode License v3","text":"UNICODE LICENSE V3\n\nCOPYRIGHT AND PERMISSION NOTICE\n\nCopyright © 2020-2024 Unicode, Inc.\n\nNOTICE TO USER: Carefully read the following legal agreement. BY\nDOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR\nSOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE\nTERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT\nDOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of data files and any associated documentation (the \"Data Files\") or\nsoftware and any associated documentation (the \"Software\") to deal in the\nData Files or Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, and/or sell\ncopies of the Data Files or Software, and to permit persons to whom the\nData Files or Software are furnished to do so, provided that either (a)\nthis copyright and permission notice appear with all copies of the Data\nFiles or Software, or (b) this copyright and permission notice appear in\nassociated Documentation.\n\nTHE DATA FILES AND SOFTWARE ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\nKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\nTHIRD PARTY RIGHTS.\n\nIN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE\nBE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA\nFILES OR SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall\nnot be used in advertising or otherwise to promote the sale, use or other\ndealings in these Data Files or Software without prior written\nauthorization of the copyright holder.\n\nSPDX-License-Identifier: Unicode-3.0\n\n—\n\nPortions of ICU4X may have been adapted from ICU4C and/or ICU4J.\nICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others.\n"},{"id":"Zlib","name":"zlib License","text":"Copyright (c) 2021 Orson Peters \n\nThis software is provided 'as-is', without any express or implied warranty. In\nno event will the authors be held liable for any damages arising from the use of\nthis software.\n\nPermission is granted to anyone to use this software for any purpose, including\ncommercial applications, and to alter it and redistribute it freely, subject to\nthe following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not claim\n that you wrote the original software. If you use this software in a product,\n an acknowledgment in the product documentation would be appreciated but is\n not required.\n\n 2. Altered source versions must be plainly marked as such, and must not be\n misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source distribution.\n"},{"id":"Zlib","name":"zlib License","text":"Copyright (c) 2024 Orson Peters\n\nThis software is provided 'as-is', without any express or implied warranty. In\nno event will the authors be held liable for any damages arising from the use of\nthis software.\n\nPermission is granted to anyone to use this software for any purpose, including\ncommercial applications, and to alter it and redistribute it freely, subject to\nthe following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim\n that you wrote the original software. If you use this software in a product,\n an acknowledgment in the product documentation would be appreciated but is\n not required.\n\n2. Altered source versions must be plainly marked as such, and must not be\n misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source distribution."}]} diff --git a/crates/openrage-cli/src/cli.rs b/crates/openrage-cli/src/cli.rs index 13ea834..966702f 100644 --- a/crates/openrage-cli/src/cli.rs +++ b/crates/openrage-cli/src/cli.rs @@ -64,7 +64,7 @@ pub(crate) enum Command { /// Instead of archives, decode every sound of every audio container (.awc). #[arg(long, conflicts_with_all = ["textures", "models"])] audio: bool, - /// Instead of archives, parse every clip dictionary (.ycd) and evaluate every frame. + /// Instead of archives, parse every clip dictionary (.ycd; GTA VI .#cd) and evaluate its frames. #[arg(long, conflicts_with_all = ["textures", "models", "audio"])] animations: bool, /// Instead of archives, convert every metadata file (.ymap, .ytyp, .ymt, .ymf, .cut, .pso) to XML. @@ -86,7 +86,8 @@ pub(crate) enum Command { /// Instead of archives, disassemble every script (.ysc) and check every jump. #[arg(long, conflicts_with_all = ["textures", "models", "audio", "animations", "meta", "text", "particles", "collisions", "paths"])] scripts: bool, - /// Instead of archives, read the header of every Scaleform movie (.gfx) and Bink video (.bik). + /// Instead of archives, read the header of every Scaleform movie (.gfx) and Bink video (.bik, .bk2), + /// and decode the first second of every video. #[arg(long, conflicts_with_all = ["textures", "models", "audio", "animations", "meta", "text", "particles", "collisions", "paths", "scripts"])] media: bool, /// Instead of archives, read every GTA IV cutscene (.cut): its sections, the clips of @@ -128,7 +129,8 @@ pub(crate) enum Command { /// Put a map file (.ymap) together: its objects with their models and textures /// (builds the world cache on first use). Map { - /// Virtual path of the .ymap (GTA IV: .wpl; none with --check). + /// Virtual path of the .ymap (GTA IV: .wpl; GTA VI: .#map, or none for the whole map from afar; none with + /// --check). path: Option, /// Render a picture of the whole map file (PNG). #[arg(long)] @@ -228,13 +230,22 @@ pub(crate) enum Command { /// Instead of only reading files, decode every sound of every audio container. #[arg(long, conflicts_with_all = ["textures", "models", "text", "meta"])] audio: bool, - /// Instead of only reading files, parse every clip dictionary (.ycd) and evaluate every frame. + /// Instead of only reading files, parse every clip dictionary (.ycd; GTA VI .#cd) and evaluate its frames. #[arg(long, conflicts_with_all = ["textures", "models", "text", "meta", "audio"])] anims: bool, }, - /// Show facts about a Scaleform movie (.gfx) or a Bink video (.bik). + /// Show facts about a Scaleform movie (.gfx) or a Bink video (.bik, .bk2). Media { path: String, + /// For a Bink video: write its pictures as PNG files into this directory. + #[arg(long)] + frames: Option, + /// Only write every n-th picture. + #[arg(long, default_value_t = 1, requires = "frames")] + every: usize, + /// For a Bink video: write its sound as a WAV file (the second track and on as `name.2.wav` …). + #[arg(long)] + wav: Option, /// For a .gfx: write it as a Flash file (.swf) for Flash tools such as JPEXS or Ruffle. #[arg(long)] swf: Option, @@ -350,7 +361,7 @@ pub(crate) enum Command { #[arg(long)] outfit: Option, }, - /// List the clips of a clip dictionary (.ycd; GTA IV .wad). + /// List the clips of a clip dictionary (.ycd; GTA IV .wad; GTA VI .#cd). Clips { /// Virtual path of the .ycd file. path: String, @@ -379,6 +390,23 @@ pub(crate) enum Command { #[arg(short = 'o', long, visible_alias = "out")] export: Option, }, + /// GTA VI: count the textures of a texture pool (.ttpf) and optionally export them as PNG. + Ttpf { + /// The pool file. + path: PathBuf, + /// Export the textures into this folder as .png, named by their number. + #[arg(short = 'o', long, visible_alias = "out")] + export: Option, + /// The first texture to read. + #[arg(long, default_value_t = 0)] + from: usize, + /// How many textures to read (default: all). + #[arg(long)] + count: Option, + /// Read the largest mip level that is at most this many pixels wide and high. + #[arg(long)] + max_side: Option, + }, /// List the textures of a texture dictionary (.ytd) and optionally export them. Textures { /// Virtual path of the .ytd file. diff --git a/crates/openrage-cli/src/cmd/archive.rs b/crates/openrage-cli/src/cmd/archive.rs index 471180c..af6cc10 100644 --- a/crates/openrage-cli/src/cmd/archive.rs +++ b/crates/openrage-cli/src/cmd/archive.rs @@ -161,6 +161,33 @@ pub(crate) fn cmd_ls(game_dir: &Path, path: &str, recursive: bool, keys: Option< print_rpf8_entry(&mut out, &rpf, i, name.rsplit('/').next().unwrap_or(&name)); } } + Node::Rpf9File(rpf, i) => { + let entries = rpf.entries()?; + print_rpf9_entry(&mut out, &rpf, &entries[i], &rpf.entry_name(&entries[i])); + } + Node::Rpf9Dir(rpf, dir) => { + let entries = rpf.entries()?; + openrage_app::rpf9::names_now(&rpf); + if recursive { + let prefix = if dir.is_empty() { String::new() } else { format!("{dir}/") }; + for e in entries.iter() { + let name = rpf.entry_name(e); + let below = name.get(..prefix.len()).is_some_and(|s| s.eq_ignore_ascii_case(&prefix)); + if let Some(rel) = name.get(prefix.len()..).filter(|_| below) { + print_rpf9_entry(&mut out, &rpf, e, rel); + } + } + } else { + let (dirs, files) = rpf.list_dir(&entries, &dir); + for d in dirs { + ls_row(&mut out, "dir", None, "", &d, true); + } + for i in files { + let name = rpf.entry_name(&entries[i]); + print_rpf9_entry(&mut out, &rpf, &entries[i], name.rsplit('/').next().unwrap_or(&name)); + } + } + } Node::Gta4File(a, id) => print_gta4_entry(&mut out, &a, id, &a.entry_path(id)), Node::Gta4Dir(a, dir) => { if recursive { @@ -232,6 +259,67 @@ pub(crate) fn cmd_info(game_dir: &Path, path: &str, keys: Option>) outln!("Folder: {dir}"); } } + Node::Rpf9Dir(rpf, dir) => { + outln!("Archive: {}", rpf.display_name()); + outln!("Format: RPF9 (Grand Theft Auto VI)"); + outln!("Size: {} ({} bytes)", human(rpf.size()), rpf.size()); + outln!("Index slots: {} (declared in header; distinct from recovered streams)", rpf.header().entry_count); + outln!("TOC tag: {:#04x} (native transform selector)", rpf.header().toc_transform); + if rpf.is_native() { + outln!("Table: read with the game's executable"); + } else { + outln!("Table: encrypted, not read (file names and folders are unknown)"); + } + outln!("Data: from offset {:#x}, {}", rpf.header().data_offset, human(rpf.data_len())); + // The archive itself is described without reading all of it. + let known = openrage_app::rpf9::known_entries(&rpf); + let entries = if dir.is_empty() { known } else { Some(rpf.entries()?) }; + match entries { + Some(entries) => { + let c = openrage_app::rpf9::coverage(&rpf, &entries); + outln!( + "{} {} files, {} in the archive, {} unpacked", + if rpf.is_native() { "Contents: " } else { "Recovered:" }, + c.files, + human(c.stored), + human(c.unpacked) + ); + if !rpf.is_native() { + outln!( + "Not read: {} (padding, and data that is neither zlib, Bink 2 nor an audio container)", + human(c.unread) + ); + } + } + None => outln!("Recovered: not indexed yet; `openrage ls` on the archive reads all of it once"), + } + if !dir.is_empty() { + outln!("Folder: {dir}"); + } + } + Node::Rpf9File(rpf, i) => { + let entries = rpf.entries()?; + let e = &entries[i]; + outln!("Path: {}/{}", rpf.display_name(), rpf.entry_name(e)); + if rpf.is_native() { + outln!("Kind: {}", if rpf.resource_parts(e).is_some() { "resource" } else { "file" }); + } else { + outln!("Kind: recovered file (its name is its offset; the real name is unknown)"); + } + outln!("Offset: {:#x}", e.offset); + outln!("Size: {} ({} on disk)", human(e.size), human(e.stored)); + match e.kind { + rage_rpf::rpf9::Kind::Zlib => outln!("Stored as: {} zlib stream(s)", e.streams), + rage_rpf::rpf9::Kind::Bink2 => outln!("Stored as: Bink 2 video"), + rage_rpf::rpf9::Kind::Awc => outln!("Stored as: audio container"), + rage_rpf::rpf9::Kind::Native { slot } => { + outln!("Slot: {slot}"); + if let Some((system, graphics)) = rpf.resource_parts(e) { + outln!("Parts: {} system, {} graphics", human(system), human(graphics)); + } + } + } + } Node::Rpf8File(rpf, i) => { let e = &rpf.entries().expect("entries")[i]; outln!("Path: {}/{}", rpf.display_name(), rpf.entry_name(i)); @@ -303,6 +391,34 @@ pub(crate) fn report_rpf8_extract(rpf: &rage_rpf::Rpf8, dir: &str, file: Option< extraction_result(s.failures.len()) } +pub(crate) fn report_rpf9_extract( + rpf: &rage_rpf::Rpf9, + dir: &str, + file: Option, + out: &Path, + expand: bool, +) -> Result<()> { + let s = openrage_app::rpf9::extract(rpf, dir, file, out, expand, &AtomicBool::new(false), &mut |_, _| {})?; + for f in &s.failures { + eprintln!("warning: {f}"); + } + outln!("{} file(s) ({}) extracted to {}, {} failed", s.files, human(s.bytes), out.display(), s.failures.len()); + extraction_result(s.failures.len()) +} + +/// One file of a GTA VI archive. +pub(crate) fn print_rpf9_entry(out: &mut Rows, rpf: &rage_rpf::Rpf9, e: &rage_rpf::rpf9::Entry, name: &str) { + let archive = rpf.is_archive(e); + let kind = if archive { + "rpf" + } else if rpf.resource_parts(e).is_some() { + "resource" + } else { + "file" + }; + ls_row(out, kind, Some(e.size), "", name, archive); +} + /// Extraction goes on past single failures, but the command still fails then, /// so scripts notice. pub(crate) fn extraction_result(failures: usize) -> Result<()> { @@ -336,6 +452,8 @@ pub(crate) fn cmd_extract( Node::ArchiveFile(rpf, id) | Node::ArchiveDir(rpf, id) => (rpf, id), Node::Rpf8File(rpf, i) => return report_rpf8_extract(&rpf, "", Some(i), out), Node::Rpf8Dir(rpf, dir) => return report_rpf8_extract(&rpf, &dir, None, out), + Node::Rpf9File(rpf, i) => return report_rpf9_extract(&rpf, "", Some(i), out, expand), + Node::Rpf9Dir(rpf, dir) => return report_rpf9_extract(&rpf, &dir, None, out, expand), Node::Gta4Dir(a, id) | Node::Gta4File(a, id) => { let s = openrage_app::gta4::extract(&a, id, out, &AtomicBool::new(false), &mut |_, _| {})?; for f in &s.failures { diff --git a/crates/openrage-cli/src/cmd/edit.rs b/crates/openrage-cli/src/cmd/edit.rs index bf1a3f8..0d43343 100644 --- a/crates/openrage-cli/src/cmd/edit.rs +++ b/crates/openrage-cli/src/cmd/edit.rs @@ -57,6 +57,7 @@ pub(crate) fn load_ytd( .with_context(|| format!("{path} is not a file inside an archive or an RSC8 resource"))?; Ok(rage_formats::ytd::parse_rdr2(&res)?) } + Node::Rpf9File(rpf, i) => openrage_app::textures::gta6_dictionary(&rpf, i), _ => bail!("{path} is not a file inside an archive"), } } diff --git a/crates/openrage-cli/src/cmd/search.rs b/crates/openrage-cli/src/cmd/search.rs index 8ffcd55..79e298f 100644 --- a/crates/openrage-cli/src/cmd/search.rs +++ b/crates/openrage-cli/src/cmd/search.rs @@ -9,9 +9,19 @@ pub(crate) fn open_index(game_dir: &Path) -> Result { pub(crate) fn cmd_index(game_dir: &Path, keys: Option>) -> Result<()> { let mut index = open_index(game_dir)?; + // A GTA VI archive reports each part of it: not a line for every one. + let mut last = (0, Instant::now()); let stats = index.update(game_dir, keys, &AtomicBool::new(false), &mut |p| { + if p.archives_done == last.0 && last.1.elapsed().as_secs() < 2 { + return; + } + last = (p.archives_done, Instant::now()); eprintln!(" [{}/{}] {} ({} entries)", p.archives_done, p.archives_total, p.current, p.entries); })?; + let names = openrage_app::rpf9::learn_names(&mut index)?; + if names > 0 { + outln!("Learned {names} names of GTA VI files from other archives."); + } let s = index.stats()?; outln!( "Indexed {} archives, removed {}, unchanged {} in {:.1}s ({} read errors).", @@ -62,7 +72,7 @@ pub(crate) fn cmd_search( .iter() .map(|hit| { let snippet = (hit.reason == rage_index::HitReason::Content) - .then(|| content_snippet(game_dir, &hit.vpath, &hit.name, &needle, keys.clone())) + .then(|| content_snippet(game_dir, &hit.vpath, &needle, keys.clone())) .flatten(); serde_json::json!({ "match": reason(&hit.reason), @@ -98,7 +108,7 @@ pub(crate) fn cmd_search( for hit in &results.hits { outln!("{:<5} {:>8} {}", reason(&hit.reason), human(hit.size), hit.vpath); if hit.reason == rage_index::HitReason::Content - && let Some(line) = content_snippet(game_dir, &hit.vpath, &hit.name, &needle, keys.clone()) + && let Some(line) = content_snippet(game_dir, &hit.vpath, &needle, keys.clone()) { outln!(" └ {line}"); } @@ -116,18 +126,38 @@ pub(crate) fn cmd_search( pub(crate) fn content_snippet( game_dir: &Path, vpath: &str, - name: &str, query: &str, keys: Option>, ) -> Option { - let Node::ArchiveFile(rpf, id) = vfs::resolve(game_dir, vpath, keys).ok()? else { return None }; - let data = rpf.read(id).ok()?; - let (text, _) = rage_index::content_for(name, &data)?; + let text = rage_index::node_text(&vfs::resolve(game_dir, vpath, keys).ok()?)?; rage_index::snippet(&text, query) } pub(crate) fn cmd_find(game_dir: &Path, within: &str, pattern: &str, keys: Option>) -> Result<()> { let needle = pattern.to_ascii_lowercase(); + match vfs::resolve(game_dir, within, keys.clone())? { + Node::Rpf9Dir(rpf, dir) => { + let prefix = within.trim_end_matches('/'); + let top = if dir.is_empty() { prefix } else { prefix[..prefix.len() - dir.len()].trim_end_matches('/') }; + return find_rpf9(&[(top.to_owned(), rpf, dir)], &needle); + } + Node::Dir(dir) if openrage_app::detect::is_gta6_dir(game_dir) => { + let mut found = Vec::new(); + collect_rpfs(&dir, &mut found); + let mut starts = Vec::new(); + for path in found.into_iter().filter(|p| rage_rpf::Rpf9::file_is_rpf9(p)) { + let rel = path.strip_prefix(game_dir).unwrap_or(&path).to_string_lossy().replace('\\', "/"); + // Asked one after the other: the first loads the keys. + match rage_rpf::Rpf9::open(&path) { + Ok(rpf) if rpf.is_native() => starts.push((rel, Arc::new(rpf), String::new())), + Ok(_) => eprintln!("warning: {rel}: its table cannot be read"), + Err(e) => eprintln!("warning: {e}"), + } + } + return find_rpf9(&starts, &needle); + } + _ => {} + } let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); @@ -163,3 +193,50 @@ pub(crate) fn cmd_find(game_dir: &Path, within: &str, pattern: &str, keys: Optio eprintln!("{hits} matches in {total} entries ({:.1}s)", started.elapsed().as_secs_f32()); Ok(()) } + +/// `find` in GTA VI archives and those inside them, below a folder of each. +fn find_rpf9(starts: &[(String, Arc, String)], needle: &str) -> Result<()> { + fn walk(prefix: &str, rpf: &rage_rpf::Rpf9, dir: &str, needle: &str) -> (usize, usize) { + let entries = match rpf.entries() { + Ok(entries) => entries, + Err(e) => { + eprintln!("warning: {e}"); + return (0, 0); + } + }; + let below = if dir.is_empty() { String::new() } else { format!("{dir}/") }; + entries + .par_iter() + .map(|e| { + let name = rpf.entry_name(e); + if !name.get(..below.len()).is_some_and(|start| start.eq_ignore_ascii_case(&below)) { + return (0, 0); + } + let path = format!("{prefix}/{name}"); + let base = name.rsplit('/').next().unwrap_or(&name); + let mut found = (0, 1); + if base.to_ascii_lowercase().contains(needle) { + outln!("{path}"); + found.0 = 1; + } + if rpf.is_archive(e) { + match rpf.open_child(e) { + Ok(child) => { + let inside = walk(&path, &child, "", needle); + found = (found.0 + inside.0, found.1 + inside.1); + } + Err(e) => eprintln!("warning: {e}"), + } + } + found + }) + .reduce(|| (0, 0), |a, b| (a.0 + b.0, a.1 + b.1)) + } + let started = Instant::now(); + let (hits, total) = starts + .iter() + .map(|(prefix, rpf, dir)| walk(prefix, rpf, dir, needle)) + .fold((0, 0), |a, b| (a.0 + b.0, a.1 + b.1)); + eprintln!("{hits} matches in {total} entries ({:.1}s)", started.elapsed().as_secs_f32()); + Ok(()) +} diff --git a/crates/openrage-cli/src/cmd/verify.rs b/crates/openrage-cli/src/cmd/verify.rs index ac53328..d76c4cb 100644 --- a/crates/openrage-cli/src/cmd/verify.rs +++ b/crates/openrage-cli/src/cmd/verify.rs @@ -1,4 +1,4 @@ -//! `openrage verify`: every file of a kind in the whole GTA V game. +//! `openrage verify`: archive data and game-specific formats. use crate::*; @@ -183,10 +183,14 @@ pub(crate) fn cmd_verify_media(game_dir: &Path, within: &str, keys: Option String { /// Per archive: files, clips, animations, frame-count mismatches, bad values, errors. pub(crate) type AnimStats = (usize, usize, usize, usize, usize, Vec); +/// Reads every GTA VI clip dictionary (`.#cd`) below a path, archives inside +/// included, and checks its values. An animation that does not add up is an +/// error of the reader already. +fn verify_gta6_animations(node: Node, within: &str) -> Result<()> { + use rayon::prelude::*; + let started = Instant::now(); + /// The clip dictionaries of an archive and the archives inside. + fn collect( + rpf: Arc, + dir: &str, + out: &mut Vec<(Arc, usize)>, + errors: &mut Vec, + ) { + let entries = match rpf.entries() { + Ok(entries) => entries, + Err(e) => return errors.push(format!("{}: {e}", rpf.display_name())), + }; + let prefix = if dir.is_empty() { String::new() } else { format!("{}/", dir.to_ascii_lowercase()) }; + for (i, e) in entries.iter().enumerate() { + let name = rpf.entry_name(e).to_ascii_lowercase(); + if !name.starts_with(&prefix) { + continue; + } + if name.ends_with(".#cd") { + out.push((Arc::clone(&rpf), i)); + } else if rpf.is_archive(e) { + match rpf.open_child(e) { + Ok(child) => collect(Arc::new(child), "", out, errors), + Err(e) => errors.push(e.to_string()), + } + } + } + } + let (mut files, mut errors) = (Vec::new(), Vec::new()); + match node { + Node::Rpf9Dir(rpf, dir) => collect(rpf, &dir, &mut files, &mut errors), + Node::Rpf9File(rpf, i) => files.push((rpf, i)), + _ => bail!("{within}: not a GTA VI archive"), + } + let check = |(rpf, i): &(Arc, usize)| -> Result<(usize, usize, usize, usize, usize)> { + let (system, graphics) = openrage_app::rpf9::resource(rpf, *i)?; + let dict = rage_formats::clip6::parse(&rage_resource::Resource { version: 0, system, graphics })?; + let (mut tracks, mut values, mut bad) = (0, 0, 0); + for a in &dict.animations { + tracks += a.tracks.len(); + for (t, track) in a.tracks.iter().enumerate() { + for f in (0..a.frames).step_by(7) { + let Some(v) = a.value(t, f as f32) else { bail!("a track without values") }; + values += 1; + let norm = v.iter().map(|x| x * x).sum::().sqrt(); + if v.iter().any(|x| !x.is_finite()) || (track.format == 1 && !(0.99..=1.01).contains(&norm)) { + bad += 1; + } + } + } + } + Ok((dict.clips.len(), dict.animations.len(), tracks, values, bad)) + }; + let results: Vec<_> = files + .par_iter() + .map(|file| { + check(file).map_err(|e| { + let name = file.0.entries().ok().and_then(|es| es.get(file.1).map(|e| file.0.entry_name(e))); + format!("{}/{}: {e:#}", file.0.display_name(), name.unwrap_or_default()) + }) + }) + .collect(); + let mut total = [0usize; 5]; + for r in results { + match r { + Ok((clips, animations, tracks, values, bad)) => { + for (sum, n) in total.iter_mut().zip([clips, animations, tracks, values, bad]) { + *sum += n; + } + } + Err(e) => errors.push(e), + } + } + for e in errors.iter().take(40) { + outln!("FAIL {e}"); + } + outln!( + "{} clip dictionaries, {} clips, {} animations, {} tracks; {} values checked, {} bad; {} errors ({:.1}s)", + files.len(), + total[0], + total[1], + total[2], + total[3], + total[4], + errors.len(), + started.elapsed().as_secs_f32() + ); + if !errors.is_empty() || total[4] > 0 { + bail!("verification found {} errors", errors.len() + total[4]); + } + Ok(()) +} + pub(crate) fn cmd_verify_animations(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { + if let node @ (Node::Rpf9Dir(..) | Node::Rpf9File(..)) = vfs::resolve(game_dir, within, keys.clone())? { + return verify_gta6_animations(node, within); + } let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); let (all, nested) = for_each_entry_parallel( @@ -1414,6 +1519,11 @@ pub(crate) struct VerifyStats { } pub(crate) fn cmd_verify(game_dir: &Path, within: &str, keys: Option>) -> Result<()> { + match vfs::resolve(game_dir, within, keys.clone())? { + node @ (Node::Rpf9Dir(..) | Node::Rpf9File(..)) => return verify_rpf9(node, within), + node @ Node::Dir(_) if openrage_app::detect::is_gta6_dir(game_dir) => return verify_rpf9(node, within), + _ => {} + } let starts = archive_roots(game_dir, within, keys)?; let started = Instant::now(); let (stats, nested) = for_each_entry_parallel_reporting( @@ -1465,3 +1575,144 @@ pub(crate) fn cmd_verify(game_dir: &Path, within: &str, keys: Option Result<()> { + let started = Instant::now(); + let mut total = VerifyStats::default(); + match node { + Node::Rpf9Dir(rpf, dir) => verify_rpf9_archive(&rpf, &dir, None, &mut total)?, + Node::Rpf9File(rpf, i) => verify_rpf9_archive(&rpf, "", Some(i), &mut total)?, + Node::Dir(dir) => { + let mut found = Vec::new(); + collect_rpfs(&dir, &mut found); + for path in found.into_iter().filter(|p| rage_rpf::Rpf9::file_is_rpf9(p)) { + match rage_rpf::Rpf9::open(&path) + .map_err(anyhow::Error::from) + .and_then(|rpf| verify_rpf9_archive(&rpf, "", None, &mut total)) + { + Ok(()) => {} + Err(e) => total.errors.push(format!("{}: {e:#}", path.display())), + } + } + } + _ => bail!("{within}: not an RPF9 recovery path"), + } + if total.archives == 0 && total.errors.is_empty() { + bail!("{within}: no RPF9 archives found"); + } + for error in &total.errors { + outln!("FAIL {error}"); + } + outln!( + "{} RPF9 archives, {} files checked, {} decoded, {} errors ({:.1}s)", + total.archives, + total.files, + human(total.bytes), + total.errors.len(), + started.elapsed().as_secs_f32() + ); + outln!( + "For archives whose own table is not read, this checks zlib decoding, entry bounds and unpacked sizes. Original names, encrypted table of contents and undiscovered data are not verified; raw audio/video checks do not validate their media contents." + ); + if !total.errors.is_empty() { + bail!("verification found {} errors", total.errors.len()); + } + Ok(()) +} + +fn verify_rpf9_archive(rpf: &rage_rpf::Rpf9, dir: &str, file: Option, total: &mut VerifyStats) -> Result<()> { + let entries = rpf.entries()?; + total.archives += 1; + let coverage = openrage_app::rpf9::coverage(rpf, &entries); + outln!( + "{}: {}: {} files, {} stored of {} data, {} unread (includes padding)", + rpf.display_name(), + if rpf.is_native() { "archive table" } else { "recovery coverage" }, + coverage.files, + human(coverage.stored), + human(rpf.data_len()), + human(coverage.unread) + ); + if file.is_some_and(|i| i >= entries.len()) { + bail!("invalid recovery entry index"); + } + let prefix = + if dir.is_empty() { String::new() } else { format!("{}/", dir.trim_matches('/').to_ascii_lowercase()) }; + for (i, entry) in entries.iter().enumerate() { + let name = rpf.entry_name(entry); + if file.map_or_else(|| !name.to_ascii_lowercase().starts_with(&prefix), |selected| selected != i) { + continue; + } + total.files += 1; + match rpf.copy_to(entry, &mut std::io::sink()) { + Ok(bytes) if bytes == entry.size => total.bytes += bytes, + Ok(bytes) => total.errors.push(format!( + "{}/{name}: expected {} unpacked bytes, read {bytes}", + rpf.display_name(), + entry.size + )), + Err(error) => total.errors.push(format!("{}/{name}: {error}", rpf.display_name())), + } + } + Ok(()) +} + +#[cfg(test)] +mod rpf9_tests { + use super::*; + + fn archive(name: &str) -> (PathBuf, rage_rpf::Rpf9) { + let dir = std::env::temp_dir().join(format!("openrage-cli-rpf9-{}-{name}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + fs::create_dir_all(&dir).unwrap(); + let mut bytes = vec![0u8; 64]; + bytes[..4].copy_from_slice(b"9FPR"); + bytes[4..8].copy_from_slice(&64u32.to_le_bytes()); + // A complete zlib stream containing "hello", followed by alignment. + bytes.extend_from_slice(b"\x78\x9c\xcb\x48\xcd\xc9\xc9\x07\x00\x06\x2c\x02\x15"); + bytes.resize(80, 0); + let path = dir.join("common.rpf"); + fs::write(&path, bytes).unwrap(); + (dir, rage_rpf::Rpf9::open(&path).unwrap()) + } + + #[test] + fn verifies_recovered_paths_and_skips_other_archive_formats() { + let (dir, rpf) = archive("paths"); + fs::write(dir.join(openrage_app::detect::GTA6_EXE), b"MZ").unwrap(); + fs::write(dir.join("other.rpf"), b"not RPF9").unwrap(); + fs::create_dir(dir.join("empty")).unwrap(); + assert!(cmd_verify(&dir, "empty", None).is_err()); + let entries = rpf.entries().unwrap(); + assert_eq!(entries.len(), 1); + assert_eq!(entries[0].size, 5); + let name = rpf.entry_name(&entries[0]); + assert!(cmd_verify(&dir, "", None).is_ok()); + assert!(cmd_verify(&dir, "common.rpf", None).is_ok()); + assert!(cmd_verify(&dir, "common.rpf/txt", None).is_ok()); + assert!(cmd_verify(&dir, &format!("common.rpf/{name}"), None).is_ok()); + let mut stats = VerifyStats::default(); + verify_rpf9_archive(&rpf, "txt", None, &mut stats).unwrap(); + assert_eq!((stats.archives, stats.files, stats.bytes), (1, 1, 5)); + assert!(stats.errors.is_empty()); + fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn detects_corrupted_data_against_a_recovery_index() { + let (dir, rpf) = archive("corrupt"); + let entries = rpf.entries().unwrap(); + assert_eq!(entries.len(), 1); + // Keep the already-recovered index, then break the stream checksum. + let mut bytes = fs::read(rpf.path()).unwrap(); + bytes[76] ^= 1; + fs::write(rpf.path(), bytes).unwrap(); + let mut stats = VerifyStats::default(); + verify_rpf9_archive(&rpf, "", Some(0), &mut stats).unwrap(); + assert_eq!((stats.files, stats.errors.len()), (1, 1)); + assert!(verify_rpf9(Node::Rpf9Dir(Arc::new(rpf), String::new()), "common.rpf").is_err()); + fs::remove_dir_all(dir).unwrap(); + } +} diff --git a/crates/openrage-cli/src/cmd/view.rs b/crates/openrage-cli/src/cmd/view.rs index 0f501a6..d8d585c 100644 --- a/crates/openrage-cli/src/cmd/view.rs +++ b/crates/openrage-cli/src/cmd/view.rs @@ -130,17 +130,29 @@ pub(crate) fn cmd_map( ) -> Result<()> { use openrage_app::world; let started = Instant::now(); - let w = world::load(game_dir, keys.clone())?; - let files = world::files(game_dir)?; - if check { - return check_maps(game_dir, &w, &files, keys, started); - } - let path = path.context("which map file? (or --check for all)")?; - let scene = world::load_map(&w, &files, game_dir, keys, path, &|done, total| { - if done % 25 == 0 || done == total { - eprint!("\rloading models: {done}/{total}"); + let show = |what: &str, done: usize, total: usize| { + if done.is_multiple_of(25) || done == total { + eprint!("\r{what}: {done}/{total} "); } - })?; + }; + let scene = if openrage_app::detect::is_gta6_dir(game_dir) { + if check { + bail!("--check is not supported for GTA VI yet"); + } + match path { + Some(path) => openrage_app::gta6_world::place(game_dir, path, openrage_app::gta6_world::AROUND, &show)?, + None => openrage_app::gta6_world::overview(game_dir, &show)?, + } + } else { + let w = world::load(game_dir, keys.clone())?; + let files = world::files(game_dir)?; + if check { + return check_maps(game_dir, &w, &files, keys, started); + } + let path = path.context("which map file? (or --check for all)")?; + world::load_map(&w, &files, game_dir, keys, path, &|done, total| show("loading models", done, total))? + }; + let path = path.unwrap_or("map"); eprintln!(); let placed: usize = scene.models.iter().map(|(_, _, t)| t.len()).sum(); outln!( @@ -421,10 +433,19 @@ pub(crate) fn cmd_clips(game_dir: &Path, path: &str, clip: Option<&str>, keys: O if t < 12 { let first = vals.first().copied().unwrap_or_default(); let mid = vals.get(vals.len() / 2).copied().unwrap_or_default(); + // GTA VI names bones and tracks by hash. + let name = if tr.bone_hash != 0 || tr.kind_hash != 0 { + let kind = rage_formats::clip6::kind_name(tr.kind_hash); + format!( + "{:08x} {}", + tr.bone_hash, + kind.map_or_else(|| format!("{:08x}", tr.kind_hash), str::to_owned) + ) + } else { + format!("{:04x} track {}", tr.bone, tr.track) + }; outln!( - " bone {:04x} track {} fmt {}: f0 [{:.3} {:.3} {:.3} {:.3}] mid [{:.3} {:.3} {:.3} {:.3}]", - tr.bone, - tr.track, + " bone {name} fmt {}: f0 [{:.3} {:.3} {:.3} {:.3}] mid [{:.3} {:.3} {:.3} {:.3}]", tr.format, first[0], first[1], @@ -491,6 +512,49 @@ pub(crate) fn cmd_audio(game_dir: &Path, path: &str, export: Option<&Path>, keys Ok(()) } +/// GTA VI: what a texture pool holds, and its textures as PNG. +pub(crate) fn cmd_ttpf( + path: &Path, + export: Option<&Path>, + from: usize, + count: Option, + max_side: Option, +) -> Result<()> { + let pool = rage_formats::ttpf::Pool::open(path)?; + outln!("{}: {} textures", path.display(), pool.len()); + if let Some(dir) = export { + fs::create_dir_all(dir)?; + } + let started = Instant::now(); + let (mut read, mut full) = (0u32, 0u32); + let mut skipped: std::collections::BTreeMap = Default::default(); + for index in (from..pool.len()).take(count.unwrap_or(usize::MAX)) { + let d = *pool.descriptor(index).context("texture")?; + let texture = match pool.texture(index, max_side) { + Ok(t) => t, + Err(e) => { + *skipped.entry(e.to_string()).or_default() += 1; + continue; + } + }; + read += 1; + full += u32::from(texture.width == d.width && texture.height == d.height); + let Some(dir) = export else { continue }; + match texture.to_rgba() { + Some(rgba) => fs::write( + dir.join(format!("{index:06}.png")), + rage_formats::png(texture.width, texture.height, &rgba)?, + )?, + None => *skipped.entry(format!("no decoder for format {}", texture.format.name())).or_default() += 1, + } + } + outln!("Read: {read} ({full} at full size) in {} ms", started.elapsed().as_millis()); + for (reason, n) in skipped { + outln!("Not read: {n} — {reason}"); + } + Ok(()) +} + pub(crate) fn cmd_xml( game_dir: &Path, path: &str, @@ -543,16 +607,54 @@ pub(crate) fn cmd_xml( Ok(()) } -pub(crate) fn cmd_media(game_dir: &Path, path: &str, swf: Option<&Path>, keys: Option>) -> Result<()> { +pub(crate) fn cmd_media( + game_dir: &Path, + path: &str, + frames: Option<&Path>, + every: usize, + wav: Option<&Path>, + swf: Option<&Path>, + keys: Option>, +) -> Result<()> { let (node, _) = rage_mods::resolve(game_dir, path, keys)?; let data = match node { Node::ArchiveFile(rpf, id) => rpf.read(id)?, Node::PlainFile(p) => fs::read(p)?, + Node::Rpf8File(rpf, i) => { + rpf.read(rpf.entries().and_then(|e| e.get(i)).context("archive table not readable")?)? + } + Node::Rpf9File(rpf, i) => rpf.read_at(i)?, + Node::Gta4File(a, id) => a.read(id)?, _ => bail!("{path} is not a file"), }; - for (k, v) in openrage_app::media::rows(path, &data)? { + for (k, v) in openrage_app::media::rows(&data)? { outln!("{k:<14}{v}"); } + if let Some(dir) = frames { + let mut player = rage_formats::bink::Player::new(&data)?; + fs::create_dir_all(dir)?; + let total = player.video.frames(); + for i in 0..total { + player.advance().with_context(|| format!("frame {i}"))?; + if i % every.max(1) == 0 { + let f = player.frame(); + fs::write(dir.join(format!("{i:05}.png")), rage_formats::png(f.width, f.height, &f.rgba())?)?; + } + } + outln!("Wrote {} of {total} frames to {}", total.div_ceil(every.max(1)), dir.display()); + } + if let Some(out) = wav { + let video = rage_formats::bink::read(&data)?; + if video.tracks.is_empty() { + bail!("{path} has no sound"); + } + for i in 0..video.tracks.len() { + let Some(pcm) = video.sound(&data, i) else { continue }; + let file = if i == 0 { out.to_path_buf() } else { out.with_extension(format!("{}.wav", i + 1)) }; + fs::write(&file, pcm?.to_wav())?; + outln!("Wrote {}", file.display()); + } + } if let Some(out) = swf { fs::write(out, rage_formats::media::gfx_to_swf(&data)?)?; outln!("Wrote {}", out.display()); diff --git a/crates/openrage-cli/src/main.rs b/crates/openrage-cli/src/main.rs index 5fbedd6..b730329 100644 --- a/crates/openrage-cli/src/main.rs +++ b/crates/openrage-cli/src/main.rs @@ -107,6 +107,10 @@ fn run() -> Result<()> { return Ok(()); } + if let Command::Ttpf { path, export, from, count, max_side } = &cli.command { + return cmd_ttpf(path, export.as_deref(), *from, *count, *max_side); + } + if let Command::Rpf8 { path, list, textures, models, text, meta, rebuild, audio, anims } = &cli.command { let checks = Checks { textures: *textures, @@ -159,10 +163,30 @@ fn run() -> Result<()> { eprintln!("warning: {e}"); None }); + // GTA VI archives are read through once to find their files; say so. + openrage_app::rpf9::register(Arc::new(|step| { + use std::io::IsTerminal; + static SHOWN: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(u64::MAX); + let err = std::io::stderr(); + match step { + Some((name, 0, _)) => { + eprintln!("Indexing {name}: reading the whole archive once, the result is kept for next time."); + } + Some((_, done, total)) if err.is_terminal() && total > 0 => { + let percent = done * 100 / total; + if SHOWN.swap(percent, std::sync::atomic::Ordering::Relaxed) != percent { + eprint!("\r{percent:>3} %"); + } + } + None if err.is_terminal() => eprint!("\r \r"), + _ => {} + } + })); match cli.command { Command::Keys { .. } | Command::Rpf8 { .. } + | Command::Ttpf { .. } | Command::Rdr2Keys { .. } | Command::Rdr2Names { .. } | Command::Licenses { .. } => { @@ -172,6 +196,46 @@ fn run() -> Result<()> { Command::Info { path } => cmd_info(&game_dir, &path, keys), Command::Extract { path, out, expand_archives } => cmd_extract(&game_dir, &path, &out, expand_archives, keys), Command::Find { pattern, r#in } => cmd_find(&game_dir, &r#in, &pattern, keys), + Command::Verify { + path, + textures, + models, + audio, + animations, + meta, + text, + particles, + collisions, + paths, + scripts, + media, + cutscenes, + rebuild, + openformats, + } if openrage_app::detect::is_gta6_dir(&game_dir) => { + if textures + || models + || audio + || meta + || text + || particles + || collisions + || paths + || scripts + || media + || cutscenes + || rebuild + || openformats + { + bail!( + "GTA VI verification checks archive data, or clip dictionaries with --animations; use `verify ` without other format or rebuild flags" + ); + } + if animations { + return cmd_verify_animations(&game_dir, &path, keys); + } + cmd_verify(&game_dir, &path, keys) + } Command::Verify { path, models: true, .. } if gta4 => cmd_verify_gta4_models(&game_dir, &path), Command::Verify { path, models: true, openformats: true, .. } => cmd_verify_openformats(&game_dir, &path, keys), Command::Verify { path, models: true, rebuild: true, .. } => cmd_verify_model_writer(&game_dir, &path, keys), @@ -269,7 +333,9 @@ fn run() -> Result<()> { outln!("Imported {n} native names; script disassemblies now show them."); Ok(()) } - Command::Media { path, swf } => cmd_media(&game_dir, &path, swf.as_deref(), keys), + Command::Media { path, frames, every, wav, swf } => { + cmd_media(&game_dir, &path, frames.as_deref(), every, wav.as_deref(), swf.as_deref(), keys) + } Command::Script { path, out, strings } => cmd_script(&game_dir, &path, out.as_deref(), strings, keys), Command::Particles { path } => cmd_particles(&game_dir, &path, keys), Command::Text { path, out, import: None } => cmd_text(&game_dir, &path, out.as_deref(), keys), diff --git a/crates/openrage-gui/src/audio.rs b/crates/openrage-gui/src/audio.rs index 2db2c76..df07708 100644 --- a/crates/openrage-gui/src/audio.rs +++ b/crates/openrage-gui/src/audio.rs @@ -1,16 +1,76 @@ //! Playing decoded sounds and drawing their waveform. +use std::cell::Cell; use std::num::NonZero; use std::sync::Arc; -use std::time::Duration; +use std::time::{Duration, Instant}; use rage_formats::awc::Pcm; -/// The audio output, opened on first use and kept while sounds play. +/// Plays decoded samples without copying them. +struct Samples { + pcm: Arc, + next: usize, +} + +impl Samples { + fn channel_count(&self) -> usize { + self.pcm.channels.max(1) as usize + } +} + +impl Iterator for Samples { + type Item = rodio::Sample; + + fn next(&mut self) -> Option { + let sample = *self.pcm.samples.get(self.next)?; + self.next += 1; + Some(rodio::Sample::from(sample) / 32768.0) + } + + fn size_hint(&self) -> (usize, Option) { + let left = self.pcm.samples.len().saturating_sub(self.next); + (left, Some(left)) + } +} + +impl rodio::Source for Samples { + fn current_span_len(&self) -> Option { + None + } + + fn channels(&self) -> NonZero { + NonZero::new(self.pcm.channels).unwrap_or(NonZero::::MIN) + } + + fn sample_rate(&self) -> NonZero { + NonZero::new(self.pcm.sample_rate).unwrap_or(NonZero::::MIN) + } + + fn total_duration(&self) -> Option { + Some(Duration::from_secs_f32(self.pcm.duration_secs())) + } + + fn try_seek(&mut self, pos: Duration) -> Result<(), rodio::source::SeekError> { + let frame = (pos.as_secs_f64() * f64::from(self.pcm.sample_rate)) as usize; + self.next = frame.saturating_mul(self.channel_count()).min(self.pcm.samples.len()); + Ok(()) + } +} + +/// Something playing, opened on first use and kept while it plays. pub struct Output { - _sink: rodio::MixerDeviceSink, - player: rodio::Player, pcm: Arc, + player: Player, +} + +enum Player { + Device { + player: rodio::Player, + _sink: rodio::MixerDeviceSink, + }, + /// No sound: a clock. Where it stood, and since when it runs. + Clock(Cell<(Duration, Option)>), } impl Output { @@ -19,15 +79,17 @@ impl Output { let mut sink = rodio::DeviceSinkBuilder::open_default_sink().map_err(|e| e.to_string())?; sink.log_on_drop(false); let player = rodio::Player::connect_new(sink.mixer()); - let channels = NonZero::new(pcm.channels.max(1)).expect("non-zero"); - let rate = NonZero::new(pcm.sample_rate.max(1)).expect("non-zero"); - let samples: Vec = pcm.samples.iter().map(|&s| s as rodio::Sample / 32768.0).collect(); - player.append(rodio::buffer::SamplesBuffer::new(channels, rate, samples)); + player.append(Samples { pcm: Arc::clone(&pcm), next: 0 }); if !start.is_zero() { let _ = player.try_seek(start); } player.play(); - Ok(Self { _sink: sink, player, pcm }) + Ok(Self { pcm, player: Player::Device { player, _sink: sink } }) + } + + /// The same without sound, for what is not only heard. + pub fn silent(pcm: Arc, start: Duration) -> Self { + Self { pcm, player: Player::Clock(Cell::new((start, Some(Instant::now())))) } } pub fn pcm(&self) -> &Arc { @@ -35,27 +97,56 @@ impl Output { } pub fn is_playing(&self) -> bool { - !self.player.is_paused() && !self.player.empty() + match &self.player { + Player::Device { player: p, .. } => !p.is_paused() && !p.empty(), + Player::Clock(c) => c.get().1.is_some() && !self.finished(), + } } pub fn finished(&self) -> bool { - self.player.empty() + match &self.player { + Player::Device { player: p, .. } => p.empty(), + Player::Clock(_) => self.position().as_secs_f32() >= self.pcm.duration_secs(), + } } pub fn pause(&self) { - self.player.pause(); + match &self.player { + Player::Device { player: p, .. } => p.pause(), + Player::Clock(c) => c.set((self.position(), None)), + } } pub fn resume(&self) { - self.player.play(); + match &self.player { + Player::Device { player: p, .. } => p.play(), + Player::Clock(c) => c.set((self.position(), Some(Instant::now()))), + } + } + + pub fn set_volume(&self, volume: f32) { + if let Player::Device { player: p, .. } = &self.player { + p.set_volume(volume); + } } pub fn seek(&self, pos: Duration) { - let _ = self.player.try_seek(pos); + match &self.player { + Player::Device { player: p, .. } => { + let _ = p.try_seek(pos); + } + Player::Clock(c) => c.set((pos, c.get().1.map(|_| Instant::now()))), + } } pub fn position(&self) -> Duration { - self.player.get_pos() + match &self.player { + Player::Device { player: p, .. } => p.get_pos(), + Player::Clock(c) => { + let (at, since) = c.get(); + at + since.map_or(Duration::ZERO, |s| s.elapsed()) + } + } } } @@ -89,3 +180,31 @@ pub fn waveform(pcm: &Pcm, width: usize, height: usize, color: [u8; 3]) -> Vec Color { pub const NEUTRAL: Color = rgb(0x7C8592); fn extension(name: &str) -> String { - name.rsplit_once('.').map(|(_, e)| e.to_ascii_lowercase()).unwrap_or_default() + let ext = name.rsplit_once('.').map(|(_, e)| e.to_ascii_lowercase()).unwrap_or_default(); + // GTA VI's `#dr` is what GTA V's `ydr` was, and so on. + match ext.strip_prefix('#') { + Some(rest) => format!("y{rest}"), + None => ext, + } } /// Icon (a name known to the UI's `Icons.get`) and tint for a file, so @@ -42,15 +47,15 @@ fn core_icon(ext: &str) -> Option<(&'static str, Color)> { "ydr" | "ydd" | "yft" | "yld" | "wdr" | "wdd" | "wft" => ("model", rgb(0x3B82F6)), "ypt" => ("particles", rgb(0xE0679B)), "ybn" | "wbn" | "wbd" => ("collision", rgb(0x14A08F)), - "ynv" | "ynd" | "yvr" | "ywr" | "nod" => ("path", rgb(0x14A08F)), + "ynv" | "ynvs" | "ycov" | "ynd" | "yvr" | "ywr" | "nod" => ("path", rgb(0x14A08F)), "ymap" | "wpl" | "ytyp" | "ipl" | "ide" => ("map", rgb(0x2FA866)), - "ymt" | "ymf" | "meta" | "xml" | "dat" | "json" | "pso" => ("data", rgb(0x2FA866)), + "ymt" | "ymf" | "yhdat" | "ymsk" | "ykit" | "meta" | "xml" | "dat" | "json" | "pso" => ("data", rgb(0x2FA866)), "cut" => ("anim", rgb(0xDB4F8A)), "txt" | "log" | "ini" | "cfg" => ("text", rgb(0x7C8592)), - "ycd" | "yed" => ("anim", rgb(0xDB4F8A)), + "ycd" | "yed" | "yas" | "yascd" | "ysmm" => ("anim", rgb(0xDB4F8A)), "awc" | "rel" | "dat151" | "dat54" | "dat4" | "dat10" | "dat15" | "dat16" | "dat22" => ("audio", rgb(0xDB4F8A)), - "ysc" | "sco" | "asi" | "dll" | "lua" | "cs" => ("script", rgb(0xE05252)), - "gxt2" | "gxt" => ("lang", rgb(0x5B76DE)), + "ysc" | "yscript" | "sco" | "asi" | "dll" | "lua" | "cs" => ("script", rgb(0xE05252)), + "gxt2" | "gxt" | "yldb" | "yldbmt" => ("lang", rgb(0x5B76DE)), "oiv" | "orp" | "zip" | "7z" | "rar" => ("package", rgb(0xD9822B)), _ => return None, }) @@ -96,6 +101,7 @@ pub fn type_name(name: &str, kind: ItemKind) -> String { } else if ext.is_empty() { "File".into() } else { + let ext = name.rsplit_once('.').map_or(ext.as_str(), |(_, e)| e); format!("{} file", ext.to_ascii_uppercase()) } } @@ -110,7 +116,11 @@ fn known_name(ext: &str) -> &'static str { "ypt" => "Particles", "ybn" | "wbn" => "Bounds", "wbd" => "Bounds dict", - "ynv" => "Nav mesh", + "ynv" | "ynvs" => "Nav mesh", + "ycov" => "Cover", + "yscript" => "Script", + "yldb" | "yldbmt" => "Text table", + "yhdat" => "Height data", "ynd" => "Path nodes", "ymap" | "wpl" => "Map placement", "ytyp" => "Archetypes", @@ -125,7 +135,7 @@ fn known_name(ext: &str) -> &'static str { "awc" => "Audio container", "gxt2" | "gxt" => "Text table", "gfx" => "Scaleform movie", - "bik" => "Bink video", + "bik" | "bk2" => "Bink video", "nametable" => "Name table", "ugc" => "UGC (JSON)", "orp" => "OpenRAGE plugin", diff --git a/crates/openrage-gui/src/browser.rs b/crates/openrage-gui/src/browser.rs index 5e090dc..4b839d3 100644 --- a/crates/openrage-gui/src/browser.rs +++ b/crates/openrage-gui/src/browser.rs @@ -82,6 +82,8 @@ pub enum Location { Archive(Arc, EntryId), /// A folder inside a Red Dead Redemption 2 archive (read-only). Rpf8(Arc, String), + /// A folder of a GTA VI archive (read-only). + Rpf9(Arc, String), /// A folder inside a GTA IV archive (`.img`, RPF2/RPF3; read-only). Gta4(Arc, rage_rpf::Gta4EntryId), /// Results of a search; `summary` describes hash lookups etc. @@ -108,6 +110,12 @@ pub enum Location { }, } +/// Whether a file name is a video the preview plays. +pub fn is_video(name: &str) -> bool { + let lower = name.to_ascii_lowercase(); + lower.ends_with(".bk2") || lower.ends_with(".bik") +} + /// Whether a file name is an audio container that can be opened like a folder. pub fn is_audio(name: &str) -> bool { name.to_ascii_lowercase().ends_with(".awc") @@ -116,7 +124,72 @@ pub fn is_audio(name: &str) -> bool { /// Whether a file name is a texture dictionary that can be opened like a folder. pub fn is_texture_dict(name: &str) -> bool { let lower = name.to_ascii_lowercase(); - lower.ends_with(".ytd") || lower.ends_with(".ypt") || lower.ends_with(".wtd") + lower.ends_with(".ytd") || lower.ends_with(".ypt") || lower.ends_with(".wtd") || lower.ends_with(".#td") +} + +/// GTA VI texture pools (`.ttpf`): they open as folders of [`POOL_PAGE`] +/// textures each. +pub fn is_texture_pool(name: &str) -> bool { + name.to_ascii_lowercase().ends_with(".ttpf") +} + +/// Textures per folder of a texture pool: as many as are read at once. +const POOL_PAGE: usize = 64; + +/// For `…/pool.ttpf/000128-000191`: the pool's path and the first texture. +fn pool_page(vpath: &str) -> Option<(&str, usize)> { + let (pool, page) = vpath.rsplit_once('/')?; + let (from, to) = page.split_once('-')?; + let numeric = |s: &str| s.len() == 6 && s.bytes().all(|b| b.is_ascii_digit()); + (is_texture_pool(pool) && numeric(from) && numeric(to)).then(|| Some((pool, from.parse().ok()?))).flatten() +} + +fn pool_error(vpath: &str, e: rage_formats::ttpf::TtpfError) -> RpfError { + RpfError::BadResource { path: vpath.to_owned(), reason: e.to_string() } +} + +/// A texture pool: its pages as folders. +fn list_pool(vpath: String, file: &Path, origin: Origin) -> Result { + let pool = rage_formats::ttpf::Pool::open(file).map_err(|e| pool_error(&vpath, e))?; + let items = (0..pool.len()) + .step_by(POOL_PAGE) + .map(|from| { + let to = (from + POOL_PAGE).min(pool.len()) - 1; + Item { + name: format!("{from:06}-{to:06}"), + kind: ItemKind::Dir, + size: 0, + info: format!("{} textures", to - from + 1), + entry: None, + vpath: None, + mark: None, + detail: None, + } + }) + .collect(); + Ok(Listing { vpath, origin, location: Location::Disk(file.to_path_buf()), items }) +} + +/// A page of a texture pool as a texture dictionary (read-only). Textures +/// that cannot be read are left out and counted in the dictionary's errors. +fn list_pool_page(vpath: String, file: &Path, from: usize, origin: Origin) -> Result { + let pool = rage_formats::ttpf::Pool::open(file).map_err(|e| pool_error(&vpath, e))?; + let (mut textures, mut errors) = (Vec::new(), Vec::new()); + for index in (from..pool.len()).take(POOL_PAGE) { + match pool.texture(index, None) { + Ok(t) => textures.push(t), + Err(e) => errors.push(format!("{index:06}: {e}")), + } + } + let dict = rage_formats::ytd::TextureDictionary { + textures, + errors, + layout: rage_formats::ytd::Layout::Enhanced, + version: 0, + root: Vec::new(), + stored: Vec::new(), + }; + Ok(texture_listing(vpath, dict, origin, true)) } /// Particle dictionaries open like texture dictionaries, read-only. @@ -244,6 +317,17 @@ pub fn list( let (listing, _) = list(game_dir, &dict_path, keys, overlay)?; return Ok((listing, Some(last_segment(&vpath)))); } + // `…/pool.ttpf/000000-000063`: a page of a GTA VI texture pool. + Err(_) if pool_page(&vpath).is_some() => { + let (pool, from) = pool_page(&vpath).unwrap_or_default(); + let (Node::PlainFile(file), origin) = resolve(pool)? else { return Err(RpfError::NotFound(vpath)) }; + return Ok((list_pool_page(vpath.clone(), &file, from, origin)?, None)); + } + // `…/pool.ttpf/000000-000063/000012`: that page, with the texture selected. + Err(_) if parent(&vpath).is_some_and(|p| pool_page(&p).is_some()) => { + let (listing, _) = list(game_dir, &parent(&vpath).unwrap_or_default(), keys, overlay)?; + return Ok((listing, Some(last_segment(&vpath)))); + } // `…/model/textures`: the textures inside a model (GTA IV .wdr, GTA V .ydr/.yft/.ydd). Err(RpfError::NotFound(_)) if model_of_textures(&vpath).is_some() => { let model = model_of_textures(&vpath).unwrap_or_default(); @@ -297,6 +381,18 @@ pub fn list( .map_err(|e| RpfError::BadResource { path: vpath.clone(), reason: format!("{e:#}") })?; Ok((audio_listing(vpath, awc, origin), None)) } + Node::PlainFile(file) if is_texture_pool(&vpath) => Ok((list_pool(vpath, &file, origin)?, None)), + Node::Rpf9Dir(rpf, dir) => Ok((list_rpf9(vpath, rpf, dir, origin)?, None)), + Node::Rpf9File(rpf, i) if is_texture_dict(&vpath) => { + let dict = openrage_app::textures::gta6_dictionary(&rpf, i) + .map_err(|e| RpfError::BadResource { path: vpath.clone(), reason: format!("{e:#}") })?; + Ok((texture_listing(vpath, dict, origin, true), None)) + } + Node::Rpf9File(rpf, i) if is_audio(&vpath) => { + let awc = rage_formats::awc::Awc::parse(rpf.read_at(i)?, None) + .map_err(|e| RpfError::BadResource { path: vpath.clone(), reason: format!("{e:#}") })?; + Ok((audio_listing(vpath, awc, origin), None)) + } Node::Gta4Dir(a, dir) => Ok((list_gta4(vpath, a, dir, origin), None)), // An RDR2 dictionary replaced in lml/replace: a loose RSC8 file. Node::PlainFile(p) if is_texture_dict(&vpath) && rage_mods::overlay::is_rdr2(game_dir) => { @@ -516,6 +612,7 @@ fn list_disk(vpath: String, dir: PathBuf, origin: Origin) -> Result, dir: String, origin: Origi Listing { vpath, origin, location: Location::Rpf8(rpf, dir), items } } +/// A folder of a GTA VI archive. In the recovery view files are named by their +/// offset, in folders by what they look like. +fn list_rpf9(vpath: String, rpf: Arc, dir: String, origin: Origin) -> Result { + let entries = rpf.entries()?; + let (dirs, files) = rpf.list_dir(&entries, &dir); + let item = |name: String, kind, size, info| Item { + name, + kind, + size, + info, + entry: None, + vpath: None, + mark: None, + detail: None, + }; + let mut items: Vec = dirs.into_iter().map(|name| item(name, ItemKind::Dir, 0, String::new())).collect(); + for i in files { + let e = &entries[i]; + let full = rpf.entry_name(e); + let info = match e.kind { + rage_rpf::rpf9::Kind::Bink2 => "video".to_owned(), + rage_rpf::rpf9::Kind::Awc => "sounds".to_owned(), + rage_rpf::rpf9::Kind::Zlib if e.streams > 1 => format!("{} chunks", e.streams), + _ => String::new(), + }; + // The entries known to be models open in the viewer. + let kind = if rpf.is_archive(e) { + ItemKind::Archive + } else if openrage_app::models::is_model(&full) || rpf.resource_parts(e).is_some() { + ItemKind::Resource + } else { + ItemKind::File + }; + items.push(item(full.rsplit('/').next().unwrap_or(&full).to_owned(), kind, e.size, info)); + } + Ok(Listing { vpath, origin, location: Location::Rpf9(rpf, dir), items }) +} + /// A folder of a GTA IV archive: its folders, files and resources. fn list_gta4(vpath: String, a: Arc, dir: rage_rpf::Gta4EntryId, origin: Origin) -> Listing { let items = a diff --git a/crates/openrage-gui/src/callbacks.rs b/crates/openrage-gui/src/callbacks.rs index bb72f06..02d61be 100644 --- a/crates/openrage-gui/src/callbacks.rs +++ b/crates/openrage-gui/src/callbacks.rs @@ -95,6 +95,7 @@ fn wire_files(ui: &AppWindow) { if ui.get_file_selected() == i && with_app(|a| a.selected.is_some()) { return; } + with_app(|a| a.play_when_ready = false); select_row(ui, i as usize) }) }); @@ -170,19 +171,44 @@ fn wire_files(ui: &AppWindow) { open_script_view(ui, vpath); return; } - let video = with_app(|a| { + let is_video = with_app(|a| { let listing = a.listing.as_ref()?; let item = &listing.items[*a.visible.get(i as usize)?]; - item.name - .to_ascii_lowercase() - .ends_with(".bik") - .then(|| item.vpath.clone().unwrap_or_else(|| browser::join(&listing.vpath, &item.name))) + Some(item.kind == ItemKind::File && browser::is_video(&item.name) && item.mark != Some(Mark::Removed)) }); - if let Some(vpath) = video { - // Video players built on FFmpeg (VLC, mpv, …) play Bink. - open_with_system(ui, vpath); + // Or a file without a name that turned out to be one. + if is_video == Some(true) || (ui.get_file_selected() == i && ui.get_video_mode()) { + if ui.get_file_selected() != i { + select_row(ui, i as usize); + } + player::open_selected(ui); + return; + } + if ui.get_file_selected() == i && ui.get_preview_loading() && may_be_video(i as usize) { + with_app(|a| a.play_when_ready = true); return; } + // An audio container with one sound: the row plays it (it is + // selected, so the sound is loaded or about to be). + let is_container = with_app(|a| { + let listing = a.listing.as_ref()?; + let item = &listing.items[*a.visible.get(i as usize)?]; + Some(item.kind == ItemKind::File && item.vpath.is_none() && browser::is_audio(&item.name)) + }); + if is_container == Some(true) { + if ui.get_file_selected() != i { + select_row(ui, i as usize); + } + if ui.get_audio_mode() { + toggle_sound(ui); + return; + } + // Still decoding; a container with several has its list by now. + if ui.get_preview_loading() { + with_app(|a| a.play_when_ready = true); + return; + } + } let is_ycd = with_app(|a| { let listing = a.listing.as_ref()?; Some(is_clip_dictionary(&listing.items[*a.visible.get(i as usize)?])) @@ -468,6 +494,7 @@ fn wire_settings(ui: &AppWindow) { accent::apply(&ui); } viewer::set_accent(); + player::set_accent(); editor::set_accent(); xmlview::set_accent(); history::set_accent(); @@ -481,6 +508,7 @@ fn wire_settings(ui: &AppWindow) { accent::apply(&ui); } viewer::set_accent(); + player::set_accent(); editor::set_accent(); xmlview::set_accent(); history::set_accent(); @@ -497,6 +525,7 @@ fn wire_settings(ui: &AppWindow) { with_app(|a| a.cfg.theme = Some(theme_name(mode).to_owned())); with_ui(&w, save_settings); viewer::set_theme(mode); + player::set_theme(mode); editor::set_theme(mode); xmlview::set_theme(mode); history::set_theme(mode); @@ -516,6 +545,14 @@ fn wire_settings(ui: &AppWindow) { /// Sound playback. fn wire_sound(ui: &AppWindow) { + let w = ui.as_weak(); + ui.on_open_world_map(move || with_ui(&w, |ui| scene::open_map(ui, String::new()))); + let w = ui.as_weak(); + ui.on_open_player(move || with_ui(&w, player::open_selected)); + let w = ui.as_weak(); + ui.on_index_stop(move || with_ui(&w, stop_index_update)); + let w = ui.as_weak(); + ui.on_index_resume(move || with_ui(&w, start_index_update)); let w = ui.as_weak(); ui.on_audio_toggle(move || with_ui(&w, toggle_sound)); let w = ui.as_weak(); @@ -687,6 +724,8 @@ fn wire_setup(ui: &AppWindow) { }); let w = ui.as_weak(); ui.on_setup_run(move || with_ui(&w, run_setup)); + let w = ui.as_weak(); + ui.on_setup_leave(move || with_ui(&w, leave_setup)); } pub(crate) fn theme_name(mode: i32) -> &'static str { @@ -744,6 +783,7 @@ pub(crate) fn row_action(ui: &AppWindow, row: usize, action: &str) { } match action { "open" => ui.invoke_file_open(row as i32), + "play" => player::open_selected(ui), "view" => open_viewer(ui), "edit" | "system" => { let vpath = with_app(|a| { diff --git a/crates/openrage-gui/src/debug.rs b/crates/openrage-gui/src/debug.rs index dfc34f5..e54cddc 100644 --- a/crates/openrage-gui/src/debug.rs +++ b/crates/openrage-gui/src/debug.rs @@ -1,5 +1,6 @@ //! Debug snapshots of the window (`OPENRAGE_DEBUG_*`), for checking the UI without a screen. +#[cfg(debug_assertions)] use crate::*; /// Development aid (debug builds only): `OPENRAGE_SNAPSHOT=out.png` saves an @@ -13,7 +14,9 @@ pub(crate) fn debug_snapshot(ui: &AppWindow) { } let Ok(path) = std::env::var("OPENRAGE_SNAPSHOT") else { return }; let weak = ui.as_weak(); - slint::Timer::single_shot(Duration::from_secs(5), move || { + // `OPENRAGE_SNAPSHOT_DELAY=`: for folders that open slowly. + let delay = std::env::var("OPENRAGE_SNAPSHOT_DELAY").ok().and_then(|s| s.parse().ok()).unwrap_or(5); + slint::Timer::single_shot(Duration::from_secs(delay), move || { let Some(ui) = weak.upgrade() else { return }; debug_viewer(&ui); if std::env::var("OPENRAGE_FLY").is_ok() @@ -54,6 +57,10 @@ pub(crate) fn debug_snapshot(ui: &AppWindow) { }); if let Some(row) = row { select_row(&ui, row); + // `OPENRAGE_PLAY=1` plays the selected sound or video. + if std::env::var("OPENRAGE_PLAY").is_ok() { + with_app(|a| a.play_when_ready = true); + } // `OPENRAGE_PLUGIN_RUN=` runs the selected file's n-th plugin action. if let Ok(i) = std::env::var("OPENRAGE_PLUGIN_RUN") { row_action(&ui, row, &format!("plugin:{i}")); @@ -206,6 +213,8 @@ pub(crate) fn debug_snapshot_rest(ui: &AppWindow, path: String) { let lower = map.to_ascii_lowercase(); if lower.ends_with(".wpl") || lower.ends_with(".img") { scene::open_map(ui, map); + } else if lower == "world" { + scene::open_map(ui, String::new()); // GTA VI's whole map } else { open_xml_view(ui, map); if let Some(x) = xmlview::newest() { @@ -215,12 +224,25 @@ pub(crate) fn debug_snapshot_rest(ui: &AppWindow, path: String) { let waiting = std::rc::Rc::new(slint::Timer::default()); let (started, timer) = (Instant::now(), std::rc::Rc::clone(&waiting)); waiting.start(slint::TimerMode::Repeated, Duration::from_millis(500), move || { - if !scene::ready() && started.elapsed() < Duration::from_secs(180) { + if !scene::ready() && started.elapsed() < Duration::from_secs(600) { return; } timer.stop(); let path = path.clone(); - slint::Timer::single_shot(Duration::from_millis(800), move || { + // `OPENRAGE_FLY_TO=x,y,z,yaw,pitch`, and `OPENRAGE_FLY_WAIT=` for the details to load. + let to: Vec = std::env::var("OPENRAGE_FLY_TO") + .map(|t| t.split(',').filter_map(|v| v.parse().ok()).collect()) + .unwrap_or_default(); + let mut wait = 800; + if let Ok(to) = <[f32; 5]>::try_from(to) { + scene::fly_to(to); + wait += std::env::var("OPENRAGE_FLY_WAIT").ok().and_then(|s| s.parse().ok()).unwrap_or(20) * 1000; + } + slint::Timer::single_shot(Duration::from_millis(wait), move || { + // `OPENRAGE_BENCH=`: how long they take. + if let Some(n) = std::env::var("OPENRAGE_BENCH").ok().and_then(|n| n.parse().ok()) { + scene::bench(n); + } if let Some(Ok(img)) = scene::newest().map(|w| w.window().take_snapshot()) { let _ = rage_formats::png(img.width(), img.height(), img.as_bytes()) .map(|png| std::fs::write(&path, png)); @@ -282,6 +304,7 @@ pub(crate) fn debug_snapshot_rest(ui: &AppWindow, path: String) { slint::Timer::single_shot(Duration::from_secs(wait), move || { let Some(ui) = weak.upgrade() else { return }; let snap = match (viewer::newest(), editor::newest(), history::window()) { + _ if let Some(p) = player::newest() => p.window().take_snapshot(), _ if let Some(x) = xmlview::newest() => { if let Ok(tab) = std::env::var("OPENRAGE_TAB") { x.set_tab(tab.parse().unwrap_or(0)); diff --git a/crates/openrage-gui/src/docs.rs b/crates/openrage-gui/src/docs.rs index 7c8dee8..e163d4a 100644 --- a/crates/openrage-gui/src/docs.rs +++ b/crates/openrage-gui/src/docs.rs @@ -7,7 +7,12 @@ pub(crate) fn read_file(ui: &AppWindow, vpath: &str) -> anyhow::Result> let _ = ui; let (game_dir, keys) = with_app(|a| (a.game_dir.clone(), a.keys.clone())); let game_dir = game_dir.ok_or_else(|| anyhow::anyhow!("no game folder"))?; - match rage_mods::resolve(&game_dir, vpath, keys)?.0 { + read_vpath(&game_dir, vpath, keys) +} + +/// Reads a file off the UI thread. +pub(crate) fn read_vpath(game_dir: &Path, vpath: &str, keys: Option>) -> anyhow::Result> { + match rage_mods::resolve(game_dir, vpath, keys)?.0 { Node::ArchiveFile(rpf, id) => Ok(rpf.read(id)?), Node::PlainFile(p) => Ok(std::fs::read(p)?), Node::Rpf8File(rpf, i) => { @@ -16,6 +21,7 @@ pub(crate) fn read_file(ui: &AppWindow, vpath: &str) -> anyhow::Result> Ok(rpf.read(entry)?) } Node::Gta4File(a, id) => Ok(a.read(id)?), + Node::Rpf9File(rpf, i) => Ok(rpf.read_at(i)?), _ => anyhow::bail!("{vpath} is not a file"), } } @@ -53,8 +59,25 @@ pub(crate) fn open_text_file(ui: &AppWindow, vpath: String) { open_text_data(ui, vpath, &data); } +/// A table of strings that each end with a zero byte (GTA VI keeps texts +/// that way), one string per line; `None` for anything else. +pub(crate) fn zero_ended_strings(data: &[u8]) -> Option> { + let text = std::str::from_utf8(data).ok()?; + let plain = |c: char| !c.is_control() || matches!(c, '\0' | '\t' | '\r' | '\n'); + (text.contains('\0') && text.chars().all(plain)).then(|| { + let lines: Vec = text.trim_end_matches('\0').split('\0').map(|s| s.replace('\n', "\\n")).collect(); + lines.join("\n").into_bytes() + }) +} + pub(crate) fn open_text_data(ui: &AppWindow, vpath: String, data: &[u8]) { - match editor::Document::from_file(vpath.clone(), data) { + let opened = editor::Document::from_file(vpath.clone(), data).or_else(|e| { + let mut doc = + zero_ended_strings(data).and_then(|lines| editor::Document::from_bytes(vpath.clone(), &lines)).ok_or(e)?; + doc.locked_reason = "A table of strings, shown one per line for reading.".into(); + Ok::<_, String>(doc) + }); + match opened { Ok(doc) => { editor::open(ui, doc); ui.set_status(SharedString::new()); @@ -146,10 +169,10 @@ pub(crate) fn open_script_view(ui: &AppWindow, vpath: String) { /// Reads a metadata file and converts it to XML. pub(crate) fn read_xml(ui: &AppWindow, vpath: &str) -> anyhow::Result { - // RDR2 keeps much of its metadata as resources, which the game's own + // RDR2 and GTA VI keep much of their metadata as resources, which the game's own // resolution reads; GTA V files are read like any other file. if let Some((dir, keys)) = with_app(|a| a.game_dir.clone().map(|d| (d, a.keys.clone()))) - && is_rdr2_dir(&dir) + && (is_rdr2_dir(&dir) || detect::is_gta6_dir(&dir)) { return openrage_app::metadata::load(&dir, keys, vpath); } diff --git a/crates/openrage-gui/src/extract_ui.rs b/crates/openrage-gui/src/extract_ui.rs index 23e0fd5..56ce5f1 100644 --- a/crates/openrage-gui/src/extract_ui.rs +++ b/crates/openrage-gui/src/extract_ui.rs @@ -61,6 +61,24 @@ pub(crate) fn start_extract(ui: &AppWindow) { }); return; } + // GTA VI: the selected file or folder of the recovery view, or the whole folder. + let gta6 = with_app(|a| { + let listing = a.listing.as_ref()?; + let Location::Rpf9(rpf, dir) = &listing.location else { return None }; + let item = a.selected.map(|s| &listing.items[s]); + let find = |name: &str| rpf.loaded().and_then(|entries| rpf.find(&entries, &browser::join(dir, name))); + Some(match item { + Some(item) if item.kind == ItemKind::Dir => (Arc::clone(rpf), browser::join(dir, &item.name), None), + Some(item) => (Arc::clone(rpf), dir.clone(), find(&item.name)), + None => (Arc::clone(rpf), dir.clone(), None), + }) + }); + if let Some((rpf, dir, file)) = gta6 { + spawn_extract(ui, move |out, cancel, progress| { + openrage_app::rpf9::extract(&rpf, &dir, file, out, false, cancel, progress) + }); + return; + } let target = with_app(|a| -> Result<(Arc, EntryId), String> { let listing = a.listing.as_ref().ok_or("nothing to extract")?; let item = a.selected.map(|s| &listing.items[s]); diff --git a/crates/openrage-gui/src/fly.rs b/crates/openrage-gui/src/fly.rs new file mode 100644 index 0000000..87f4841 --- /dev/null +++ b/crates/openrage-gui/src/fly.rs @@ -0,0 +1,148 @@ +//! The flying camera of the model and map views: W A S D and Q E move it, +//! dragging looks around, the wheel sets how fast it is. + +use std::collections::HashSet; +use std::time::Instant; + +use openrage_app::render::{self, Camera}; + +const MOVE_KEYS: [&str; 6] = ["w", "a", "s", "d", "q", "e"]; +/// With Shift. +const FAST: f32 = 4.0; +/// How much a notch of the wheel changes the speed. +const NOTCH: f32 = 1.25; +/// Metres a second. +const SLOWEST: f32 = 0.02; +const FASTEST: f32 = 20_000.0; + +pub struct Fly { + pub eye: [f32; 3], + yaw: f32, + pitch: f32, + /// Metres a second. + speed: f32, + /// Movement keys held down (lower-case), and whether Shift is held. + keys: HashSet, + fast: bool, + last_tick: Instant, +} + +impl Fly { + /// Starts where a camera is; `size` is how large what it looks at is. + pub fn new(camera: &Camera, size: f32) -> Self { + let f = camera.forward; + Self { + eye: camera.eye, + yaw: f[1].atan2(f[0]), + pitch: f[2].clamp(-1.0, 1.0).asin(), + speed: (size * 0.35).clamp(SLOWEST, FASTEST), + keys: HashSet::new(), + fast: false, + last_tick: Instant::now(), + } + } + + pub fn camera(&self, radius: f32) -> Camera { + render::fly_camera(self.eye, self.yaw, self.pitch, radius) + } + + /// Dragging, in pixels. + pub fn look(&mut self, dx: f32, dy: f32) { + self.yaw -= dx * 0.005; + self.pitch = (self.pitch - dy * 0.005).clamp(-1.55, 1.55); + } + + /// The wheel; `delta` is 120 for a notch. + pub fn wheel(&mut self, delta: f32) { + self.speed = (self.speed * NOTCH.powf(delta / 120.0)).clamp(SLOWEST, FASTEST); + } + + pub fn set_speed(&mut self, speed: f32) { + self.speed = speed.clamp(SLOWEST, FASTEST); + } + + /// How fast it is, to show. + pub fn speed_text(&self) -> String { + match self.speed { + v if v >= 1000.0 => format!("{:.1} km/s", v / 1000.0), + v if v >= 10.0 => format!("{v:.0} m/s"), + v => format!("{v:.2} m/s"), + } + } + + /// Whether the key moves the camera. + pub fn key_down(&mut self, key: &str, shift: bool) -> bool { + self.fast = shift; + let moves = MOVE_KEYS.contains(&key); + if moves { + if self.keys.is_empty() { + self.last_tick = Instant::now(); + } + self.keys.insert(key.to_owned()); + } + moves + } + + /// Whether a key is still held. + pub fn key_up(&mut self, key: &str, shift: bool) -> bool { + self.fast = shift; + self.keys.remove(key); + !self.keys.is_empty() + } + + pub fn release(&mut self) { + self.keys.clear(); + } + + /// Moves as long as the time since the last call. + pub fn tick(&mut self) { + let dt = self.last_tick.elapsed().as_secs_f32().min(0.1); + self.last_tick = Instant::now(); + let held = |k: &str| f32::from(u8::from(self.keys.contains(k))); + let (ahead, side, up) = (held("w") - held("s"), held("d") - held("a"), held("e") - held("q")); + let camera = self.camera(1.0); + let step = self.speed * if self.fast { FAST } else { 1.0 } * dt; + for k in 0..3 { + let up = if k == 2 { up } else { 0.0 }; + self.eye[k] += (camera.forward[k] * ahead + camera.right[k] * side + up) * step; + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn fly() -> Fly { + Fly::new(&render::fly_camera([1.0, 2.0, 3.0], 0.5, -0.2, 10.0), 100.0) + } + + #[test] + fn it_starts_where_the_camera_was() { + let from = render::fly_camera([1.0, 2.0, 3.0], 0.5, -0.2, 10.0); + let now = fly().camera(10.0); + assert_eq!(now.eye, from.eye); + assert!((0..3).all(|k| (now.forward[k] - from.forward[k]).abs() < 1e-5)); + } + + #[test] + fn the_wheel_changes_the_speed() { + let mut f = fly(); + let before = f.speed; + f.wheel(120.0); + assert!((f.speed / before - NOTCH).abs() < 1e-5); + (0..500).for_each(|_| f.wheel(120.0)); + assert_eq!(f.speed, FASTEST); + (0..500).for_each(|_| f.wheel(-120.0)); + assert_eq!(f.speed, SLOWEST); + } + + #[test] + fn keys() { + let mut f = fly(); + assert!(!f.key_down("x", false)); + assert!(f.key_down("w", false) && f.key_down("a", true)); + assert!(f.key_up("w", false)); + assert!(!f.key_up("a", false)); + } +} diff --git a/crates/openrage-gui/src/gpu.rs b/crates/openrage-gui/src/gpu.rs index e19c597..2dd169b 100644 --- a/crates/openrage-gui/src/gpu.rs +++ b/crates/openrage-gui/src/gpu.rs @@ -6,20 +6,23 @@ //! If no GPU is available, callers fall back to the software renderer. use std::cell::RefCell; -use std::collections::HashMap; -use std::sync::{Arc, Weak}; +use std::collections::{HashMap, HashSet}; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::sync::{Arc, LazyLock, Mutex, Weak}; use openrage_app::gta4_effects::{Image, Sprite}; -use openrage_app::models::{LoadedModel, Look}; -use openrage_app::render::{Camera, Materials}; +use openrage_app::models::Look; +use openrage_app::render::{Camera, Image as Picture}; +use rage_formats::drawable::param; use rage_formats::math; +use rayon::prelude::*; use wgpu::util::DeviceExt; const SAMPLES: u32 = 4; -/// Bones the skinning matrices cover (16 KiB of uniforms, the downlevel limit). -const MAX_BONES: usize = 256; -/// Bytes of per-draw data: colour (vec4) and model matrix (mat4). -const DRAW_DATA: usize = 16 + 64; +/// The most bones the skinning matrices cover. +const MAX_BONES: usize = 1024; +/// Bytes of a bone's matrix. +const BONE: u32 = 64; const COLOR_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8Unorm; const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth32Float; @@ -37,6 +40,20 @@ struct Globals { // xyz: viewing direction (headlight), w: number of lights forward: vec4, lights: array, + // Outdoors. xyz: where the camera is, w: how fast things fade into the + // distance (per metre). + eye: vec4, + // The directions to the right and upper edge of the picture, w: there is a sky. + right: vec4, + up: vec4, + // Towards the light, w: seconds, for what moves. + sun: vec4, + // Its colour, w: how much lamps shine. + sun_colour: vec4, + ambient: vec4, + zenith: vec4, + horizon: vec4, + below: vec4, }; @group(0) @binding(0) var globals: Globals; @group(1) @binding(0) var tex: texture_2d; @@ -44,23 +61,114 @@ struct Globals { // Overlay drawn over the base colour with its alpha, on the second UV set // (vehicle liveries and signs); transparent when there is none. @group(1) @binding(2) var overlay: texture_2d; -// Per draw: material colour (multiplied with the texture) and the model's -// placement in the scene. -struct DrawData { - tint: vec4, - model: mat4x4, -}; -@group(2) @binding(0) var draw: DrawData; +// Flat and black when there is none. +@group(1) @binding(3) var normal_map: texture_2d; +@group(1) @binding(4) var specular_map: texture_2d; // Skinning matrices per skeleton bone (identity when not animated). -@group(3) @binding(0) var skin: array, 256>; +@group(2) @binding(0) var skin: array, {BONES}>; + +// What a placement's colour says it is (its alpha). +const WATER: f32 = 2.0; +const LAMP: f32 = 3.0; + +fn sky_colour(dir: vec3) -> vec3 { + var c = mix(globals.horizon.rgb, globals.zenith.rgb, pow(clamp(dir.z, 0.0, 1.0), 0.55)); + c = mix(c, globals.below.rgb, smoothstep(0.0, 0.25, -dir.z)); + let near = max(dot(dir, globals.sun.xyz), 0.0); + return c + globals.sun_colour.rgb * (1.6 * pow(near, 1500.0) + 0.16 * pow(near, 12.0)); +} + +// The surface of water: waves that fade with the distance. +fn water_colour(world: vec3) -> vec3 { + let to_eye = globals.eye.xyz - world; + let far = length(to_eye); + let v = to_eye / max(far, 0.001); + let t = globals.sun.w; + var slope = vec2(0.0); + var dir = vec2(0.8, 0.6); + var long = 0.045; + var high = 0.05; + for (var i = 0; i < 6; i = i + 1) { + let fade = exp(-far * long * 0.05); + slope = slope + dir * cos(dot(world.xy, dir) * long * 6.2832 + t * (0.6 + f32(i) * 0.45)) * high * fade; + dir = vec2(dir.x * 0.36 - dir.y * 0.93, dir.x * 0.93 + dir.y * 0.36); + long = long * 1.9; + high = high * 0.92; + } + let n = normalize(vec3(-slope, 1.0)); + let facing = clamp(dot(n, v), 0.0, 1.0); + let mirror = 0.03 + 0.97 * pow(1.0 - facing, 5.0); + var up = reflect(-v, n); + up.z = abs(up.z); + let day = globals.ambient.rgb + globals.sun_colour.rgb * 0.5; + let deep = vec3(0.02, 0.16, 0.20) * day + vec3(0.02, 0.10, 0.09) * max(slope.x + slope.y, 0.0) * day; + let spark = pow(max(dot(up, globals.sun.xyz), 0.0), 260.0); + return mix(deep, sky_colour(normalize(up)), mirror) + globals.sun_colour.rgb * spark * 1.5; +} + +struct SeaOut { + @builtin(position) clip: vec4, + @location(0) world: vec3, +}; + +// The sea: a square around the camera, up to the horizon. +@vertex +fn vs_sea(@builtin(vertex_index) i: u32) -> SeaOut { + var o: SeaOut; + let corner = vec2(f32(i & 1u), f32((i >> 1u) & 1u)) * 2.0 - 1.0; + o.world = vec3(globals.eye.xy + corner * 40000.0, 0.0); + o.clip = globals.view_proj * vec4(o.world, 1.0); + return o; +} + +@fragment +fn fs_sea(i: SeaOut) -> @location(0) vec4 { + let ray = i.world - globals.eye.xyz; + let far = length(ray); + let dir = ray / max(far, 0.001); + let haze = sky_colour(normalize(vec3(dir.xy, 0.0))); + let lit = mix(haze, water_colour(i.world), exp(-far * globals.eye.w)) * globals.ambient.w; + // Looking down, the ground shows through a little. + let alpha = mix(0.97, 0.82, clamp(-dir.z, 0.0, 1.0)); + return vec4(lit * alpha, alpha); +} + +struct SkyOut { + @builtin(position) clip: vec4, + @location(0) dir: vec3, +}; + +// A triangle over the whole picture, behind everything. +@vertex +fn vs_sky(@builtin(vertex_index) i: u32) -> SkyOut { + var o: SkyOut; + let x = f32(i32(i & 1u) * 4 - 1); + let y = f32(i32(i >> 1u) * 4 - 1); + o.clip = vec4(x, y, 0.0, 1.0); + o.dir = globals.forward.xyz + globals.right.xyz * x + globals.up.xyz * y; + return o; +} + +@fragment +fn fs_sky(i: SkyOut) -> @location(0) vec4 { + return vec4(sky_colour(normalize(i.dir)) * globals.ambient.w, 1.0); +} struct VsIn { @location(0) pos: vec3, - @location(1) normal: vec3, + @location(1) normal: vec4, @location(2) uv: vec2, @location(3) weights: vec4, @location(4) joints: vec4, @location(5) uv1: vec2, + @location(11) shading: vec4, + // Per placement: where it is, and the material's colour (multiplied with + // the texture). + @location(6) model_0: vec4, + @location(7) model_1: vec4, + @location(8) model_2: vec4, + @location(9) model_3: vec4, + @location(10) tint: vec4, }; struct VsOut { @builtin(position) clip: vec4, @@ -68,42 +176,76 @@ struct VsOut { @location(1) uv: vec2, @location(2) uv1: vec2, @location(3) world: vec3, + @location(4) tint: vec3, + @location(5) @interpolate(flat) kind: f32, + // How much sky it sees, and how much of what is put on the base shows. + @location(6) shading: vec2, }; @vertex fn vs_main(v: VsIn) -> VsOut { var o: VsOut; var pos = vec4(v.pos, 1.0); - var normal = v.normal; + var normal = v.normal.xyz; let total = v.weights.x + v.weights.y + v.weights.z + v.weights.w; if (total > 0.0) { - let m = (skin[min(v.joints.x, 255u)] * v.weights.x + skin[min(v.joints.y, 255u)] * v.weights.y - + skin[min(v.joints.z, 255u)] * v.weights.z + skin[min(v.joints.w, 255u)] * v.weights.w) * (1.0 / total); + let m = (skin[min(v.joints.x, {LAST_BONE})] * v.weights.x + skin[min(v.joints.y, {LAST_BONE})] * v.weights.y + + skin[min(v.joints.z, {LAST_BONE})] * v.weights.z + skin[min(v.joints.w, {LAST_BONE})] * v.weights.w) * (1.0 / total); pos = m * pos; normal = (m * vec4(normal, 0.0)).xyz; } - let world = draw.model * pos; + let model = mat4x4(v.model_0, v.model_1, v.model_2, v.model_3); + let world = model * pos; o.clip = globals.view_proj * world; o.world = world.xyz; - o.normal = (draw.model * vec4(normal, 0.0)).xyz; + o.normal = (model * vec4(normal, 0.0)).xyz; + o.tint = v.tint.rgb; + o.kind = v.tint.a; + o.shading = v.shading.ra; o.uv = v.uv; o.uv1 = v.uv1; return o; } -@fragment -fn fs_main(i: VsOut) -> @location(0) vec4 { - let base = textureSample(tex, samp, i.uv); - if (base.a < 0.3) { - discard; - } +// The colour, with the base texture's alpha. +fn shade(i: VsOut, base: vec4) -> vec4 { var n = i.normal; if (dot(n, n) < 1e-6) { n = vec3(0.0, 0.0, 1.0); } n = normalize(n); + // The normal map bends it, along the directions the texture runs in. + let bump = textureSample(normal_map, samp, i.uv).xy * 2.0 - vec2(1.0); + let px = dpdx(i.world); + let py = dpdy(i.world); + let ux = dpdx(i.uv); + let uy = dpdy(i.uv); + let shine = textureSample(specular_map, samp, i.uv); + let layer = textureSample(overlay, samp, i.uv1); + let det = ux.x * uy.y - uy.x * ux.y; + if (abs(det) > 1e-12 && dot(bump, bump) > 0.0004) { + let t = (px * uy.y - py * ux.y) / det; + let b = (py * ux.x - px * uy.x) / det; + let tangent = t - n * dot(n, t); + let bitangent = b - n * dot(n, b); + if (dot(tangent, tangent) > 1e-12 && dot(bitangent, bitangent) > 1e-12) { + let z = sqrt(max(1.0 - dot(bump, bump), 0.05)); + n = normalize(n * z + normalize(tangent) * bump.x + normalize(bitangent) * bump.y); + } + } // Headlight plus a little sky light; double-sided. var light = vec3(0.25 + 0.65 * abs(dot(n, globals.forward.xyz)) + 0.1 * max(n.z, 0.0)); + if (globals.right.w > 0.5) { + // Outdoors: the sun, and the sky from above. + let to_eye = globals.eye.xyz - i.world; + let m = select(-n, n, dot(n, to_eye) >= 0.0); + light = globals.sun_colour.rgb * max(dot(m, globals.sun.xyz), 0.0) + + globals.ambient.rgb * (0.85 + 0.35 * m.z); + light = light * mix(0.35, 1.0, i.shading.x); + if (abs(i.kind - LAMP) < 0.5) { + light = max(light, vec3(globals.sun_colour.w)); + } + } let count = u32(globals.forward.w); if (count > 0u) { // With scene lights the headlight is dimmer and the lights add up. @@ -125,9 +267,41 @@ fn fs_main(i: VsOut) -> @location(0) vec4 { light = light + l.color.rgb * amount; } } - let layer = textureSample(overlay, samp, i.uv1); - let colour = mix(base.rgb * draw.tint.rgb, layer.rgb, layer.a); - return vec4(colour * light, 1.0); + let colour = mix(base.rgb * i.tint, layer.rgb, layer.a * i.shading.y); + // What shines towards the viewer. + let glint = pow(abs(dot(n, globals.forward.xyz)), 24.0) * max(max(shine.r, shine.g), shine.b) * 0.25; + var lit = colour * light + vec3(glint); + if (globals.right.w > 0.5) { + lit = colour * light; + if (abs(i.kind - WATER) < 0.5) { + lit = water_colour(i.world); + } + let ray = i.world - globals.eye.xyz; + let far = length(ray); + let dir = ray / max(far, 0.001); + let haze = sky_colour(normalize(vec3(dir.xy, max(dir.z, 0.0)))); + lit = mix(haze, lit, exp(-far * globals.eye.w)) * globals.ambient.w; + } + return vec4(lit, base.a); +} + +@fragment +fn fs_main(i: VsOut) -> @location(0) vec4 { + let base = textureSample(tex, samp, i.uv); + let c = shade(i, base); + if (base.a < 0.3) { + discard; + } + return vec4(c.rgb, 1.0); +} + +// What lies on other things (road markings, dirt): blended over them. +@fragment +fn fs_decal(i: VsOut) -> @location(0) vec4 { + let base = textureSample(tex, samp, i.uv); + let c = shade(i, base); + let alpha = base.a * i.shading.y; + return vec4(c.rgb * alpha, alpha); } // Particles: camera-facing squares, built on the CPU in world space. @@ -163,11 +337,25 @@ fn fs_sprite(i: SpriteOut) -> @location(0) vec4 { #[derive(Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)] struct Vertex { pos: [f32; 3], - normal: [f32; 3], + /// In 127ths. + normal: [i8; 4], uv: [f32; 2], - weights: [f32; 4], - joints: [u32; 4], + /// In 255ths. + weights: [u8; 4], + joints: [u16; 4], uv1: [f32; 2], + /// [`rage_formats::drawable::Mesh::shading`], in 255ths. + shading: [u8; 4], +} + +fn small_normal(n: [f32; 3]) -> [i8; 4] { + let len = n.iter().map(|v| v * v).sum::().sqrt().max(1e-12); + let [x, y, z] = n.map(|v| (v / len * 127.0).round() as i8); + [x, y, z, 0] +} + +fn small_weights(w: [f32; 4]) -> [u8; 4] { + w.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8) } #[repr(C)] @@ -195,6 +383,15 @@ struct Globals { view_proj: [f32; 16], forward: [f32; 4], lights: [GpuLight; MAX_LIGHTS], + eye: [f32; 4], + right: [f32; 4], + up: [f32; 4], + sun: [f32; 4], + sun_colour: [f32; 4], + ambient: [f32; 4], + zenith: [f32; 4], + horizon: [f32; 4], + below: [f32; 4], } /// A light of a scene: position, colour × strength, reach, and for spot @@ -207,6 +404,82 @@ pub struct SceneLight { pub spot: Option<([f32; 3], f32)>, } +/// A placement of a draw. +#[repr(C)] +#[derive(Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)] +struct Instance { + model: math::Mat4, + tint: [f32; 4], +} + +/// How a scene outdoors looks. +#[derive(Debug, Clone, Copy)] +pub struct Outdoors { + /// How fast things fade into the distance, per metre. + pub haze: f32, + /// Hour of the day. + pub hour: f32, + pub brightness: f32, + /// For what moves. + pub seconds: f32, + /// There is a sea at height 0. + pub sea: bool, +} + +/// Marks a material's colour as water, or as a lamp that shines at night. +pub const WATER: f32 = 2.0; +pub const LAMP: f32 = 3.0; + +/// The light at an hour. +struct Daylight { + /// Towards the sun or the moon. + towards: [f32; 3], + colour: [f32; 3], + /// How much lamps shine. + lamps: f32, + /// From all sides. + ambient: [f32; 3], + zenith: [f32; 3], + horizon: [f32; 3], + /// Below the horizon. + below: [f32; 3], +} + +fn light_at(hour: f32) -> Daylight { + let mix = |a: [f32; 3], b: [f32; 3], t: f32| std::array::from_fn(|k| a[k] + (b[k] - a[k]) * t); + let step = |a: f32, b: f32, v: f32| { + let t = ((v - a) / (b - a)).clamp(0.0, 1.0); + t * t * (3.0 - 2.0 * t) + }; + let angle = (hour - 6.0) / 12.0 * std::f32::consts::PI; + // Up in the east, over the south, down in the west. + let sun = [angle.cos() * 0.92, -0.38, angle.sin()]; + let height = angle.sin(); + let day = step(-0.3, 0.25, height); + let dusk = (-(height / 0.2).powi(2)).exp(); + let colour: [f32; 3] = if height > -0.06 { + mix([0.75, 0.34, 0.13], [0.66, 0.62, 0.55], step(0.0, 0.4, height)).map(|c: f32| c * step(-0.06, 0.1, height)) + } else { + [0.16, 0.20, 0.30] + }; + let light = if height > -0.06 { sun } else { [-sun[0], sun[1], -sun[2]] }; + let len = light.iter().map(|v| v * v).sum::().sqrt(); + let horizon = mix([0.09, 0.11, 0.18], [0.74, 0.82, 0.89], day); + let lamps = 1.0 - step(-0.02, 0.25, height); + Daylight { + towards: light.map(|v| v / len), + colour, + lamps: lamps * 1.6, + ambient: mix([0.15, 0.18, 0.26], [0.36, 0.40, 0.46], day), + zenith: mix([0.02, 0.03, 0.08], [0.22, 0.45, 0.78], day), + horizon: mix(horizon, [0.95, 0.52, 0.28], dusk * 0.75), + below: mix([0.04, 0.05, 0.08], [0.40, 0.48, 0.55], day), + } +} + +/// Outdoors, models smaller than this in the picture are left out (pixels). +const SMALLEST: f32 = 1.6; + struct Gpu { device: wgpu::Device, queue: wgpu::Queue, @@ -214,27 +487,37 @@ struct Gpu { /// Particles blended over the scene, and particles that add light. sprite_blend: wgpu::RenderPipeline, sprite_add: wgpu::RenderPipeline, + sky: wgpu::RenderPipeline, + decal: wgpu::RenderPipeline, + sea: wgpu::RenderPipeline, + /// Block-compressed textures can be used as they are. + blocks: bool, globals_layout: wgpu::BindGroupLayout, texture_layout: wgpu::BindGroupLayout, - tint_layout: wgpu::BindGroupLayout, skin_layout: wgpu::BindGroupLayout, - /// Stride of the per-draw colours in the tint buffer. - tint_stride: u64, sampler: wgpu::Sampler, /// White 1×1 texture for untextured meshes (their colour is the tint). white: wgpu::TextureView, + /// The same in grey. + grey: wgpu::TextureView, /// Transparent 1×1 texture for meshes without an overlay. clear: wgpu::TextureView, + /// 1×1 normal map for meshes without one. + flat: wgpu::TextureView, + /// Bones the skinning can use: devices differ. + bones: usize, } struct Draw { part: usize, drawable: usize, shader: u16, - vertices: wgpu::Buffer, - indices: wgpu::Buffer, - count: u32, + /// In the model's buffers. + base_vertex: i32, + indices: std::ops::Range, texture: usize, + /// Lies on other things. + decal: bool, /// Bounding sphere (centre, radius) in the model's space, for culling. sphere: ([f32; 3], f32), } @@ -243,8 +526,12 @@ struct Draw { struct GpuModel { owner: Weak, draws: Vec, - /// Bind groups: 0 is the plain texture, then one per pair of decoded - /// images (base colour, overlay). + /// Models with the same number are in the same buffers. + batch: u64, + vertices: wgpu::Buffer, + indices: wgpu::Buffer, + /// Bind groups: 0 is the plain texture, then one per combination of + /// decoded images. textures: Vec, } @@ -255,13 +542,14 @@ struct Targets { resolve: wgpu::Texture, resolve_view: wgpu::TextureView, depth: wgpu::TextureView, - readback: wgpu::Buffer, + readback: [wgpu::Buffer; 2], + /// A picture on its way back: for whom, its buffer and when it is done. + pending: Option<(u64, usize, wgpu::SubmissionIndex)>, padded_row: u32, } #[derive(Default)] struct State { - gpu: Option>, models: Vec, targets: Option, /// Bone palette of items without a skin (all identity), shared by them. @@ -270,6 +558,16 @@ struct State { sprite_textures: Vec<(Weak, wgpu::BindGroup)>, } +/// The graphics device; `None` if there is no usable one. +static GPU: LazyLock> = LazyLock::new(init); + +/// Models uploaded by other threads. +static READY: Mutex> = Mutex::new(Vec::new()); + +/// The textures of pictures that several models share. +type Views = HashMap, wgpu::TextureView)>; +static VIEWS: LazyLock> = LazyLock::new(Default::default); + thread_local! { static STATE: RefCell = RefCell::new(State::default()); } @@ -283,16 +581,24 @@ fn init() -> Option { ..Default::default() })) .ok()?; + let mut limits = wgpu::Limits::downlevel_defaults().using_resolution(adapter.limits()); + // People of GTA VI have about 600 bones. + let wanted = adapter.limits().max_uniform_buffer_binding_size.min((MAX_BONES as u32 * BONE).into()); + limits.max_uniform_buffer_binding_size = limits.max_uniform_buffer_binding_size.max(wanted); + let bones = (limits.max_uniform_buffer_binding_size / u64::from(BONE)) as usize; + let bones = bones.min(MAX_BONES); + let blocks = adapter.features().contains(wgpu::Features::TEXTURE_COMPRESSION_BC); let (device, queue) = pollster::block_on(adapter.request_device(&wgpu::DeviceDescriptor { label: Some("openrage"), - required_limits: wgpu::Limits::downlevel_defaults().using_resolution(adapter.limits()), + required_features: if blocks { wgpu::Features::TEXTURE_COMPRESSION_BC } else { wgpu::Features::empty() }, + required_limits: limits, ..Default::default() })) .ok()?; let module = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some("model"), - source: wgpu::ShaderSource::Wgsl(SHADER.into()), + source: wgpu::ShaderSource::Wgsl(shader_source(bones).into()), }); let globals_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { label: Some("globals"), @@ -336,23 +642,28 @@ fn init() -> Option { }, count: None, }, - ], - }); - let tint_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { - label: Some("tint"), - entries: &[wgpu::BindGroupLayoutEntry { - binding: 0, - visibility: wgpu::ShaderStages::VERTEX_FRAGMENT, - ty: wgpu::BindingType::Buffer { - ty: wgpu::BufferBindingType::Uniform, - has_dynamic_offset: true, - min_binding_size: wgpu::BufferSize::new(DRAW_DATA as u64), + wgpu::BindGroupLayoutEntry { + binding: 3, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, + multisampled: false, + }, + count: None, }, - count: None, - }], + wgpu::BindGroupLayoutEntry { + binding: 4, + visibility: wgpu::ShaderStages::FRAGMENT, + ty: wgpu::BindingType::Texture { + sample_type: wgpu::TextureSampleType::Float { filterable: true }, + view_dimension: wgpu::TextureViewDimension::D2, + multisampled: false, + }, + count: None, + }, + ], }); - let align = (device.limits().min_uniform_buffer_offset_alignment as u64).max(16); - let tint_stride = (DRAW_DATA as u64).div_ceil(align) * align; let skin_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { label: Some("skin"), entries: &[wgpu::BindGroupLayoutEntry { @@ -368,44 +679,100 @@ fn init() -> Option { }); let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("model"), - bind_group_layouts: &[Some(&globals_layout), Some(&texture_layout), Some(&tint_layout), Some(&skin_layout)], + bind_group_layouts: &[Some(&globals_layout), Some(&texture_layout), Some(&skin_layout)], immediate_size: 0, }); - let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { + let model_pipeline = |decal: bool| { + device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { label: Some("model"), layout: Some(&layout), vertex: wgpu::VertexState { module: &module, entry_point: Some("vs_main"), compilation_options: Default::default(), - buffers: &[Some(wgpu::VertexBufferLayout { - array_stride: std::mem::size_of::() as u64, - step_mode: wgpu::VertexStepMode::Vertex, - attributes: &wgpu::vertex_attr_array![0 => Float32x3, 1 => Float32x3, 2 => Float32x2, 3 => Float32x4, 4 => Uint32x4, 5 => Float32x2], - })], + buffers: &[ + Some(wgpu::VertexBufferLayout { + array_stride: std::mem::size_of::() as u64, + step_mode: wgpu::VertexStepMode::Vertex, + attributes: &wgpu::vertex_attr_array![0 => Float32x3, 1 => Snorm8x4, 2 => Float32x2, 3 => Unorm8x4, 4 => Uint16x4, 5 => Float32x2, 11 => Unorm8x4], + }), + Some(wgpu::VertexBufferLayout { + array_stride: std::mem::size_of::() as u64, + step_mode: wgpu::VertexStepMode::Instance, + attributes: &wgpu::vertex_attr_array![6 => Float32x4, 7 => Float32x4, 8 => Float32x4, 9 => Float32x4, 10 => Float32x4], + }), + ], }, primitive: wgpu::PrimitiveState { cull_mode: None, ..Default::default() }, depth_stencil: Some(wgpu::DepthStencilState { format: DEPTH_FORMAT, - depth_write_enabled: Some(true), - depth_compare: Some(wgpu::CompareFunction::Less), + depth_write_enabled: Some(!decal), + depth_compare: Some(wgpu::CompareFunction::Greater), stencil: Default::default(), - bias: Default::default(), + // Depth is larger nearer to the camera. + bias: if decal { + wgpu::DepthBiasState { constant: 24, slope_scale: 1.5, clamp: 0.0 } + } else { + Default::default() + }, }), multisample: wgpu::MultisampleState { count: SAMPLES, ..Default::default() }, fragment: Some(wgpu::FragmentState { module: &module, - entry_point: Some("fs_main"), + entry_point: Some(if decal { "fs_decal" } else { "fs_main" }), compilation_options: Default::default(), targets: &[Some(wgpu::ColorTargetState { format: COLOR_FORMAT, - blend: None, + blend: decal.then_some(wgpu::BlendState::PREMULTIPLIED_ALPHA_BLENDING), write_mask: wgpu::ColorWrites::ALL, })], }), multiview_mask: None, cache: None, + }) + }; + let (pipeline, decal) = (model_pipeline(false), model_pipeline(true)); + let sky_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { + label: Some("sky"), + bind_group_layouts: &[Some(&globals_layout)], + immediate_size: 0, }); + let outdoor_pipeline = |vertex, fragment, topology, blend| { + device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { + label: Some(vertex), + layout: Some(&sky_layout), + vertex: wgpu::VertexState { + module: &module, + entry_point: Some(vertex), + compilation_options: Default::default(), + buffers: &[], + }, + primitive: wgpu::PrimitiveState { topology, ..Default::default() }, + depth_stencil: Some(wgpu::DepthStencilState { + format: DEPTH_FORMAT, + depth_write_enabled: Some(false), + depth_compare: Some(wgpu::CompareFunction::GreaterEqual), + stencil: Default::default(), + bias: Default::default(), + }), + multisample: wgpu::MultisampleState { count: SAMPLES, ..Default::default() }, + fragment: Some(wgpu::FragmentState { + module: &module, + entry_point: Some(fragment), + compilation_options: Default::default(), + targets: &[Some(wgpu::ColorTargetState { + format: COLOR_FORMAT, + blend, + write_mask: wgpu::ColorWrites::ALL, + })], + }), + multiview_mask: None, + cache: None, + }) + }; + let sky = outdoor_pipeline("vs_sky", "fs_sky", wgpu::PrimitiveTopology::TriangleList, None); + let over = wgpu::BlendState::PREMULTIPLIED_ALPHA_BLENDING; + let sea = outdoor_pipeline("vs_sea", "fs_sea", wgpu::PrimitiveTopology::TriangleStrip, Some(over)); let sprite_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { label: Some("sprite"), bind_group_layouts: &[Some(&globals_layout), Some(&texture_layout)], @@ -430,7 +797,7 @@ fn init() -> Option { depth_stencil: Some(wgpu::DepthStencilState { format: DEPTH_FORMAT, depth_write_enabled: Some(false), - depth_compare: Some(wgpu::CompareFunction::Less), + depth_compare: Some(wgpu::CompareFunction::Greater), stencil: Default::default(), bias: Default::default(), }), @@ -467,34 +834,63 @@ fn init() -> Option { address_mode_v: wgpu::AddressMode::Repeat, mag_filter: wgpu::FilterMode::Linear, min_filter: wgpu::FilterMode::Linear, + mipmap_filter: wgpu::MipmapFilterMode::Linear, + anisotropy_clamp: 8, ..Default::default() }); let white = upload_texture(&device, &queue, 1, 1, &[255, 255, 255, 255]); + let grey = upload_texture(&device, &queue, 1, 1, &[118, 118, 116, 255]); let clear = upload_texture(&device, &queue, 1, 1, &[0, 0, 0, 0]); + let flat = upload_texture(&device, &queue, 1, 1, &[128, 128, 255, 255]); Some(Gpu { sprite_blend, sprite_add, + sky, + decal, + sea, + blocks, device, queue, pipeline, globals_layout, texture_layout, - tint_layout, skin_layout, - tint_stride, sampler, white, + grey, clear, + flat, + bones, }) } -/// Uploads RGBA pixels as a texture. +/// Half of a picture in each direction. +fn halved(w: u32, h: u32, rgba: &[u8]) -> (u32, u32, Vec) { + let (hw, hh) = ((w / 2).max(1), (h / 2).max(1)); + let mut out = Vec::with_capacity((hw * hh * 4) as usize); + for y in 0..hh { + let rows = [(y * 2).min(h - 1), (y * 2 + 1).min(h - 1)]; + for x in 0..hw { + let columns = [(x * 2).min(w - 1), (x * 2 + 1).min(w - 1)]; + let at = |x: u32, y: u32| ((y * w + x) * 4) as usize; + let from = + [at(columns[0], rows[0]), at(columns[1], rows[0]), at(columns[0], rows[1]), at(columns[1], rows[1])]; + for c in 0..4 { + let sum: u32 = from.iter().map(|i| u32::from(rgba[i + c])).sum(); + out.push(((sum + 2) / 4) as u8); + } + } + } + (hw, hh, out) +} + +/// Uploads RGBA pixels as a texture, with smaller copies for the distance. fn upload_texture(device: &wgpu::Device, queue: &wgpu::Queue, w: u32, h: u32, rgba: &[u8]) -> wgpu::TextureView { - let size = wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 }; + let levels = w.max(h).max(1).ilog2() + 1; let texture = device.create_texture(&wgpu::TextureDescriptor { label: None, - size, - mip_level_count: 1, + size: wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 }, + mip_level_count: levels, sample_count: 1, dimension: wgpu::TextureDimension::D2, // Colors are passed through unchanged, like the software renderer. @@ -502,22 +898,119 @@ fn upload_texture(device: &wgpu::Device, queue: &wgpu::Queue, w: u32, h: u32, rg usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST, view_formats: &[], }); - queue.write_texture( - wgpu::TexelCopyTextureInfo { - texture: &texture, - mip_level: 0, - origin: wgpu::Origin3d::ZERO, - aspect: wgpu::TextureAspect::All, - }, - rgba, - wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(4 * w), rows_per_image: Some(h) }, - size, - ); + let write = |level: u32, w: u32, h: u32, rgba: &[u8]| { + queue.write_texture( + wgpu::TexelCopyTextureInfo { + texture: &texture, + mip_level: level, + origin: wgpu::Origin3d::ZERO, + aspect: wgpu::TextureAspect::All, + }, + rgba, + wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(4 * w), rows_per_image: Some(h) }, + wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 }, + ); + }; + write(0, w, h, rgba); + let mut smaller: Option<(u32, u32, Vec)> = None; + for level in 1..levels { + let next = match &smaller { + None => halved(w, h, rgba), + Some((w, h, rgba)) => halved(*w, *h, rgba), + }; + write(level, next.0, next.1, &next.2); + smaller = Some(next); + } texture.create_view(&Default::default()) } -/// A material's textures: base colour and overlay. -fn texture_bind_group(gpu: &Gpu, base: &wgpu::TextureView, overlay: &wgpu::TextureView) -> wgpu::BindGroup { +/// The texture of a picture on a model, made once for all that have it. +fn picture_view(gpu: &Gpu, picture: &Arc) -> Option { + let key = Arc::as_ptr(picture) as usize; + { + let views = VIEWS.lock().unwrap_or_else(|e| e.into_inner()); + if let Some((of, view)) = views.get(&key) + && of.upgrade().is_some_and(|of| Arc::ptr_eq(&of, picture)) + { + return Some(view.clone()); + } + } + let (w, h) = picture.size(); + let as_it_is = picture.source().filter(|_| gpu.blocks).and_then(|t| upload_blocks(gpu, &t)); + let view = match as_it_is { + Some(view) => view, + None => upload_texture(&gpu.device, &gpu.queue, w as u32, h as u32, picture.rgba()?), + }; + let mut views = VIEWS.lock().unwrap_or_else(|e| e.into_inner()); + if views.len().is_power_of_two() { + views.retain(|_, (of, _)| of.strong_count() > 0); + } + views.insert(key, (Arc::downgrade(picture), view.clone())); + Some(view) +} + +/// Uploads a block-compressed texture; `None` if it is of another kind. +fn upload_blocks(gpu: &Gpu, t: &rage_formats::texture::Texture) -> Option { + // Colours are passed through unchanged, so none is declared sRGB. + let format = match t.format.0 { + 70..=72 => wgpu::TextureFormat::Bc1RgbaUnorm, + 76..=78 => wgpu::TextureFormat::Bc3RgbaUnorm, + 82 | 83 => wgpu::TextureFormat::Bc5RgUnorm, + 97..=99 => wgpu::TextureFormat::Bc7RgbaUnorm, + _ => return None, + }; + if t.depth > 1 || !t.width.is_multiple_of(4) || !t.height.is_multiple_of(4) || t.levels == 0 { + return None; + } + let texture = gpu.device.create_texture(&wgpu::TextureDescriptor { + label: None, + size: wgpu::Extent3d { width: t.width, height: t.height, depth_or_array_layers: 1 }, + mip_level_count: t.levels, + sample_count: 1, + dimension: wgpu::TextureDimension::D2, + format, + usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST, + view_formats: &[], + }); + let mut at = 0; + for level in 0..t.levels { + let (w, h) = ((t.width >> level).max(1), (t.height >> level).max(1)); + let (row, size) = t.format.pitch(w, h)?; + let data = t.data.get(at..at + size)?; + at += size; + gpu.queue.write_texture( + wgpu::TexelCopyTextureInfo { + texture: &texture, + mip_level: level, + origin: wgpu::Origin3d::ZERO, + aspect: wgpu::TextureAspect::All, + }, + data, + wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(row as u32), rows_per_image: None }, + wgpu::Extent3d { width: w.next_multiple_of(4), height: h.next_multiple_of(4), depth_or_array_layers: 1 }, + ); + } + Some(texture.create_view(&Default::default())) +} + +/// The shader, for devices that can skin with this many bones. +fn shader_source(bones: usize) -> String { + SHADER.replace("{BONES}", &bones.to_string()).replace("{LAST_BONE}", &format!("{}u", bones - 1)) +} + +/// A texture that is only a colour. +fn plain_bind_group(gpu: &Gpu, base: &wgpu::TextureView) -> wgpu::BindGroup { + texture_bind_group(gpu, base, &gpu.clear, &gpu.flat, &gpu.clear) +} + +/// A material's textures: base colour, overlay, normal and specular map. +fn texture_bind_group( + gpu: &Gpu, + base: &wgpu::TextureView, + overlay: &wgpu::TextureView, + normal: &wgpu::TextureView, + specular: &wgpu::TextureView, +) -> wgpu::BindGroup { gpu.device.create_bind_group(&wgpu::BindGroupDescriptor { label: None, layout: &gpu.texture_layout, @@ -525,17 +1018,29 @@ fn texture_bind_group(gpu: &Gpu, base: &wgpu::TextureView, overlay: &wgpu::Textu wgpu::BindGroupEntry { binding: 0, resource: wgpu::BindingResource::TextureView(base) }, wgpu::BindGroupEntry { binding: 1, resource: wgpu::BindingResource::Sampler(&gpu.sampler) }, wgpu::BindGroupEntry { binding: 2, resource: wgpu::BindingResource::TextureView(overlay) }, + wgpu::BindGroupEntry { binding: 3, resource: wgpu::BindingResource::TextureView(normal) }, + wgpu::BindGroupEntry { binding: 4, resource: wgpu::BindingResource::TextureView(specular) }, ], }) } -/// Uploads every part of the model (placements baked into the vertices). -fn upload(gpu: &Gpu, model: &LoadedModel, materials: &Materials) -> (Vec, Vec) { - let mut textures = vec![texture_bind_group(gpu, &gpu.white, &gpu.clear)]; - // Material image index → uploaded texture; (base, overlay) image indices → bind group. - let mut views: HashMap = HashMap::new(); - let mut texture_of: HashMap<(Option, Option), usize> = HashMap::new(); - texture_of.insert((None, None), 0); +/// A model on its way to the graphics card. +struct Built { + owner: Weak, + draws: Vec, + vertices: Vec, + indices: Vec, + textures: Vec, +} + +/// Every part of the model (placements baked into the vertices), with its +/// textures uploaded. +fn build(gpu: &Gpu, preview: &Arc) -> Built { + let (model, materials) = (&preview.loaded, &preview.materials); + let (mut all_vertices, mut all_indices): (Vec, Vec) = (Vec::new(), Vec::new()); + let mut textures = vec![plain_bind_group(gpu, &gpu.white)]; + // Pictures → bind group. + let mut texture_of: HashMap<[usize; 4], usize> = HashMap::new(); let mut draws = Vec::new(); for (part_index, part) in model.parts.iter().enumerate() { let Some((_, d)) = model.drawables.get(part.drawable) else { continue }; @@ -546,40 +1051,69 @@ fn upload(gpu: &Gpu, model: &LoadedModel, materials: &Materials) -> (Vec, let has_n = mesh.normals.len() == mesh.positions.len(); let has_uv = mesh.uvs.len() == mesh.positions.len(); let has_uv1 = mesh.uvs1.len() == mesh.positions.len(); + // The second layer runs like the first. + let layered = d + .shaders + .get(usize::from(mesh.shader)) + .is_some_and(|s| s.sampler(param::LAYER_1_TEX).is_some() && s.sampler(param::DIFFUSE_TEX2).is_none()); let skinned = mesh.bone_weights.len() == mesh.positions.len(); - let bone = part.bone.map(|b| b as u32); + let bone = part.bone.map(|b| b as u16); let vertices: Vec = (0..mesh.positions.len()) .map(|i| Vertex { pos: math::transform_point(&part.transform, mesh.positions[i]), - normal: if has_n { math::transform_dir(&part.transform, mesh.normals[i]) } else { [0.0; 3] }, + normal: if has_n { + small_normal(math::transform_dir(&part.transform, mesh.normals[i])) + } else { + [0; 4] + }, uv: if has_uv { mesh.uvs[i] } else { [0.0; 2] }, // Parts attached to a bone follow it; others use the mesh's weights. weights: match bone { - Some(_) => [1.0, 0.0, 0.0, 0.0], - None if skinned => mesh.bone_weights[i], - None => [0.0; 4], + Some(_) => [255, 0, 0, 0], + None if skinned => small_weights(mesh.bone_weights[i]), + None => [0; 4], }, joints: match bone { Some(b) => [b, 0, 0, 0], - None if skinned => mesh.bone_indices[i].map(u32::from), + None if skinned => mesh.bone_indices[i], None => [0; 4], }, - uv1: if has_uv1 { mesh.uvs1[i] } else { [0.0; 2] }, + uv1: match (layered, has_uv1) { + (true, _) if has_uv => mesh.uvs[i], + (false, true) => mesh.uvs1[i], + _ => [0.0; 2], + }, + shading: mesh.shading.get(i).copied().unwrap_or([255; 4]), }) .collect(); - let base = materials.texture(part.drawable, mesh.shader).filter(|_| has_uv); - let overlay = materials.overlay(part.drawable, mesh.shader).filter(|_| has_uv1); - let mut view = |image: Option<(usize, usize, usize, &[u8])>| { - image.map(|(i, w, h, rgba)| { - views.entry(i).or_insert_with(|| upload_texture(&gpu.device, &gpu.queue, w as u32, h as u32, rgba)); - i - }) - }; - let key = (view(base), view(overlay)); + let usable = [has_uv, has_uv1 || (layered && has_uv), has_uv, has_uv]; + let mut pictures = materials.pictures(part.drawable, mesh.shader); + pictures.iter_mut().zip(usable).for_each(|(p, usable)| *p = p.filter(|_| usable)); + // A shader without a picture among others of its material that have + // one, whose colour says nothing about it. + let plain = pictures[0].is_none() + && model + .material_index(part.drawable, mesh.shader) + .and_then(|m| model.materials.get(m)) + .is_some_and(|m| m.textured); + let decal = d + .shaders + .get(usize::from(mesh.shader)) + .is_some_and(|s| rage_formats::names::value(s.name_hash).contains("decal")); + if plain && decal { + continue; + } + let mut key = pictures.map(|p| p.map_or(0, |p| Arc::as_ptr(p) as usize)); + key[0] = if plain { 1 } else { key[0] }; let texture = *texture_of.entry(key).or_insert_with(|| { - let base = key.0.map_or(&gpu.white, |i| &views[&i]); - let overlay = key.1.map_or(&gpu.clear, |i| &views[&i]); - textures.push(texture_bind_group(gpu, base, overlay)); + let [base, overlay, normal, specular] = pictures.map(|p| p.and_then(|p| picture_view(gpu, p))); + textures.push(texture_bind_group( + gpu, + base.as_ref().unwrap_or(if plain { &gpu.grey } else { &gpu.white }), + overlay.as_ref().unwrap_or(&gpu.clear), + normal.as_ref().unwrap_or(&gpu.flat), + specular.as_ref().unwrap_or(&gpu.clear), + )); textures.len() - 1 }); let (mut lo, mut hi) = ([f32::MAX; 3], [f32::MIN; 3]); @@ -596,22 +1130,74 @@ fn upload(gpu: &Gpu, model: &LoadedModel, materials: &Materials) -> (Vec, part: part_index, drawable: part.drawable, shader: mesh.shader, - vertices: gpu.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: None, - contents: bytemuck::cast_slice(&vertices), - usage: wgpu::BufferUsages::VERTEX, - }), - indices: gpu.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: None, - contents: bytemuck::cast_slice(&mesh.indices), - usage: wgpu::BufferUsages::INDEX, - }), - count: mesh.indices.len() as u32, + base_vertex: all_vertices.len() as i32, + indices: all_indices.len() as u32..(all_indices.len() + mesh.indices.len()) as u32, texture, + decal, }); + all_vertices.extend_from_slice(&vertices); + all_indices.extend_from_slice(&mesh.indices); + } + } + Built { owner: Arc::downgrade(preview), draws, vertices: all_vertices, indices: all_indices, textures } +} + +/// Bytes of vertices or indices that share a buffer. +const BATCH: usize = 64 << 20; + +/// Puts models into buffers they share: changing buffers takes longer than +/// drawing a small model. +fn upload(gpu: &Gpu, built: Vec) -> Vec { + static NUMBER: AtomicU64 = AtomicU64::new(0); + let mut models = Vec::with_capacity(built.len()); + let mut rest = built.into_iter().peekable(); + while rest.peek().is_some() { + let (mut vertices, mut indices): (Vec, Vec) = (Vec::new(), Vec::new()); + let mut batch = Vec::new(); + while let Some(next) = rest.next_if(|b| { + let bytes = |v: usize, i: usize| (v * std::mem::size_of::()).max(i * 4); + batch.is_empty() || bytes(vertices.len() + b.vertices.len(), indices.len() + b.indices.len()) <= BATCH + }) { + let Built { owner, mut draws, vertices: v, indices: i, textures } = next; + for d in &mut draws { + d.base_vertex += vertices.len() as i32; + d.indices = d.indices.start + indices.len() as u32..d.indices.end + indices.len() as u32; + } + vertices.extend_from_slice(&v); + indices.extend_from_slice(&i); + batch.push((owner, draws, textures)); + } + // An empty buffer cannot be used. + if indices.is_empty() { + vertices.push(bytemuck::Zeroable::zeroed()); + indices.push(0); } + let buffer = |contents: &[u8], usage| { + gpu.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { label: None, contents, usage }) + }; + let vertices = buffer(bytemuck::cast_slice(&vertices), wgpu::BufferUsages::VERTEX); + let indices = buffer(bytemuck::cast_slice(&indices), wgpu::BufferUsages::INDEX); + let number = NUMBER.fetch_add(1, Ordering::Relaxed); + models.extend(batch.into_iter().map(|(owner, draws, textures)| GpuModel { + owner, + draws, + batch: number, + vertices: vertices.clone(), + indices: indices.clone(), + textures, + })); + } + models +} + +/// Uploads models ahead of their first picture; from any thread. +pub fn prepare(previews: &[Arc]) { + if let Some(gpu) = &*GPU { + let built = previews.par_iter().map(|p| build(gpu, p)).collect(); + previews.iter().for_each(|p| p.materials.release()); + let models = upload(gpu, built); + READY.lock().unwrap_or_else(|e| e.into_inner()).extend(models); } - (draws, textures) } fn targets(gpu: &Gpu, w: u32, h: u32) -> Targets { @@ -632,19 +1218,22 @@ fn targets(gpu: &Gpu, w: u32, h: u32) -> Targets { let resolve = make(COLOR_FORMAT, 1, wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::COPY_SRC); let depth = make(DEPTH_FORMAT, SAMPLES, wgpu::TextureUsages::RENDER_ATTACHMENT); let padded_row = (4 * w).div_ceil(256) * 256; - let readback = gpu.device.create_buffer(&wgpu::BufferDescriptor { - label: Some("readback"), - size: (padded_row * h) as u64, - usage: wgpu::BufferUsages::COPY_DST | wgpu::BufferUsages::MAP_READ, - mapped_at_creation: false, - }); + let readback = || { + gpu.device.create_buffer(&wgpu::BufferDescriptor { + label: Some("readback"), + size: (padded_row * h) as u64, + usage: wgpu::BufferUsages::COPY_DST | wgpu::BufferUsages::MAP_READ, + mapped_at_creation: false, + }) + }; Targets { size: (w, h), msaa: msaa.create_view(&Default::default()), resolve_view: resolve.create_view(&Default::default()), resolve, depth: depth.create_view(&Default::default()), - readback, + readback: [readback(), readback()], + pending: None, padded_row, } } @@ -664,13 +1253,17 @@ fn frustum_planes(m: &[f32; 16]) -> [[f32; 4]; 6] { planes } +/// The largest factor a placement scales by. +fn scale_of(model: &math::Mat4) -> f32 { + (0..3) + .map(|k| (model[k * 4].powi(2) + model[k * 4 + 1].powi(2) + model[k * 4 + 2].powi(2)).sqrt()) + .fold(0.0f32, f32::max) +} + /// Whether a bounding sphere in model space, placed by `model`, touches the view. fn sphere_visible(planes: &[[f32; 4]; 6], model: &math::Mat4, (centre, radius): ([f32; 3], f32)) -> bool { let c = math::transform_point(model, centre); - let scale = (0..3) - .map(|k| (model[k * 4].powi(2) + model[k * 4 + 1].powi(2) + model[k * 4 + 2].powi(2)).sqrt()) - .fold(0.0f32, f32::max); - let r = radius * scale; + let r = radius * scale_of(model); planes.iter().all(|p| p[0] * c[0] + p[1] * c[1] + p[2] * c[2] + p[3] >= -r) } @@ -700,9 +1293,10 @@ fn view_projection(cam: &Camera, w: u32, h: u32, near: f32, far: f32) -> [f32; 1 let short = w.min(h) as f32; let t = (cam.fov / 2.0).tan(); let (sx, sy) = (short / w as f32 / t, short / h as f32 / t); - // Perspective with depth 0..1 (wgpu). - let a = far / (near - far); - let proj = [sx, 0.0, 0.0, 0.0, 0.0, sy, 0.0, 0.0, 0.0, 0.0, a, -1.0, 0.0, 0.0, a * near, 0.0]; + // Perspective with depth 1 (near) to 0: floats are finest at 0, which + // makes up for the far being so dense. Maps are kilometres wide. + let a = near / (far - near); + let proj = [sx, 0.0, 0.0, 0.0, 0.0, sy, 0.0, 0.0, 0.0, 0.0, a, -1.0, 0.0, 0.0, a * far, 0.0]; math::mul(&proj, &view) } @@ -716,7 +1310,7 @@ pub fn render( w: u32, h: u32, ) -> Option { - render_scene(&[SceneItem { preview, look, model: math::IDENTITY, skin }], &[], &[], camera, w, h) + render_scene(&[SceneItem { preview, look, model: math::IDENTITY, skin }], &Around::default(), camera, w, h) } /// One model of a scene: what is shown, where it stands and its pose. @@ -773,36 +1367,37 @@ fn sprite_vertices(sprites: &[Sprite], camera: &Camera) -> (Vec, V (vertices, runs) } +/// What there is in a scene besides models. +#[derive(Default)] +pub struct Around<'a> { + pub lights: &'a [SceneLight], + pub sprites: &'a [Sprite], + pub outdoors: Option, + /// The number of a view that is drawn again and again: it may get the + /// picture before, which is much quicker. + pub live: Option, +} + /// Renders several models (each with its own placement and pose) and /// particles from `camera`, e.g. all actors of a cutscene. -pub fn render_scene( - items: &[SceneItem], - lights: &[SceneLight], - sprites: &[Sprite], - camera: &Camera, - w: u32, - h: u32, -) -> Option { +pub fn render_scene(items: &[SceneItem], around: &Around, camera: &Camera, w: u32, h: u32) -> Option { + let &Around { lights, sprites, outdoors, live } = around; STATE.with(|state| { let mut st = state.borrow_mut(); let st = &mut *st; - if st.gpu.is_none() { - st.gpu = Some(init()); - } - let gpu = st.gpu.as_ref()?.as_ref()?; + let gpu = GPU.as_ref()?; let (w, h) = (w.clamp(1, 8192), h.clamp(1, 8192)); // Upload once per model; forget models that are gone. A scene places // the same model many times: look models up by pointer, not by a scan // of every uploaded model for every placement. + st.models.append(&mut READY.lock().unwrap_or_else(|e| e.into_inner())); st.models.retain(|m| m.owner.strong_count() > 0); - let mut uploaded: std::collections::HashSet<*const crate::ModelPreview> = - st.models.iter().map(|m| m.owner.as_ptr()).collect(); - for item in items { - if uploaded.insert(Arc::as_ptr(item.preview)) { - let (draws, textures) = upload(gpu, &item.preview.loaded, &item.preview.materials); - st.models.push(GpuModel { owner: Arc::downgrade(item.preview), draws, textures }); - } + let mut known: HashSet<*const crate::ModelPreview> = st.models.iter().map(|m| m.owner.as_ptr()).collect(); + let new: Vec<&Arc> = + items.iter().map(|item| item.preview).filter(|p| known.insert(Arc::as_ptr(p))).collect(); + if !new.is_empty() { + st.models.extend(upload(gpu, new.into_iter().map(|p| build(gpu, p)).collect())); } st.sprite_textures.retain(|(owner, _)| owner.strong_count() > 0); @@ -811,13 +1406,13 @@ pub fn render_scene( if !st.sprite_textures.iter().any(|(o, _)| o.as_ptr() == ptr) { let t = &sprite.texture; let view = upload_texture(&gpu.device, &gpu.queue, t.width, t.height, &t.rgba); - st.sprite_textures.push((Arc::downgrade(t), texture_bind_group(gpu, &view, &gpu.clear))); + st.sprite_textures.push((Arc::downgrade(t), plain_bind_group(gpu, &view))); } } if st.targets.as_ref().is_none_or(|t| t.size != (w, h)) { st.targets = Some(targets(gpu, w, h)); } - let t = st.targets.as_ref()?; + let t = st.targets.as_mut()?; let near = (camera.distance * 0.01).max(0.001); let far = camera.distance + camera.radius * 4.0 + 1.0; @@ -833,10 +1428,28 @@ pub fn render_scene( direction: [dir[0], dir[1], dir[2], cos], }; } + // How long the sides of the picture are, one away from the camera. + let tan = (camera.fov / 2.0).tan(); + let short = w.min(h) as f32; + let edge = |axis: [f32; 3], side: u32, last: f32| { + let reach = tan * side as f32 / short; + [axis[0] * reach, axis[1] * reach, axis[2] * reach, last] + }; + let light = light_at(outdoors.map_or(12.0, |o| o.hour)); + let wide = |v: [f32; 3], last: f32| [v[0], v[1], v[2], last]; let globals = Globals { view_proj: view_projection(camera, w, h, near, far), forward: [camera.forward[0], camera.forward[1], camera.forward[2], lights.len().min(MAX_LIGHTS) as f32], lights: gpu_lights, + eye: [camera.eye[0], camera.eye[1], camera.eye[2], outdoors.map_or(0.0, |o| o.haze)], + right: edge(camera.right, w, if outdoors.is_some() { 1.0 } else { 0.0 }), + up: edge(camera.up, h, 0.0), + sun: wide(light.towards, outdoors.map_or(0.0, |o| o.seconds)), + sun_colour: wide(light.colour, light.lamps), + ambient: wide(light.ambient, outdoors.map_or(1.0, |o| o.brightness)), + zenith: wide(light.zenith, 0.0), + horizon: wide(light.horizon, 0.0), + below: wide(light.below, 0.0), }; let globals_buffer = gpu.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { label: Some("globals"), @@ -851,51 +1464,57 @@ pub fn render_scene( // Shown draws of every item with their colours (hidden parts and // materials left out, and unskinned ones outside the view). - let model_of: HashMap<*const crate::ModelPreview, usize> = - st.models.iter().enumerate().map(|(i, m)| (m.owner.as_ptr(), i)).collect(); + let model_of: HashMap = + st.models.iter().enumerate().map(|(i, m)| (m.owner.as_ptr() as usize, i)).collect(); let planes = frustum_planes(&globals.view_proj); - let mut shown: Vec<(usize, &GpuModel, &Draw, [f32; 4])> = Vec::new(); - for (index, item) in items.iter().enumerate() { - let model = &st.models[*model_of.get(&Arc::as_ptr(item.preview))?]; - for d in &model.draws { - if !item.look.parts.get(d.part).copied().unwrap_or(false) { - continue; - } - if item.skin.is_none() && !sphere_visible(&planes, &item.model, d.sphere) { - continue; - } - if let Some(tint) = item.preview.loaded.tint(item.look, d.drawable, d.shader) { - shown.push((index, model, d, tint)); - } - } - } - let stride = gpu.tint_stride as usize; - let mut tints = vec![0u8; stride * shown.len().max(1)]; - for (i, (index, _, _, tint)) in shown.iter().enumerate() { - tints[i * stride..i * stride + 16].copy_from_slice(bytemuck::cast_slice(tint)); - tints[i * stride + 16..i * stride + DRAW_DATA].copy_from_slice(bytemuck::cast_slice(&items[*index].model)); - } - let tint_buffer = gpu.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: Some("draws"), - contents: &tints, - usage: wgpu::BufferUsages::UNIFORM, - }); - let tint_group = gpu.device.create_bind_group(&wgpu::BindGroupDescriptor { - label: None, - layout: &gpu.tint_layout, - entries: &[wgpu::BindGroupEntry { - binding: 0, - resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding { - buffer: &tint_buffer, - offset: 0, - size: wgpu::BufferSize::new(DRAW_DATA as u64), - }), - }], + // Pixels of something as large as it is far. + let pixels = short / 2.0 / tan; + let too_small = |model: &math::Mat4, (centre, radius): ([f32; 3], f32)| { + let c = math::transform_point(model, centre); + let far = (0..3).map(|k| (c[k] - camera.eye[k]).powi(2)).sum::().sqrt(); + radius * scale_of(model) * pixels < SMALLEST * (far - radius).max(0.0) + }; + // Whether it lies on others (those come last), the skinned item it is + // (or none), the model, the draw; the same ones are drawn together. + type Key = (bool, usize, usize, usize); + const NO_SKIN: usize = usize::MAX; + let models = &st.models; + let mut shown: Vec<(Key, Instance)> = items + .par_iter() + .enumerate() + .flat_map_iter(|(index, item)| { + let number = model_of.get(&(Arc::as_ptr(item.preview) as usize)).copied(); + let draws = number.map_or(&[][..], |n| &models[n].draws[..]); + let skin = if item.skin.is_some() { index } else { NO_SKIN }; + let (planes, too_small) = (&planes, &too_small); + draws.iter().enumerate().filter_map(move |(k, d)| { + if !item.look.parts.get(d.part).copied().unwrap_or(false) { + return None; + } + if item.skin.is_none() + && (!sphere_visible(planes, &item.model, d.sphere) + || (outdoors.is_some() && too_small(&item.model, d.sphere))) + { + return None; + } + let tint = item.preview.loaded.tint(item.look, d.drawable, d.shader)?; + Some(((d.decal, skin, number?, k), Instance { model: item.model, tint })) + }) + }) + .collect(); + shown.par_sort_unstable_by_key(|(key, _)| *key); + let instances: Vec = shown.iter().map(|(_, i)| *i).collect(); + let instance_buffer = (!instances.is_empty()).then(|| { + gpu.device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("instances"), + contents: bytemuck::cast_slice(&instances), + usage: wgpu::BufferUsages::VERTEX, + }) }); // A bone palette per skinned item; the others share the rest pose. let palette_group = |skin: Option<&[math::Mat4]>| { - let mut palette = vec![math::IDENTITY; MAX_BONES]; + let mut palette = vec![math::IDENTITY; gpu.bones]; for (slot, m) in palette.iter_mut().zip(skin.unwrap_or_default()) { *slot = *m; } @@ -937,22 +1556,53 @@ pub fn render_scene( })], depth_stencil_attachment: Some(wgpu::RenderPassDepthStencilAttachment { view: &t.depth, - depth_ops: Some(wgpu::Operations { load: wgpu::LoadOp::Clear(1.0), store: wgpu::StoreOp::Discard }), + depth_ops: Some(wgpu::Operations { load: wgpu::LoadOp::Clear(0.0), store: wgpu::StoreOp::Discard }), stencil_ops: None, }), timestamp_writes: None, occlusion_query_set: None, multiview_mask: None, }); - pass.set_pipeline(&gpu.pipeline); pass.set_bind_group(0, &globals_group, &[]); - for (i, (index, model, d, _)) in shown.iter().enumerate() { - pass.set_bind_group(3, skin_groups[*index].as_ref().unwrap_or(rest_pose), &[]); - pass.set_bind_group(1, &model.textures[d.texture], &[]); - pass.set_bind_group(2, &tint_group, &[(i * stride) as u32]); - pass.set_vertex_buffer(0, d.vertices.slice(..)); - pass.set_index_buffer(d.indices.slice(..), wgpu::IndexFormat::Uint32); - pass.draw_indexed(0..d.count, 0, 0..1); + if let Some(buffer) = &instance_buffer { + pass.set_pipeline(&gpu.pipeline); + pass.set_vertex_buffer(1, buffer.slice(..)); + let mut last = (None, None, None); + let mut first = 0; + let mut decals = false; + for run in shown.chunk_by(|a, b| a.0 == b.0) { + let (decal, skin, number, k) = run[0].0; + if decal && !decals { + pass.set_pipeline(&gpu.decal); + decals = true; + } + let model = &st.models[number]; + let d = &model.draws[k]; + // Only what changes is set. + if last.0 != Some(skin) { + let group = skin_groups.get(skin).and_then(Option::as_ref).unwrap_or(rest_pose); + pass.set_bind_group(2, group, &[]); + } + if last.1 != Some(model.batch) { + pass.set_vertex_buffer(0, model.vertices.slice(..)); + pass.set_index_buffer(model.indices.slice(..), wgpu::IndexFormat::Uint32); + } + if last.2 != Some((number, d.texture)) { + pass.set_bind_group(1, &model.textures[d.texture], &[]); + } + last = (Some(skin), Some(model.batch), Some((number, d.texture))); + let count = run.len() as u32; + pass.draw_indexed(d.indices.clone(), d.base_vertex, first..first + count); + first += count; + } + } + if outdoors.is_some() { + pass.set_pipeline(&gpu.sky); + pass.draw(0..3, 0..1); + if outdoors.is_some_and(|o| o.sea) { + pass.set_pipeline(&gpu.sea); + pass.draw(0..4, 0..1); + } } // Particles last, over what they are in front of. if let Some(buffer) = &sprite_buffer { @@ -962,13 +1612,13 @@ pub fn render_scene( continue; }; pass.set_pipeline(if additive { &gpu.sprite_add } else { &gpu.sprite_blend }); - pass.set_bind_group(0, &globals_group, &[]); pass.set_bind_group(1, group, &[]); let range = (first * 6) as u32..((first + count) * 6) as u32; pass.draw(range, 0..1); } } } + let here = t.pending.as_ref().map_or(0, |(_, other, _)| 1 - other); encoder.copy_texture_to_buffer( wgpu::TexelCopyTextureInfo { texture: &t.resolve, @@ -977,7 +1627,7 @@ pub fn render_scene( aspect: wgpu::TextureAspect::All, }, wgpu::TexelCopyBufferInfo { - buffer: &t.readback, + buffer: &t.readback[here], layout: wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(t.padded_row), @@ -986,13 +1636,35 @@ pub fn render_scene( }, wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 }, ); - gpu.queue.submit([encoder.finish()]); + let submitted = gpu.queue.submit([encoder.finish()]); - t.readback.map_async(wgpu::MapMode::Read, .., |_| {}); - gpu.device.poll(wgpu::PollType::wait_indefinitely()).ok()?; + t.readback[here].map_async(wgpu::MapMode::Read, .., |_| {}); + let wait = |index: &wgpu::SubmissionIndex| { + let wait = wgpu::PollType::Wait { submission_index: Some(index.clone()), timeout: None }; + gpu.device.poll(wait).ok() + }; + // While things move, the picture before is taken: it is there by now, + // and the graphics card works while the next one is put together. + let before = t.pending.take(); + let taken = match (live, before) { + (Some(id), Some((of, other, index))) if of == id => { + wait(&index)?; + t.pending = Some((id, here, submitted)); + other + } + (_, before) => { + wait(&submitted)?; + if let Some((_, other, _)) = before { + t.readback[other].unmap(); + } + // The first of several is shown twice. + t.pending = live.map(|id| (id, here, submitted)); + here + } + }; let mut pixels = slint::SharedPixelBuffer::::new(w, h); { - let data = t.readback.get_mapped_range(..).ok()?; + let data = t.readback[taken].get_mapped_range(..).ok()?; let out = pixels.make_mut_bytes(); let row = (4 * w) as usize; for y in 0..h as usize { @@ -1000,7 +1672,9 @@ pub fn render_scene( out[y * row..(y + 1) * row].copy_from_slice(&data[src..src + row]); } } - t.readback.unmap(); + if t.pending.as_ref().is_none_or(|(_, kept, _)| *kept != taken) { + t.readback[taken].unmap(); + } Some(slint::Image::from_rgba8_premultiplied(pixels)) }) } @@ -1036,6 +1710,22 @@ mod tests { assert!(super::sphere_visible(&planes, &at([40.0, 10.0, 0.0]), ([0.0; 3], 40.0))); } + #[test] + fn the_sun_moves() { + let height = |hour| super::light_at(hour).towards[2]; + assert!(height(12.0) > 0.8 && height(8.0) > 0.2); + // At night there is a moon, and lamps. + assert!(height(0.0) > 0.5); + assert!(super::light_at(0.0).lamps > 1.0 && super::light_at(12.0).lamps == 0.0); + } + + #[test] + fn pictures_are_halved() { + let (w, h, half) = super::halved(2, 2, &[0, 0, 0, 0, 100, 0, 0, 0, 100, 0, 0, 0, 200, 0, 0, 0]); + assert_eq!((w, h, &half[..]), (1, 1, &[100, 0, 0, 0][..])); + assert_eq!(super::halved(4, 1, &[7; 16]).2, [7; 8]); + } + #[test] fn sprites_draw_far_first_in_runs() { use openrage_app::gta4_effects::{Image, Sprite}; @@ -1078,7 +1768,7 @@ mod tests { #[test] fn shader_is_valid_wgsl() { - let module = naga::front::wgsl::parse_str(super::SHADER).expect("WGSL parses"); + let module = naga::front::wgsl::parse_str(&super::shader_source(super::MAX_BONES)).expect("WGSL parses"); naga::valid::Validator::new(naga::valid::ValidationFlags::all(), naga::valid::Capabilities::empty()) .validate(&module) .expect("WGSL validates"); diff --git a/crates/openrage-gui/src/main.rs b/crates/openrage-gui/src/main.rs index de19007..387ac8e 100644 --- a/crates/openrage-gui/src/main.rs +++ b/crates/openrage-gui/src/main.rs @@ -16,12 +16,14 @@ mod debug; mod docs; mod editor; mod extract_ui; +mod fly; mod gpu; mod history; mod model_ui; mod mods_ui; mod navigate; mod openformats_ui; +mod player; mod plugins; mod plugins_ui; mod preview; @@ -29,12 +31,14 @@ mod scene; mod search; mod setup_ui; mod sound_ui; +mod stream; mod tools_ui; mod util; +mod video_ui; mod viewer; mod xmlview; -use std::cell::RefCell; +use std::cell::{Cell, RefCell}; use std::fs::File; use std::io::Read; use std::path::{Path, PathBuf}; @@ -62,6 +66,7 @@ use about::*; use archive_ops::*; use asi_ui::*; use callbacks::*; +#[cfg(debug_assertions)] use debug::*; use docs::*; use extract_ui::*; @@ -75,6 +80,7 @@ use setup_ui::*; use sound_ui::*; use tools_ui::*; use util::*; +use video_ui::start_video_preview; slint::include_modules!(); @@ -124,6 +130,8 @@ struct App { /// Play the selected sound as soon as it is decoded (double-click). play_when_ready: bool, audio_timer: slint::Timer, + /// The selected video; `sound` holds its sound. + video: Option, /// The list in the preview area: models suggested for a clip dictionary /// (`suggest_ycd` set), or the sounds of an audio container (`suggest_awc`). suggestions: Vec, @@ -131,7 +139,8 @@ struct App { suggest_awc: String, /// Models for `suggest_ycd` are still being looked for. suggest_pending: bool, - index_running: bool, + /// The game whose index is being updated, and how to stop that. + index_running: Option<(PathBuf, Arc)>, /// Plugin package shown in the install dialog. plugin_package: Option>, } @@ -156,6 +165,25 @@ fn main() -> anyhow::Result<()> { } let cfg = Config::load(); plugins::reload(&cfg); + // GTA VI archives are read through once to find their files: show how far that is. + let status = ui.as_weak(); + openrage_app::rpf9::register(std::sync::Arc::new(move |step| { + static SHOWN: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(u64::MAX); + let text = match step { + Some((name, done, total)) => { + let percent = done * 100 / total.max(1); + if SHOWN.swap(percent, Ordering::Relaxed) == percent { + return; + } + format!("Indexing {name} (read once, then remembered)… {percent} %") + } + None => { + SHOWN.store(u64::MAX, Ordering::Relaxed); + String::new() + } + }; + let _ = status.upgrade_in_event_loop(move |ui| ui.set_status(text.into())); + })); let keys = load_keys().unwrap_or(None); // Several games set up and none chosen as default: ask (after the window is up). let known = installed_games(&cfg); @@ -167,7 +195,9 @@ fn main() -> anyhow::Result<()> { default.or_else(|| cfg.game_dir.clone().filter(|d| known.contains(d))).or_else(|| known.first().cloned()) }; let rdr2_ready = game_dir.as_deref().is_some_and(|d| { - (is_rdr2_dir(d) && register_rdr2(d)) || (is_gta4_dir(d) && openrage_app::gta4::register(d).is_ok()) + (is_rdr2_dir(d) && register_rdr2(d)) + || (is_gta4_dir(d) && openrage_app::gta4::register(d).is_ok()) + || detect::is_gta6_dir(d) }); APP.with(|a| { @@ -202,11 +232,12 @@ fn main() -> anyhow::Result<()> { sound_start: 0.0, play_when_ready: false, audio_timer: slint::Timer::default(), + video: None, suggestions: Vec::new(), suggest_ycd: String::new(), suggest_awc: String::new(), suggest_pending: false, - index_running: false, + index_running: None, plugin_package: None, }) }); diff --git a/crates/openrage-gui/src/model_ui.rs b/crates/openrage-gui/src/model_ui.rs index ff73b76..ddd1a93 100644 --- a/crates/openrage-gui/src/model_ui.rs +++ b/crates/openrage-gui/src/model_ui.rs @@ -354,11 +354,17 @@ pub(crate) fn axis_view(axis: i32, current: openrage_app::render::View) -> openr v } +/// The size of pictures made for the preview area, in the screen's pixels. +pub(crate) fn preview_pixels(ui: &AppWindow) -> (usize, usize) { + let scale = ui.window().scale_factor().clamp(0.5, 4.0); + let pixels = |length: f32| ((length - 16.0).max(64.0) * scale).round() as usize; + (pixels(ui.get_preview_area_width()), pixels(ui.get_preview_area_height())) +} + /// Renders the current model at the size of the preview area. pub(crate) fn render_model(ui: &AppWindow) { let Some((model, view)) = with_app(|a| a.model.clone().map(|m| (m, a.model_view))) else { return }; - let w = (ui.get_preview_area_width() - 16.0).max(64.0) as usize; - let h = (ui.get_preview_area_height() - 16.0).max(64.0) as usize; + let (w, h) = preview_pixels(ui); if let Some((img, gizmo)) = render_image(&model, |lo, hi| openrage_app::render::orbit_camera(lo, hi, view), None, w, h) { @@ -474,15 +480,30 @@ pub(crate) fn save_png_image(img: &slint::Image, name: String, main: Weak bool { let n = item.name.to_ascii_lowercase(); - n.ends_with(".ycd") || (n.ends_with(".wad") && item.kind == ItemKind::Resource) + n.ends_with(".ycd") || n.ends_with(".#cd") || (n.ends_with(".wad") && item.kind == ItemKind::Resource) } /// Selecting a `.ycd` (or `.wad`): its clips and (found in the background) the models it fits. pub(crate) fn show_clip_dictionary(ui: &AppWindow, vpath: String, mut info: Meta) { match load_clip_dictionary(&vpath) { + Ok(dict) if vpath.to_ascii_lowercase().ends_with(".#cd") => { + // Bones are named by hash there, so no models are looked for. + info.push(kv("Clips", dict.clips.len())); + for c in dict.clips.iter().take(40) { + let animation = c.parts.first().and_then(|p| dict.animations.get(p.animation)); + let size = animation + .map_or_else(String::new, |a| format!(" · {} frames · {} tracks", a.frames, a.tracks.len())); + info.push(kv(&c.name, format!("{:.2} s{size}", c.duration()))); + } + if dict.clips.len() > 40 { + info.push(note(format!("… and {} more", dict.clips.len() - 40))); + } + info.push(note("To play it on a model with a skeleton, open the model and search for this file there.")); + set_meta(ui, &info); + } Ok(dict) => { let profile = suggest::Profile::new(&vpath, &dict); info.push(kv("Clips", dict.clips.len())); diff --git a/crates/openrage-gui/src/navigate.rs b/crates/openrage-gui/src/navigate.rs index b23c5d4..9df54e2 100644 --- a/crates/openrage-gui/src/navigate.rs +++ b/crates/openrage-gui/src/navigate.rs @@ -24,7 +24,14 @@ pub(crate) fn start_browsing(ui: &AppWindow) { format!("OpenRAGE — {name}") }); ui.set_window_title(title.into()); + ui.set_has_world_map(with_app(|a| a.game_dir.as_deref().is_some_and(detect::is_gta6_dir))); start_index_update(ui); + // GTA VI: its archives are read through once to find their files. That + // starts now, not when an archive is opened first. + match with_app(|a| a.game_dir.clone()).filter(|d| detect::is_gta6_dir(d)) { + Some(dir) => openrage_app::rpf9::index_in_background(&dir), + None => openrage_app::rpf9::stop_background(), + } refresh_asi(ui); refresh_tool_menu(ui); refresh_undo(ui); @@ -516,6 +523,18 @@ pub(crate) fn set_meta(ui: &AppWindow, meta: &Meta) { pub(crate) fn show_folder_info(ui: &AppWindow) { // Read before `with_app` below: it would borrow the app state twice. let overlay = overlay_name(); + // A video does not go on without its picture. + if ui.get_preview_loading() || with_app(|a| a.video.is_some()) { + with_app(|a| a.preview_generation.fetch_add(1, Ordering::SeqCst)); + ui.set_preview_loading(false); + stop_sound(ui); + ui.set_audio_mode(false); + ui.set_video_mode(false); + with_app(|a| { + a.sound = None; + a.video = None; + }); + } let info = with_app(|a| { let l = a.listing.as_ref()?; let name = location_title(l); @@ -614,6 +633,18 @@ pub(crate) fn show_folder_info(ui: &AppWindow) { ), ] } + Location::Rpf9(rpf, _) => { + let mut meta = vec![ + kv( + "Type", + if rpf.is_native() { "Inside a GTA VI archive" } else { "Recovered from a GTA VI archive" }, + ), + kv("Archive", rpf.display_name().rsplit('/').next().unwrap_or_default()), + ]; + meta.extend(crate::preview::rpf9_archive_info(rpf)); + meta.push(note("Read-only. Extract… saves the files unpacked.")); + meta + } Location::Gta4(a, _) => { let mut meta = vec![kv("Type", "Inside a GTA IV archive")]; meta.extend(gta4_archive_info(a)); diff --git a/crates/openrage-gui/src/player.rs b/crates/openrage-gui/src/player.rs new file mode 100644 index 0000000..489c397 --- /dev/null +++ b/crates/openrage-gui/src/player.rs @@ -0,0 +1,264 @@ +//! The video player: a window for each video, with its own sound. + +use std::cell::RefCell; +use std::rc::Rc; + +use crate::video_ui::{Event, Video, open_video}; +use crate::*; +use rage_formats::awc::Pcm; +use sound_ui::SOUND_END_MARGIN; + +type Shared = Rc>; + +thread_local! { + static OPEN: RefCell> = const { RefCell::new(Vec::new()) }; + static NEXT_ID: Cell = const { Cell::new(0) }; + /// As last set in a window. + static VOLUME: Cell = const { Cell::new(1.0) }; +} + +#[derive(Default)] +struct State { + video: Option-12 3d_prop 0x1F4 pack.name"; + assert_eq!(without_numbers(xml), "a x 3d_prop 0x1F4 pack name a "); + } + + #[test] + fn metadata_words_leave_out_unknown_hashes() { + let xml = "weapon_pistol".to_owned(); + let (text, words) = metadata_content(Some((xml.clone(), Vec::new())), b"data").unwrap(); + assert_eq!((text, words), (xml, vec!["weapon_pistol".to_owned()])); + } + + #[test] + fn strings_stand_in_for_metadata_that_cannot_be_converted() { + let data = b"\x01\x02body_shell\0ab\0\xff\xfebinary\0Geb\xc3\xa4ude\0"; + let (text, words) = metadata_content(None, data).unwrap(); + assert_eq!(text, "\nbody_shell\nGebäude"); + assert_eq!(words, ["Geb", "body_shell", "ude"]); + assert!(metadata_content(None, b"\0\x01").is_none()); + let (text, _) = metadata_content(Some(("".to_owned(), vec!["an error".to_owned()])), data).unwrap(); + assert!(text.starts_with("\nbody_shell")); + } + + #[test] + fn finds_hashed_names() { + let [exact, lower] = hashed_names("Adder").unwrap(); + assert_eq!(lower, "hash_b779a091"); + assert_ne!(exact, lower); + assert!(hashed_names("two words").is_none() && hashed_names("a.b").is_none()); + let text = "\n \n"; + for query in ["Adder", "0xB779A091"] { + assert_eq!(snippet(text, query).as_deref(), Some("")); + } + assert_eq!(snippet(text, "0x"), None); + } + #[test] fn finds_snippet() { + assert_eq!(snippet("a gun\nthe gun of A", "of gun").as_deref(), Some("the gun of A")); assert_eq!(snippet("a\n Pistol\nc", "pistol").as_deref(), Some("Pistol")); } } diff --git a/crates/rage-index/src/gta6.rs b/crates/rage-index/src/gta6.rs new file mode 100644 index 0000000..d7a987c --- /dev/null +++ b/crates/rage-index/src/gta6.rs @@ -0,0 +1,141 @@ +//! Names of GTA VI's files from those of others. +//! +//! The files of one thing lie in different archives: its model in one, what +//! rays hit of it in another. An archive only tells the hashes of its files' +//! names; with the names of all archives together, more of them are known. + +use std::collections::{HashMap, HashSet}; + +use rage_core::hash::joaat; +use rage_rpf::rpf9_names::hash64; +use rayon::prelude::*; +use rusqlite::params; + +use crate::{Index, IndexError, update::stem}; + +/// What files that belong to one called otherwise have at the end. +const ENDINGS: [&str; 14] = + ["", "_children", "_lod", "_slod", "_lod1", "_l1", "_l2", "_l3", "_m", "_a", "_b", "_d", "_int", "_ext"]; + +/// Where unnamed files are, and how their names start: `entries/000012_.`. +const UNNAMED: &str = "entries/"; + +/// The hash in the stand-in for an unknown name. +fn unnamed_hash(name: &str) -> Option { + let (slot, rest) = name.split_once('_')?; + let hash = rest.get(..16)?; + let is_stand_in = slot.len() >= 6 && slot.bytes().all(|b| b.is_ascii_digit()) && rest[16..].starts_with('.'); + is_stand_in.then(|| u64::from_str_radix(hash, 16).ok()).flatten() +} + +impl Index { + /// Looks for the names of files without one among those of the other + /// files and the words of the texts, names the files in the index, and + /// gives the names that were found. + pub fn learn_gta6_names(&mut self) -> Result, IndexError> { + struct Unnamed { + id: i64, + vpath: String, + name: String, + } + let mut unnamed: HashMap> = HashMap::new(); + let mut stems: HashSet = HashSet::new(); + { + // Archives keep theirs, as the files in them are found by it. + let mut stmt = self.conn.prepare("SELECT id, vpath, name FROM entries WHERE kind >= 2")?; + let mut rows = stmt.query([])?; + while let Some(r) = rows.next()? { + let name: String = r.get(2)?; + match unnamed_hash(&name) { + Some(hash) => { + unnamed.entry(hash).or_default().push(Unnamed { id: r.get(0)?, vpath: r.get(1)?, name }) + } + None => { + stems.insert(stem(&name).to_owned()); + } + } + } + if unnamed.is_empty() { + return Ok(Vec::new()); + } + let mut stmt = self.conn.prepare("SELECT string FROM hashes")?; + let words = stmt.query_map([], |r| r.get::<_, String>(0))?; + for word in words { + stems.insert(word?); + } + } + let found: HashMap = stems + .par_iter() + .flat_map_iter(|stem| { + let shorter = stem.rmatch_indices('_').take(2).map(|(at, _)| stem[..at].to_owned()); + let longer = ENDINGS.iter().map(move |end| format!("{stem}{end}")); + longer.chain(shorter).filter_map(|name| { + let hash = hash64(name.as_bytes()); + unnamed.contains_key(&hash).then_some((hash, name)) + }) + }) + .collect(); + let tx = self.conn.transaction()?; + { + let mut taken = tx.prepare("SELECT 1 FROM entries WHERE source = (SELECT source FROM entries WHERE id = ?1) AND name_hash = ?2 AND vpath = ?3")?; + let mut rename = + tx.prepare("UPDATE entries SET vpath = ?2, name = ?3, name_hash = ?4, stem_hash = ?5 WHERE id = ?1")?; + for (hash, name) in &found { + for file in unnamed.remove(hash).unwrap_or_default() { + let Some(folder) = file.vpath.strip_suffix(&file.name).and_then(|v| v.strip_suffix(UNNAMED)) else { + continue; + }; + let ending = file.name.split_once('.').map_or("", |(_, ending)| ending); + let name = format!("{name}.{ending}"); + let vpath = format!("{folder}{name}"); + let hash = i64::from(joaat(&name)); + if !taken.exists(params![file.id, hash, vpath])? { + rename.execute(params![file.id, vpath, name, hash, i64::from(joaat(stem(&name)))])?; + } + } + } + } + tx.commit()?; + Ok(found.into_values().collect()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn stand_ins_tell_the_hash() { + assert_eq!(unnamed_hash("000012_00ff00000000abcd.#bdr"), Some(0x00FF_0000_0000_ABCD)); + assert_eq!(unnamed_hash("prop_000012_00ff00000000abcd.#dr"), None); + assert_eq!(unnamed_hash("000012_00ff.#dr"), None); + } + + #[test] + fn files_are_named_after_those_of_other_archives() { + let dir = std::env::temp_dir().join(format!("openrage-gta6-names-{}", std::process::id())); + let mut index = Index::open(&dir.join("index.sqlite")).unwrap(); + let house = hash64(b"House_01"); + let add = |index: &Index, vpath: &str, source: i64| { + let name = vpath.rsplit('/').next().unwrap(); + index + .conn + .execute( + "INSERT INTO entries(source, vpath, name, kind, size, name_hash, stem_hash) VALUES(?1, ?2, ?3, 3, 9, ?4, 0)", + params![source, vpath, name, i64::from(joaat(name))], + ) + .unwrap(); + }; + add(&index, "levels.rpf/House_01.#dr", 1); + add(&index, &format!("bvh.rpf/entries/000003_{house:016x}.#bdr"), 2); + add(&index, "bvh.rpf/entries/000004_0000000000000001.#bdr", 2); + assert_eq!(index.learn_gta6_names().unwrap(), ["House_01"]); + let count = |vpath: &str| -> i64 { + index.conn.query_row("SELECT count(*) FROM entries WHERE vpath = ?1", [vpath], |r| r.get(0)).unwrap() + }; + assert_eq!(count("bvh.rpf/House_01.#bdr"), 1); + assert_eq!(count("bvh.rpf/entries/000004_0000000000000001.#bdr"), 1); + drop(index); + let _ = std::fs::remove_dir_all(dir); + } +} diff --git a/crates/rage-index/src/lib.rs b/crates/rage-index/src/lib.rs index 77cff2b..f7fb2f4 100644 --- a/crates/rage-index/src/lib.rs +++ b/crates/rage-index/src/lib.rs @@ -6,13 +6,14 @@ //! * a hash dictionary of identifiers found in the game's text data, so a bare //! hash like `0xB779A091` can be turned back into a name; //! * a full-text index (FTS5, contentless) over text files, audio name tables -//! and GXT2 string tables. +//! and GXT2 string tables, and over the metadata of GTA VI as XML. //! //! The index is updated incrementally: only top-level archives whose size or //! modification time changed are re-read. #![forbid(unsafe_code)] mod content; +mod gta6; mod schema; mod search; mod update; @@ -21,7 +22,7 @@ use std::path::{Path, PathBuf}; use rusqlite::Connection; -pub use content::{content_for, snippet}; +pub use content::{content_for, node_text, snippet}; pub use search::{Hit, HitReason, LANGUAGES, SearchResults, language_of, parse_hash}; pub use update::{Progress, UpdateStats}; @@ -137,6 +138,11 @@ impl Index { }) } + /// Whether an update has run to its end. + pub fn is_complete(&self) -> Result { + Ok(schema::get_meta(&self.conn, "updated_at")?.is_some()) + } + /// Unix time the indexed archives last changed (added, changed or /// removed), not merely when they were last checked. Caches built from the /// index compare against it. Indexes from before it was recorded give the diff --git a/crates/rage-index/src/schema.rs b/crates/rage-index/src/schema.rs index 2ccc64f..cae99e3 100644 --- a/crates/rage-index/src/schema.rs +++ b/crates/rage-index/src/schema.rs @@ -5,7 +5,8 @@ use rusqlite::{Connection, OptionalExtension, params}; /// Bump when the schema or the indexing rules change; older databases are rebuilt. /// 3: GTA IV audio entries are indexed by name (not only their hash). /// 4: RDR2 archives (RPF8) are indexed; indexes that skipped them are rebuilt. -const SCHEMA_VERSION: &str = "4"; +/// 5: GTA VI archives (RPF9) are indexed; indexes that failed on them are rebuilt. +const SCHEMA_VERSION: &str = "5"; pub fn prepare(conn: &Connection) -> rusqlite::Result<()> { conn.pragma_update(None, "journal_mode", "WAL")?; diff --git a/crates/rage-index/src/search.rs b/crates/rage-index/src/search.rs index 9644f27..acc3820 100644 --- a/crates/rage-index/src/search.rs +++ b/crates/rage-index/src/search.rs @@ -5,6 +5,7 @@ use std::collections::HashSet; use rage_core::hash::joaat; use rusqlite::params; +use crate::content::hashed_names; use crate::{EntryTag, Index, IndexError}; /// Why an entry matched. @@ -60,11 +61,14 @@ pub fn parse_hash(query: &str) -> Option { None } -/// Text languages of GTA V, as used in the names of its `*.rpf` language archives. -pub const LANGUAGES: [&str; 13] = [ +/// Text languages of the games, as used in the names of its `*.rpf` language archives. +/// `brazilian` and `chinesetrad` are GTA VI's. +pub const LANGUAGES: [&str; 15] = [ "american", + "brazilian", "chinese", "chinesesimp", + "chinesetrad", "french", "german", "italian", @@ -77,26 +81,33 @@ pub const LANGUAGES: [&str; 13] = [ "spanish", ]; -/// Language of a localized file, derived from its path (`…/germandlc.rpf/…`, `…/german_rel.rpf/…`, `…/lang/german/…`). +/// Language of a localized file, derived from its path (`…/germandlc.rpf/…`, `…/german_rel.rpf/…`, +/// `…/german_final.rpf/…`, `…/lang/german/…`). pub fn language_of(vpath: &str) -> Option<&'static str> { vpath.split('/').find_map(|seg| { let seg = seg.to_ascii_lowercase(); // GTA IV keeps its text tables loose: `common/text/german.gxt`. let base = seg.strip_suffix(".rpf").or_else(|| seg.strip_suffix(".gxt")).unwrap_or(&seg); - let base = base.strip_suffix("dlc").or_else(|| base.strip_suffix("_rel")).unwrap_or(base); + let base = ["dlc", "_rel", "_final"].iter().find_map(|end| base.strip_suffix(end)).unwrap_or(base); LANGUAGES.iter().find(|&&l| l == base).copied() }) } /// FTS5 query: every whitespace-separated term must appear (prefix match). +/// Other characters end a word in the text too, so `vehicles.meta` means its +/// words next to each other. A single name may also appear as its hash. fn fts_query(query: &str) -> Option { let terms: Vec = query .split_whitespace() - .map(|t| t.chars().filter(|c| c.is_alphanumeric() || *c == '_').collect::()) - .filter(|t| !t.is_empty()) - .map(|t| format!("\"{t}\"*")) + .map(|t| t.split(|c: char| !c.is_alphanumeric() && c != '_').filter(|w| !w.is_empty()).collect::>()) + .filter(|words| !words.is_empty()) + .map(|words| format!("\"{}\"*", words.join(" "))) .collect(); - (!terms.is_empty()).then(|| terms.join(" ")) + let terms = (!terms.is_empty()).then(|| terms.join(" "))?; + Some(match hashed_names(query.trim()) { + Some([exact, lower]) => format!("{terms} OR \"{exact}\" OR \"{lower}\""), + None => terms, + }) } fn like_pattern(query: &str) -> String { @@ -155,20 +166,26 @@ impl Index { .query_map(params![hash as i64, fetch], row_to_hit(HitReason::NameHash))? .collect::>()?; push(hits, &mut results); - // GXT2 labels are indexed as `0xHASH text` lines. + // GXT2 labels are indexed as `0xHASH text` lines, unknown names in + // metadata as `hash_HASH`. let mut stmt = self.conn.prepare_cached( "SELECT e.vpath, e.name, e.kind, e.size FROM content JOIN entries e ON e.id = content.rowid WHERE content MATCH ?1 ORDER BY rank LIMIT ?2", )?; let hits: Vec = stmt - .query_map(params![format!("\"0x{hash:08x}\""), fetch * 20], row_to_hit(HitReason::Content))? + .query_map( + params![format!("\"0x{hash:08x}\" OR \"hash_{hash:08x}\""), fetch * 20], + row_to_hit(HitReason::Content), + )? .collect::>()?; push(hits.into_iter().filter(|h| wanted_language(&h.vpath)).collect(), &mut results); return Ok(results); } let mut stmt = self.conn.prepare_cached( - "SELECT vpath, name, kind, size FROM entries WHERE name LIKE ?1 ESCAPE '\\' + "SELECT vpath, name, kind, size FROM entries + WHERE name LIKE ?1 ESCAPE '\\' OR ?5 AND vpath LIKE ?1 ESCAPE '\\' + OR name_hash = ?3 OR stem_hash = ?3 -- also where only the hash is known ORDER BY CASE WHEN name_hash = ?3 OR stem_hash = ?3 THEN 0 -- exact name or stem WHEN name LIKE ?4 ESCAPE '\\' THEN 1 -- prefix @@ -176,20 +193,31 @@ impl Index { length(name), vpath LIMIT ?2", )?; let prefix = format!("{}%", like_pattern(query).trim_start_matches('%')); - let hits = stmt - .query_map(params![like_pattern(query), fetch, joaat(query) as i64, prefix], row_to_hit(HitReason::Name))? + let path = query.contains(['/', '\\']); + let pattern = like_pattern(&query.replace('\\', "/")); + let mut names: Vec = stmt + .query_map(params![pattern, fetch, joaat(query) as i64, prefix, path], row_to_hit(HitReason::Name))? .collect::>()?; - push(hits, &mut results); - + let mut texts: Vec = Vec::new(); if let Some(fts) = fts_query(query) { let mut stmt = self.conn.prepare_cached( "SELECT e.vpath, e.name, e.kind, e.size FROM content JOIN entries e ON e.id = content.rowid WHERE content MATCH ?1 ORDER BY rank LIMIT ?2", )?; - let hits: Vec = + texts = stmt.query_map(params![fts, fetch * 20], row_to_hit(HitReason::Content))?.collect::>()?; - push(hits.into_iter().filter(|h| wanted_language(&h.vpath)).collect(), &mut results); + texts.retain(|h| wanted_language(&h.vpath)); + } + // Names come first, but leave room for some text hits: a common word + // is in more names than are shown. + let named: HashSet<&str> = names.iter().map(|h| h.vpath.as_str()).collect(); + let room = texts.iter().filter(|h| !named.contains(h.vpath.as_str())).take(limit / 4).count(); + if names.len() > limit - room { + names.truncate(limit - room); + results.limited = true; } + push(names, &mut results); + push(texts, &mut results); Ok(results) } } @@ -213,12 +241,63 @@ mod tests { fn detects_languages() { assert_eq!(language_of("x64b.rpf/data/lang/chinese_rel.rpf/global.gxt2"), Some("chinese")); assert_eq!(language_of("update/x/dlc.rpf/x64/data/lang/germandlc.rpf/a.gxt2"), Some("german")); + assert_eq!(language_of("data.rpf/data/lang/chinesetrad_final.rpf/a.#ldbmt"), Some("chinesetrad")); assert_eq!(language_of("x64e.rpf/levels/gta5/vehicles.rpf/adder.yft"), None); } + #[test] + fn finds_paths_and_unnamed_entries_by_the_hash_of_their_name() { + let dir = std::env::temp_dir().join(format!("openrage-index-search-{}", std::process::id())); + let index = Index::open(&dir.join("index.sqlite")).unwrap(); + for (vpath, hash) in [("a.rpf/cars/adder.#ft", None), ("a.rpf/entries/000001_00ff.#mt", Some(joaat("adder")))] { + let name = vpath.rsplit('/').next().unwrap(); + index + .conn + .execute( + "INSERT INTO entries(source, vpath, name, kind, size, name_hash, stem_hash) + VALUES(1, ?1, ?2, 2, 0, ?3, ?3)", + params![vpath, name, hash.unwrap_or_else(|| joaat(name)) as i64], + ) + .unwrap(); + } + let hits = + |q: &str| -> Vec { index.search(q, 20, None).unwrap().hits.into_iter().map(|h| h.vpath).collect() }; + assert_eq!(hits("Adder").len(), 2); + assert_eq!(hits("0xB779A091"), ["a.rpf/entries/000001_00ff.#mt"]); + assert_eq!(hits("cars/add"), ["a.rpf/cars/adder.#ft"]); + assert_eq!(hits("cars\\add"), ["a.rpf/cars/adder.#ft"]); + assert!(hits("cars").is_empty()); + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn text_hits_have_room_beside_names() { + let dir = std::env::temp_dir().join(format!("openrage-index-room-{}", std::process::id())); + let index = Index::open(&dir.join("index.sqlite")).unwrap(); + for i in 0..30 { + let name = if i < 20 { format!("motel_{i}.#dr") } else { format!("{i}.xml") }; + let insert = "INSERT INTO entries(id, source, vpath, name, kind, size, name_hash, stem_hash) + VALUES(?1, 1, ?2, ?2, 2, 0, 0, 0)"; + index.conn.execute(insert, params![i, name]).unwrap(); + if i >= 20 { + index.conn.execute("INSERT INTO content(rowid, body) VALUES(?1, 'a motel')", [i]).unwrap(); + } + } + let results = index.search("motel", 12, None).unwrap(); + let texts = results.hits.iter().filter(|h| h.reason == HitReason::Content).count(); + assert_eq!((results.hits.len(), texts, results.limited), (12, 3, true)); + let results = index.search("motel", 30, None).unwrap(); + assert_eq!((results.hits.len(), results.limited), (30, false)); + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn builds_fts_queries() { - assert_eq!(fts_query("weapon_pistol").as_deref(), Some("\"weapon_pistol\"*")); + let hash = joaat("weapon_pistol"); + let expected = format!("\"weapon_pistol\"* OR \"hash_{hash:08x}\" OR \"hash_{hash:08x}\""); + assert_eq!(fts_query("weapon_pistol"), Some(expected)); + // The text is split at the dot, too. + assert_eq!(fts_query("vehicles.meta").as_deref(), Some("\"vehicles meta\"*")); assert_eq!(fts_query("a \"b\" -c").as_deref(), Some("\"a\"* \"b\"* \"c\"*")); assert_eq!(fts_query(" ").as_deref(), None); } diff --git a/crates/rage-index/src/update.rs b/crates/rage-index/src/update.rs index 68ef67f..96c42f6 100644 --- a/crates/rage-index/src/update.rs +++ b/crates/rage-index/src/update.rs @@ -5,23 +5,25 @@ //! including all archives nested inside it. Loose files are re-listed on //! every update (cheap). Archives are read in parallel; a single writer //! commits each archive in its own transaction, so a cancelled update keeps -//! everything finished so far. +//! everything finished so far. GTA VI archives hold up to thousands of others +//! and are written in parts; what a cancelled update wrote of one is replaced +//! by the next. use std::collections::{HashMap, HashSet}; use std::fs; use std::path::Path; use std::sync::Arc; -use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::mpsc; use std::time::{Instant, SystemTime, UNIX_EPOCH}; use rage_core::hash::joaat; use rage_crypto::GtaVKeys; -use rage_rpf::{EntryKind, Gta4Archive, Rpf7, vfs}; +use rage_rpf::{EntryKind, Gta4Archive, Rpf7, Rpf9, vfs}; use rayon::prelude::*; use rusqlite::params; -use crate::content::{content_for, is_indexable}; +use crate::content::{content_for, is_indexable, is_indexable_gta6, rpf9_content, without_numbers}; use crate::{EntryTag, Index, IndexError, schema}; #[derive(Debug, Clone, Default)] @@ -29,6 +31,9 @@ pub struct Progress { pub archives_done: usize, pub archives_total: usize, pub entries: u64, + /// How much of the archives that changed is read, in bytes of theirs. + pub bytes_done: u64, + pub bytes_total: u64, /// Archive that was just written. pub current: String, } @@ -53,6 +58,10 @@ struct DiskArchive { gta4: bool, /// A Red Dead Redemption 2 archive (RPF8) rather than RPF7. rdr2: bool, + /// A GTA VI archive (RPF9) rather than RPF7. + gta6: bool, + /// How much of it is read, for the progress. + read: AtomicU64, } /// Largest loose file whose text is indexed (GTA IV's text tables are ~6 MB). @@ -64,8 +73,11 @@ struct Record { kind: EntryTag, size: u64, body: Option, + /// The hash of a file whose name is not known, from the archive's table. + hash: Option, } +#[derive(Default)] struct Batch { rel: String, size: i64, @@ -73,9 +85,11 @@ struct Batch { records: Vec, dictionary: HashSet, errors: usize, + /// More of the same archive follows. + partial: bool, } -fn stem(name: &str) -> &str { +pub(crate) fn stem(name: &str) -> &str { name.split_once('.').map_or(name, |(s, _)| s) } @@ -122,7 +136,7 @@ fn scan_disk(game_dir: &Path) -> (Vec, Vec, HashSet body = Some(text); dictionary.extend(words); } - records.push(Record { vpath: rel.clone(), name, kind, size: meta.len(), body }); + records.push(Record { vpath: rel.clone(), name, kind, size: meta.len(), body, hash: None }); if meta.is_dir() { stack.push((entry.path(), rel)); } else if is_rpf { @@ -133,6 +147,8 @@ fn scan_disk(game_dir: &Path) -> (Vec, Vec, HashSet mtime: mtime_of(&meta), gta4, rdr2: !gta4 && rage_rpf::Rpf8::file_is_rpf8(&entry.path()), + gta6: !gta4 && Rpf9::file_is_rpf9(&entry.path()), + read: AtomicU64::new(0), }); } } @@ -171,7 +187,14 @@ fn read_gta4_archive(archive: &DiskArchive, mut batch: Batch) -> Batch { Err(_) => batch.errors += 1, } } - batch.records.push(Record { vpath: path.to_owned(), name: e.name.clone(), kind, size: e.size(), body }); + batch.records.push(Record { + vpath: path.to_owned(), + name: e.name.clone(), + kind, + size: e.size(), + body, + hash: None, + }); }); batch } @@ -203,6 +226,7 @@ fn read_rdr2_archive(archive: &DiskArchive, mut batch: Batch) -> Batch { kind: EntryTag::Dir, size: 0, body: None, + hash: None, }); } } @@ -213,6 +237,7 @@ fn read_rdr2_archive(archive: &DiskArchive, mut batch: Batch) -> Batch { kind: EntryTag::Archive, size: e.size(), body: None, + hash: None, }); match rpf.open_child(e) { Ok(child) if depth < rage_rpf::MAX_NESTING => walk(&child, &vpath, depth + 1, batch), @@ -233,7 +258,7 @@ fn read_rdr2_archive(archive: &DiskArchive, mut batch: Batch) -> Batch { Err(_) => batch.errors += 1, } } - batch.records.push(Record { vpath, name: base, kind, size: e.size(), body }); + batch.records.push(Record { vpath, name: base, kind, size: e.size(), body, hash: None }); } } match Rpf8::open_default(&archive.path) { @@ -243,16 +268,180 @@ fn read_rdr2_archive(archive: &DiskArchive, mut batch: Batch) -> Batch { batch } -/// Reads one top-level archive (and everything nested in it) into a batch. -fn read_archive(archive: &DiskArchive, keys: Option>) -> Batch { - let mut batch = Batch { - rel: archive.rel.clone(), - size: archive.size, - mtime: archive.mtime, - records: Vec::new(), - dictionary: HashSet::new(), - errors: 0, +/// Larger members of GTA VI archives are not read for their text. +const MAX_GTA6_TEXT: u64 = 64 << 20; +/// Archives with gigabytes of metadata that is all numbers. +const GTA6_NUMBERS: &str = "/audio/exterior_occlusion/"; +/// As many are read and converted at a time, and written in one transaction. +const TEXTS_AT_ONCE: usize = 64; + +/// Reads a GTA VI archive (RPF9) and the archives nested in it. Only archives +/// with a readable table are indexed: the recovery view of others takes a scan +/// of the whole file, and has no names. Every nested archive is a part of its +/// own, sent when it is read: opening one takes a while, as it learns names +/// from its members. Returns the last part, or `None` if cancelled. +fn read_gta6_archive( + archive: &DiskArchive, + mut batch: Batch, + cancel: &AtomicBool, + part: &(dyn Fn(Batch) + Sync), +) -> Option { + match Rpf9::open(&archive.path) { + Ok(rpf) if rpf.is_native() => { + walk_gta6(&rpf, &archive.rel, 0, cancel, part, &|| archive.part(), &|bytes| archive.add_read(bytes)); + } + // Not readable with this executable: tried again by the next update. + _ => { + batch.errors += 1; + batch.partial = true; + } + } + (!cancel.load(Ordering::Relaxed)).then_some(batch) +} + +fn walk_gta6( + rpf: &Rpf9, + prefix: &str, + depth: u8, + cancel: &AtomicBool, + part: &(dyn Fn(Batch) + Sync), + new_part: &(dyn Fn() -> Batch + Sync), + read: &(dyn Fn(u64) + Sync), +) { + let mut batch = new_part(); + let Ok(entries) = rpf.entries() else { + batch.errors += 1; + return part(batch); }; + // Folders come from the entries' paths. + let mut dirs: HashSet = HashSet::new(); + let mut children = Vec::new(); + let mut texts = Vec::new(); + for e in entries.iter() { + let name = rpf.entry_name(e); + let vpath = format!("{prefix}/{name}"); + let mut parts: Vec<&str> = name.split('/').collect(); + let base = parts.pop().unwrap_or_default().to_owned(); + let mut dir = prefix.to_owned(); + for folder in parts { + dir = format!("{dir}/{folder}"); + if dirs.insert(dir.to_ascii_lowercase()) { + batch.records.push(Record { + vpath: dir.clone(), + name: folder.to_owned(), + kind: EntryTag::Dir, + size: 0, + body: None, + hash: None, + }); + } + } + let kind = if rpf.is_archive(e) { + children.push((e, vpath.clone())); + EntryTag::Archive + } else if rpf.resource_parts(e).is_some() { + EntryTag::Resource + } else { + EntryTag::File + }; + if kind != EntryTag::Archive + && is_indexable_gta6(&base) + && e.size <= MAX_GTA6_TEXT + && !vpath.contains(GTA6_NUMBERS) + { + texts.push((e, vpath, base, kind)); + continue; + } + let hash = rpf.unnamed_hash(e); + batch.records.push(Record { vpath, name: base, kind, size: e.size, body: None, hash }); + } + if cancel.load(Ordering::Relaxed) { + return; + } + part(batch); + // A few at a time: converted metadata is several times its size. + for chunk in texts.chunks(TEXTS_AT_ONCE) { + let found: Vec<_> = chunk + .par_iter() + .filter(|_| !cancel.load(Ordering::Relaxed)) + .map(|(e, vpath, base, kind)| { + let content = rpf9_content(rpf, e, base).map(|found| { + let is_text = is_indexable(base) || base.to_ascii_lowercase().ends_with(".#ldbmt"); + found.map(|(text, words)| (if is_text { text } else { without_numbers(&text) }, words)) + }); + let hash = rpf.unnamed_hash(e); + let record = + Record { vpath: vpath.clone(), name: base.clone(), kind: *kind, size: e.size, body: None, hash }; + (record, content) + }) + .collect(); + let mut batch = new_part(); + for (mut record, content) in found { + match content { + Ok(Some((text, words))) => { + record.body = Some(text); + batch.dictionary.extend(words); + } + Ok(None) => {} + Err(_) => batch.errors += 1, + } + batch.records.push(record); + } + if cancel.load(Ordering::Relaxed) { + return; + } + part(batch); + } + children.par_iter().for_each(|(e, vpath)| { + if cancel.load(Ordering::Relaxed) { + return; + } + match rpf.open_child(e) { + Ok(child) if depth < rage_rpf::MAX_NESTING => { + walk_gta6(&child, vpath, depth + 1, cancel, part, new_part, &|_| {}); + } + _ => part(Batch { errors: 1, ..new_part() }), + } + read(e.size); + }); +} + +impl DiskArchive { + fn batch(&self) -> Batch { + Batch { rel: self.rel.clone(), size: self.size, mtime: self.mtime, ..Default::default() } + } + + fn add_read(&self, bytes: u64) { + self.read.fetch_add(bytes, Ordering::Relaxed); + } + + fn bytes_read(&self) -> u64 { + self.read.load(Ordering::Relaxed).min(self.size as u64) + } + + /// For some of its entries. + fn part(&self) -> Batch { + Batch { partial: true, ..self.batch() } + } +} + +/// Reads one top-level archive (and everything nested in it) into a batch; +/// a GTA VI archive into several, of which all but the last go to `part`. +/// `None` if cancelled. +fn read_archive( + archive: &DiskArchive, + keys: Option>, + cancel: &AtomicBool, + part: &(dyn Fn(Batch) + Sync), +) -> Option { + if archive.gta6 { + return read_gta6_archive(archive, archive.batch(), cancel, part); + } + Some(read_other_archive(archive, keys)) +} + +fn read_other_archive(archive: &DiskArchive, keys: Option>) -> Batch { + let mut batch = archive.batch(); if archive.gta4 { return read_gta4_archive(archive, batch); } @@ -292,7 +481,14 @@ fn read_archive(archive: &DiskArchive, keys: Option>) -> Batch { Err(_) => errors.set(errors.get() + 1), } } - batch.records.push(Record { vpath: path.to_owned(), name: e.name.clone(), kind, size: e.size(), body }); + batch.records.push(Record { + vpath: path.to_owned(), + name: e.name.clone(), + kind, + size: e.size(), + body, + hash: None, + }); }, &mut |_| errors.set(errors.get() + 1), ); @@ -341,6 +537,12 @@ impl Index { .filter(|a| stored.get(&a.rel).is_none_or(|&(_, size, mtime)| size != a.size || mtime != a.mtime)) .collect(); todo.sort_by_key(|a| std::cmp::Reverse(a.size)); // big ones first for better parallelism + // GTA VI archives are only indexed if the game's executable gives the + // keys. Asking one here also loads those before the threads that read + // archives wait for each other to do it. + if !todo.iter().rev().filter(|a| a.gta6).any(|a| Rpf9::open(&a.path).is_ok_and(|rpf| rpf.is_native())) { + todo.retain(|a| !a.gta6); + } { let tx = self.conn.transaction()?; @@ -349,36 +551,58 @@ impl Index { tx.execute("DELETE FROM entries WHERE source = ?1", [id])?; tx.execute("DELETE FROM sources WHERE id = ?1", [id])?; } - let loose_batch = - Batch { rel: String::new(), size: 0, mtime: 0, records: loose, dictionary: loose_words, errors: 0 }; + let loose_batch = Batch { records: loose, dictionary: loose_words, ..Default::default() }; write_batch(&tx, &loose_batch)?; tx.commit()?; } let total = todo.len(); + let bytes_total = todo.iter().map(|a| a.size as u64).sum(); + let counted = todo.clone(); let mut done = 0usize; let (sender, receiver) = mpsc::sync_channel::(4); let conn = &mut self.conn; let result: Result<(), IndexError> = std::thread::scope(|scope| { scope.spawn(move || { - todo.par_iter().for_each_with(sender, |s, archive| { - if !cancel.load(Ordering::Relaxed) { - let _ = s.send(read_archive(archive, keys.clone())); - } - }); + let read = move || { + todo.par_iter().for_each_with(sender, |s, archive| { + if cancel.load(Ordering::Relaxed) { + return; + } + let s = &*s; + let part = |batch| { + let _ = s.send(batch); + }; + if let Some(batch) = read_archive(archive, keys.clone(), cancel, &part) { + archive.add_read(archive.size as u64); + part(batch); + } + }); + }; + // Threads of its own: what is opened meanwhile does not wait + // behind the archives, and keeps some processors. + let threads = std::thread::available_parallelism().map_or(4, |n| (n.get() * 3 / 4).max(1)); + match rayon::ThreadPoolBuilder::new().num_threads(threads).build() { + Ok(pool) => pool.install(read), + Err(_) => read(), + } }); for batch in receiver { let tx = conn.transaction()?; let added = write_batch(&tx, &batch)?; tx.commit()?; - done += 1; - stats.archives_indexed += 1; + if !batch.partial { + done += 1; + stats.archives_indexed += 1; + } stats.entries_added += added; stats.read_errors += batch.errors; progress(&Progress { archives_done: done, archives_total: total, entries: stats.entries_added, + bytes_done: counted.iter().map(|a| a.bytes_read()).sum(), + bytes_total, current: batch.rel, }); } @@ -407,11 +631,14 @@ impl Index { } fn write_batch(tx: &rusqlite::Transaction<'_>, batch: &Batch) -> Result { - tx.execute( - "INSERT INTO sources(path, size, mtime) VALUES(?1, ?2, ?3)", - params![batch.rel, batch.size, batch.mtime], + // An archive that is not complete matches no size on disk. + let (size, mtime) = if batch.partial { (-1, -1) } else { (batch.size, batch.mtime) }; + let source: i64 = tx.query_row( + "INSERT INTO sources(path, size, mtime) VALUES(?1, ?2, ?3) + ON CONFLICT(path) DO UPDATE SET size = excluded.size, mtime = excluded.mtime RETURNING id", + params![batch.rel, size, mtime], + |r| r.get(0), )?; - let source = tx.last_insert_rowid(); let mut entry = tx.prepare_cached( "INSERT INTO entries(source, vpath, name, kind, size, name_hash, stem_hash, has_text) VALUES(?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8)", @@ -424,8 +651,8 @@ fn write_batch(tx: &rusqlite::Transaction<'_>, batch: &Batch) -> Result(work: impl FnOnce() -> R + Send) -> R { + std::thread::scope(|scope| { + let thread = scope.spawn(|| match rayon::ThreadPoolBuilder::new().build() { + Ok(pool) => pool.install(work), + Err(_) => work(), + }); + match thread.join() { + Ok(result) => result, + Err(panic) => std::panic::resume_unwind(panic), + } + }) +} diff --git a/crates/rage-rpf/src/rpf9.rs b/crates/rage-rpf/src/rpf9.rs new file mode 100644 index 0000000..d63651f --- /dev/null +++ b/crates/rage-rpf/src/rpf9.rs @@ -0,0 +1,1294 @@ +//! RPF9 archives (GTA VI). +//! +//! With the game's executable (`game_scarlett_master.exe`, the supported +//! build) in the archive's folder or one above, the archive's own table of +//! contents is read: all its files, their folders and — as far as they can be +//! matched to the hashes in the table — names, and the archives inside it +//! ([`Rpf9::open_child`]). Nothing from the executable is stored. +//! +//! Without it, an archive is read without its table of contents, as below. +//! +//! Layout (little-endian): +//! - 64-byte header: magic `RPF9`, then the offset where the file data +//! starts, a declared entry count at `0x24` and transform tag at `0x2e`. +//! - The table of contents (names, sizes, offsets) up to the data offset. It +//! is encrypted with keys that only the game's executable has. +//! - The file data. Most of it is not encrypted: zlib streams laid end to +//! end, each starting on a 16-byte boundary, Bink 2 videos and audio +//! containers (`ADAT`). +//! +//! So the archive is read as a *recovery view*: [`Rpf9::scan`] walks the data +//! area and lists every zlib stream, Bink 2 video and audio container it finds. Files have no +//! names, only their offset (`xml/00000000b000.xml`), and are sorted into +//! folders by what their first bytes look like. A file stored in several +//! 64 KiB chunks is put together again; a resource whose pages are separate +//! streams shows up as several entries. Other data (encrypted files) is not +//! listed. +//! +//! Scanning reads the whole archive, so the result is worth keeping: +//! [`encode_index`] and [`decode_index`] store it, and a program can +//! register a loader with [`set_indexer`] that [`Rpf9::entries`] then uses. + +use std::collections::{BTreeSet, HashMap}; +use std::fs::File; +use std::io::{BufReader, Read, Seek, SeekFrom, Write}; +use std::path::{Path, PathBuf}; +use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::{Arc, Mutex, OnceLock, RwLock}; + +use rayon::prelude::*; + +use crate::RpfError; +use crate::rpf9_index::{NativeEntry, Storage}; +use crate::rpf9_native::NativeArchive; +pub use crate::rpf9_native::add_names; + +const MAGIC: u32 = 0x5250_4639; +/// Length of the header in front of the table of contents. +pub const HEADER_LEN: usize = 64; +/// Files larger than this are stored as several zlib streams of this many +/// unpacked bytes, the last one shorter. +const CHUNK: u64 = 0x10000; +/// Streams start on a multiple of this. +const ALIGN: u64 = 16; +/// The data area is scanned in pieces of this size, in parallel. +const SEGMENT: u64 = 256 << 20; +/// How much of the file a scanner keeps in memory. +const WINDOW: usize = 4 << 20; +/// A window with less than this left is read anew, so most streams fit. +const WINDOW_MIN: usize = 64 << 10; +/// Archives of at least this size get a folder per GiB of offset. +const BUCKETED_FROM: u64 = 1 << 30; + +/// Four-byte magics that tagged formats of the game start with. Only these +/// become an extension: among a million files, some start with four letters +/// by chance. +const MAGICS: [&[u8; 4]; 7] = [b"PSIN", b"PAMH", b"MHIU", b"RBF0", b"SPS1", b"RSC8", b"0DRP"]; + +/// The readable part of the header. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Header { + /// Where the file data starts; the table of contents ends here. + pub data_offset: u32, + /// Native index slots declared by the clear header. Recovery streams do + /// not correspond one-to-one to these slots. + pub entry_count: u32, + /// Native header transform selector; this is not an archive key ID. + pub toc_transform: u8, +} + +impl Header { + pub fn parse(b: &[u8]) -> Option
{ + if b.len() < HEADER_LEN || crate::word(b, 0) != MAGIC { + return None; + } + Some(Header { data_offset: crate::word(b, 4), entry_count: crate::word(b, 0x24), toc_transform: b[0x2e] }) + } +} + +/// How an entry is stored. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Kind { + /// One or more zlib streams. + Zlib, + /// A Bink 2 video, stored as is. + Bink2, + /// An audio container (`ADAT`), stored as is. + Awc, + /// A file of the archive's own table, at this slot. + Native { slot: u32 }, +} + +/// One recovered file. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Entry { + /// Where it starts in the archive file. + pub offset: u64, + /// Bytes it takes in the archive, padding between its streams included. + pub stored: u64, + /// Unpacked size. + pub size: u64, + /// Number of zlib streams (1 for a video). + pub streams: u32, + pub kind: Kind, + /// The first unpacked bytes (`head_len` of them). + pub head: [u8; 16], + pub head_len: u8, +} + +impl Entry { + fn native(e: &NativeEntry) -> Entry { + let kind = Kind::Native { slot: e.slot as u32 }; + Entry { offset: e.offset, stored: e.stored, size: e.size, streams: 1, kind, head: [0; 16], head_len: 0 } + } + + /// The first unpacked bytes. + pub fn head(&self) -> &[u8] { + &self.head[..usize::from(self.head_len).min(16)] + } + + /// Whether this looks like the start of a resource (a model, for + /// instance): they start 16 bytes into a 4 KiB page, with eight zero + /// bytes and a pointer into their own first part (`0x5000_0000` on). + pub fn is_resource(&self) -> bool { + let head = self.head(); + self.kind == Kind::Zlib + && self.offset % 4096 == 16 + && head.len() == 16 + && head[..8] == [0; 8] + && (0x5000_0000..0x5200_0000).contains(&u64::from_le_bytes(head[8..].try_into().unwrap_or_default())) + } + + /// An extension guessed from the first bytes: `bk2`, `awc`, `res`, `xml`, `txt`, the + /// magic of a known tagged format in lower case (`psin`), else `bin`. + pub fn extension(&self) -> String { + match self.kind { + Kind::Bink2 => return "bk2".into(), + Kind::Awc => return "awc".into(), + Kind::Zlib | Kind::Native { .. } => {} + } + if self.is_resource() { + return "res".into(); + } + extension_of(self.head()).unwrap_or_else(|| "bin".into()) + } +} + +/// An extension for a file that starts with these bytes (its first 16). +pub(crate) fn extension_of(head: &[u8]) -> Option { + if head.starts_with(b"ADAT") { + return Some("awc".into()); + } + if head.starts_with(b"KB2") { + return Some("bk2".into()); + } + let text = head.strip_prefix(b"\xEF\xBB\xBF").unwrap_or(head); + // Text only when all of the first bytes are: binary files start with + // `<` and a letter often enough (an offset table, for instance). + let printable = |b: &u8| b.is_ascii_graphic() || matches!(b, b' ' | b'\t' | b'\r' | b'\n'); + if !text.is_empty() && text.iter().all(printable) { + let markup = text.starts_with(b" Result, RpfError> + Send + Sync; + +fn indexer() -> &'static RwLock>> { + static INDEXER: OnceLock>>> = OnceLock::new(); + INDEXER.get_or_init(Default::default) +} + +/// Registers what [`Rpf9::entries`] calls to get an archive's entries. +/// Without one it scans the archive every time it is opened. +pub fn set_indexer(load: Arc) { + if let Ok(mut slot) = indexer().write() { + *slot = Some(load); + } +} + +/// The folder of the entries whose own names are known. +const NAMED: &str = "models"; + +/// Names of entries, found in their own data: a model carries its name. The +/// table of contents, which has all names, cannot be read. +#[derive(Debug, Default, Clone, PartialEq, Eq)] +pub struct Names { + by_offset: HashMap, + /// Lower-case name to offset. + by_name: HashMap, +} + +impl Names { + /// From entries' offsets and names. Characters that do not belong in a + /// file name are replaced; of entries with the same name, the later ones + /// (by offset) get `~2`, `~3`, … in front of the extension. + pub fn new(found: impl IntoIterator) -> Names { + let mut found: Vec<(u64, String)> = found.into_iter().collect(); + found.sort(); + let mut names = Names::default(); + for (offset, name) in found { + let clean: String = + name.chars().map(|c| if c.is_ascii_alphanumeric() || "_.#-".contains(c) { c } else { '_' }).collect(); + let clean = clean.trim_matches('.'); + if clean.is_empty() { + continue; + } + let (stem, ext) = clean.split_once('.').map_or((clean, String::new()), |(s, e)| (s, format!(".{e}"))); + let unique = (1..) + .map(|n| if n == 1 { clean.to_owned() } else { format!("{stem}~{n}{ext}") }) + .find(|candidate| !names.by_name.contains_key(&candidate.to_ascii_lowercase())); + let Some(unique) = unique else { continue }; + names.by_name.insert(unique.to_ascii_lowercase(), offset); + names.by_offset.insert(offset, unique); + } + names + } + + pub fn get(&self, offset: u64) -> Option<&str> { + self.by_offset.get(&offset).map(String::as_str) + } + + /// The offset of the entry with this name (case-insensitive). + pub fn offset_of(&self, name: &str) -> Option { + self.by_name.get(&name.to_ascii_lowercase()).copied() + } + + pub fn len(&self) -> usize { + self.by_offset.len() + } + + pub fn is_empty(&self) -> bool { + self.by_offset.is_empty() + } + + /// Offsets and names, sorted by offset. + pub fn iter(&self) -> impl Iterator { + let mut all: Vec<(u64, &str)> = self.by_offset.iter().map(|(o, n)| (*o, n.as_str())).collect(); + all.sort(); + all.into_iter() + } + + /// The folder a name is listed in: what it starts with, up to the first + /// `_` (`w` for weapons, `prop`, …); `other` without one. + fn group(name: &str) -> String { + match name.split_once('_') { + Some((start, _)) if (1..=12).contains(&start.len()) => start.to_ascii_lowercase(), + _ => "other".to_owned(), + } + } +} + +/// Loads the names of an archive's entries, for example from a cache. +pub type Namer = dyn Fn(&Rpf9) -> Option + Send + Sync; + +fn namer() -> &'static RwLock>> { + static NAMER: OnceLock>>> = OnceLock::new(); + NAMER.get_or_init(Default::default) +} + +/// Registers what [`Rpf9::names`] calls to get the names of an archive's entries. +pub fn set_namer(load: Arc) { + if let Ok(mut slot) = namer().write() { + *slot = Some(load); + } +} + +/// An opened RPF9 archive. +#[derive(Debug)] +pub struct Rpf9 { + path: PathBuf, + display: String, + header: Header, + size: u64, + /// Where the archive starts in the file: a nested one, inside its parent. + base: u64, + /// How many archives it lies in. + depth: u8, + /// The archive's own table, read on first use. + native: OnceLock>>, + /// Filled on first use: finding the entries means reading the archive. + entries: Mutex>>>, + /// Filled on first use. + names: Mutex>>, +} + +impl Rpf9 { + /// Whether these bytes start an RPF9 archive. + pub fn is_rpf9(start: &[u8]) -> bool { + start.len() >= 4 && crate::word(start, 0) == MAGIC + } + + /// Whether a file starts with the RPF9 magic. + pub fn file_is_rpf9(path: &Path) -> bool { + let mut head = [0u8; 4]; + File::open(path).and_then(|mut f| f.read_exact(&mut head)).is_ok() && Self::is_rpf9(&head) + } + + /// Opens an archive: reads its header, not its entries. + pub fn open(path: &Path) -> Result { + let display = path.display().to_string(); + let mut file = File::open(path)?; + let size = file.metadata()?.len(); + let mut head = [0u8; HEADER_LEN]; + if file.read_exact(&mut head).is_err() { + return Err(RpfError::Empty(display, size)); + } + let Some(header) = Header::parse(&head) else { + return Err(RpfError::BadMagic(display, crate::word(&head, 0))); + }; + if u64::from(header.data_offset) < HEADER_LEN as u64 || u64::from(header.data_offset) > size { + return Err(RpfError::CorruptToc { archive: display, reason: "the data starts outside the file".into() }); + } + Ok(Rpf9 { + path: path.to_path_buf(), + display, + header, + size, + base: 0, + depth: 0, + native: OnceLock::new(), + entries: Mutex::new(None), + names: Mutex::new(None), + }) + } + + /// The archive's own table; `None` without the game's executable (or + /// with another build's) and for damaged tables. + fn native(&self) -> Option<&NativeArchive> { + self.native.get_or_init(|| NativeArchive::cached(&self.path, self.base, self.size)).as_deref() + } + + /// Whether the archive's own table is read, rather than a recovery view + /// made by scanning. Decides it on first use, without a scan. + pub fn is_native(&self) -> bool { + self.native().is_some() + } + + /// Whether the archive lies inside another one. + pub fn is_nested(&self) -> bool { + self.base != 0 + } + + /// The record of an entry in the archive's own table. + fn native_entry(&self, entry: &Entry) -> Option<(&NativeArchive, &NativeEntry)> { + let Kind::Native { slot } = entry.kind else { return None }; + let native = self.native()?; + Some((native, native.catalog.entries.get(slot as usize)?)) + } + + /// Whether an entry is an archive that [`Rpf9::open_child`] opens. + pub fn is_archive(&self, entry: &Entry) -> bool { + self.native_entry(entry).is_some_and(|(_, e)| e.type_id == 0) + } + + /// The sizes of a resource's system and graphics parts, which follow + /// each other in its data. `None` for other files. + pub fn resource_parts(&self, entry: &Entry) -> Option<(u64, u64)> { + match self.native_entry(entry)?.1.storage { + Storage::Resource { system_flags, graphics_flags } => { + Some((u64::from(system_flags & 0x7fff_fff0), u64::from(graphics_flags & 0xffff_fff0))) + } + _ => None, + } + } + + /// The 32-bit name hash of an entry whose name is not known, if the + /// archive's own table has one: of its path without a known extension. + pub fn unnamed_hash(&self, entry: &Entry) -> Option { + let (native, e) = self.native_entry(entry)?; + e.name_hash32.filter(|_| native.is_unnamed(e)) + } + + /// Opens an archive inside this one. + pub fn open_child(&self, entry: &Entry) -> Result { + let display = format!("{}/{}", self.display, self.entry_name(entry)); + // Archives are stored as they are, so they can be read in place. + if !self.is_archive(entry) || entry.stored != entry.size { + return Err(RpfError::NotAnArchive(display)); + } + if self.depth >= crate::MAX_NESTING { + return Err(RpfError::TooDeep(display)); + } + let base = self.base + entry.offset; + let mut file = File::open(&self.path)?; + file.seek(SeekFrom::Start(base))?; + let mut head = [0u8; HEADER_LEN]; + file.read_exact(&mut head)?; + let Some(header) = Header::parse(&head) else { + return Err(RpfError::BadMagic(display, crate::word(&head, 0))); + }; + let child = Rpf9 { + path: self.path.clone(), + display, + header, + size: entry.size, + base, + depth: self.depth + 1, + native: OnceLock::new(), + entries: Mutex::new(None), + names: Mutex::new(None), + }; + if child.native().is_none() { + return Err(RpfError::CorruptToc { archive: child.display, reason: "its table cannot be read".into() }); + } + Ok(child) + } + + pub fn header(&self) -> Header { + self.header + } + + pub fn path(&self) -> &Path { + &self.path + } + + /// The archive's name for messages. + pub fn display_name(&self) -> &str { + &self.display + } + + /// Size of the archive file. + pub fn size(&self) -> u64 { + self.size + } + + /// Size of the data area: everything after the table of contents. + pub fn data_len(&self) -> u64 { + self.size - u64::from(self.header.data_offset) + } + + /// The entries if they have been loaded already. + pub fn loaded(&self) -> Option>> { + self.entries.lock().ok()?.clone() + } + + /// Sets the entries, for example from a stored index. + pub fn set_entries(&self, entries: Vec) { + if let Ok(mut slot) = self.entries.lock() { + *slot = Some(Arc::new(entries)); + } + } + + /// The entries: in the order of the archive's own table if that is read, + /// else sorted by offset. Then the first call loads them with the + /// registered [`set_indexer`] loader, or scans the archive, which reads + /// all of it. A failure is not remembered: the next call tries again. + pub fn entries(&self) -> Result>, RpfError> { + let mut slot = self.entries.lock().map_err(|_| RpfError::Cancelled)?; + if let Some(entries) = slot.as_ref() { + return Ok(Arc::clone(entries)); + } + let load = indexer().read().ok().and_then(|l| l.clone()); + let entries = Arc::new(match (self.native(), load) { + (Some(native), _) => native.catalog.entries.iter().map(Entry::native).collect(), + (None, Some(load)) => load(self)?, + (None, None) => self.scan(&AtomicBool::new(false), &|_, _| {})?, + }); + *slot = Some(Arc::clone(&entries)); + Ok(entries) + } + + /// Walks the data area and returns what it finds, sorted by offset. + /// `progress` gets the bytes read so far and the bytes to read; setting + /// `cancel` stops with [`RpfError::Cancelled`]. + pub fn scan(&self, cancel: &AtomicBool, progress: &(dyn Fn(u64, u64) + Sync)) -> Result, RpfError> { + let start = u64::from(self.header.data_offset); + let total = self.size - start; + let segments: Vec<(u64, u64)> = (0..total.div_ceil(SEGMENT)) + .map(|i| (start + i * SEGMENT, (start + (i + 1) * SEGMENT).min(self.size))) + .collect(); + let done = AtomicU64::new(0); + let found: Vec> = segments + .par_iter() + .map(|&(from, to)| { + let mut scanner = Scanner::new(File::open(&self.path)?, self.size); + scanner.streams(from, to, cancel, &mut |bytes| { + progress(done.fetch_add(bytes, Ordering::Relaxed) + bytes, total); + }) + }) + .collect::>()?; + Ok(join_chunks(found.into_iter().flatten())) + } + + /// The names found for entries of this archive. The first call asks the + /// registered [`set_namer`] loader; without one, or without stored + /// names, there are none. + pub fn names(&self) -> Arc { + let Ok(mut slot) = self.names.lock() else { return Arc::default() }; + if let Some(names) = slot.as_ref() { + return Arc::clone(names); + } + // The names of models in the recovery view; the table has its own. + let load = if self.is_native() { None } else { namer().read().ok().and_then(|l| l.clone()) }; + let names = Arc::new(load.and_then(|load| load(self)).unwrap_or_default()); + *slot = Some(Arc::clone(&names)); + names + } + + /// Sets the names of entries. + pub fn set_names(&self, names: Names) { + if let Ok(mut slot) = self.names.lock() { + *slot = Some(Arc::new(names)); + } + } + + /// The name of an entry: `/.`, in large + /// archives `//.`. An + /// entry whose own name is known (see [`Names`]) is + /// `models//`. + pub fn entry_name(&self, entry: &Entry) -> String { + self.entry_name_with(&self.names(), entry) + } + + fn entry_name_with(&self, names: &Names, entry: &Entry) -> String { + if let Some((native, e)) = self.native_entry(entry) { + return native.paths[e.slot].clone(); + } + if let Some(name) = names.get(entry.offset) { + return format!("{NAMED}/{}/{name}", Names::group(name)); + } + let ext = entry.extension(); + match self.bucket(entry) { + Some(bucket) => format!("{ext}/{bucket}/{:012x}.{ext}", entry.offset), + None => format!("{ext}/{:012x}.{ext}", entry.offset), + } + } + + fn bucket(&self, entry: &Entry) -> Option { + (self.size >= BUCKETED_FROM).then(|| format!("{:03}", entry.offset >> 30)) + } + + /// The entry with this name (case-insensitive). + pub fn find(&self, entries: &[Entry], path: &str) -> Option { + if let Some(native) = self.native() { + // Entries are in the order of the slots. + return native.find(path).filter(|slot| *slot < entries.len()); + } + let names = self.names(); + let file = path.rsplit('/').next()?; + let by_offset = file.split('.').next().and_then(|stem| u64::from_str_radix(stem, 16).ok()); + [by_offset, names.offset_of(file)].into_iter().flatten().find_map(|offset| { + let i = entries.binary_search_by_key(&offset, |e| e.offset).ok()?; + self.entry_name_with(&names, &entries[i]).eq_ignore_ascii_case(path).then_some(i) + }) + } + + /// The folders and files directly in `dir` ("" for the top): folder + /// names, and indices of the entries. + pub fn list_dir(&self, entries: &[Entry], dir: &str) -> (Vec, Vec) { + let names = self.names(); + let dir = dir.trim_matches('/').to_ascii_lowercase(); + let mut dirs = BTreeSet::new(); + let mut files = Vec::new(); + for (i, e) in entries.iter().enumerate() { + let name = self.entry_name_with(&names, e); + // What comes after `dir/` in the entry's path. + let rest = if dir.is_empty() { + Some(name.as_str()) + } else { + name.get(..dir.len()) + .filter(|start| start.eq_ignore_ascii_case(&dir)) + .and_then(|_| name[dir.len()..].strip_prefix('/')) + }; + match rest.map(|rest| rest.split_once('/')) { + Some(Some((folder, _))) => { + if !dirs.contains(folder) { + dirs.insert(folder.to_owned()); + } + } + Some(None) => files.push(i), + None => {} + } + } + (dirs.into_iter().collect(), files) + } + + /// Whether `dir` is a folder of the recovery view. + pub fn is_dir(&self, entries: &[Entry], dir: &str) -> bool { + let (dirs, files) = self.list_dir(entries, dir); + dir.is_empty() || !dirs.is_empty() || !files.is_empty() + } + + /// Writes an entry unpacked to `out` and returns the bytes written. + pub fn copy_to(&self, entry: &Entry, out: &mut dyn Write) -> Result { + let name = self.entry_name(entry); + if let Some((native, e)) = self.native_entry(entry) { + return native.copy_to(&self.path, self.base, e, out).map_err(|reason| RpfError::Inflate { + archive: self.display.clone(), + entry: name, + source: std::io::Error::new(std::io::ErrorKind::InvalidData, reason), + }); + } + let outside = || RpfError::OutOfBounds { archive: self.display.clone(), entry: name.clone() }; + if entry.offset < u64::from(self.header.data_offset) + || entry.stored == 0 + || entry.size == 0 + || entry.streams == 0 + || entry.offset.checked_add(entry.stored).is_none_or(|end| end > self.size) + { + return Err(outside()); + } + let mut file = File::open(&self.path)?; + file.seek(SeekFrom::Start(entry.offset))?; + let mut reader = BufReader::with_capacity(1 << 16, file.take(entry.stored)); + if entry.kind != Kind::Zlib { + if entry.size != entry.stored || entry.streams != 1 { + return Err(outside()); + } + let written = std::io::copy(&mut reader, out)?; + return if written == entry.size { Ok(written) } else { Err(outside()) }; + } + let inflate = |source| RpfError::Inflate { archive: self.display.clone(), entry: name.clone(), source }; + let (mut read, mut written) = (0u64, 0u64); + for _ in 0..entry.streams { + // Streams start aligned; the entry itself does too. + let padding = read.next_multiple_of(ALIGN) - read; + if padding > 0 { + let mut bytes = [0u8; ALIGN as usize]; + reader.read_exact(&mut bytes[..padding as usize])?; + } + let mut stream = flate2::bufread::ZlibDecoder::new(&mut reader); + // A stale or corrupt index must not cause unlimited output before + // the decoded length is checked. One extra byte detects overflow. + let limit = entry.size.saturating_sub(written).saturating_add(1); + written += std::io::copy(&mut (&mut stream).take(limit), out).map_err(inflate)?; + read += padding + stream.total_in(); + if written > entry.size { + return Err(inflate(std::io::Error::new( + std::io::ErrorKind::InvalidData, + "unpacked size exceeds the index", + ))); + } + } + if written != entry.size || read != entry.stored { + let short = std::io::Error::new(std::io::ErrorKind::InvalidData, "unpacked size differs from the index"); + return Err(inflate(short)); + } + Ok(written) + } + + /// Whether entry `i + 1` is stored right after entry `i` (on the next + /// 16-byte boundary): the parts of a resource follow each other so. + pub fn follows(entries: &[Entry], i: usize) -> bool { + match (entries.get(i), entries.get(i + 1)) { + (Some(a), Some(b)) => b.kind == Kind::Zlib && b.offset == (a.offset + a.stored).next_multiple_of(ALIGN), + _ => false, + } + } + + /// The first bytes of an entry, unpacked: up to `max`, or a little more. + pub fn read_start(&self, entry: &Entry, max: usize) -> Result, RpfError> { + struct Start(Vec, usize); + impl Write for Start { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + if self.0.len() >= self.1 { + return Err(std::io::ErrorKind::WriteZero.into()); + } + self.0.extend_from_slice(buf); + Ok(buf.len()) + } + fn flush(&mut self) -> std::io::Result<()> { + Ok(()) + } + } + let mut start = Start(Vec::new(), max); + match self.copy_to(entry, &mut start) { + Err(e) if start.0.len() < max => Err(e), + _ => Ok(start.0), + } + } + + /// Reads the entry with index `i` of [`Rpf9::entries`] unpacked into memory. + pub fn read_at(&self, i: usize) -> Result, RpfError> { + let entries = self.entries()?; + let entry = entries.get(i).ok_or_else(|| RpfError::NotFound(format!("{}: entry {i}", self.display)))?; + self.read(entry) + } + + /// Reads an entry unpacked into memory (up to [`crate::MAX_UNPACKED`]). + pub fn read(&self, entry: &Entry) -> Result, RpfError> { + if entry.size > crate::MAX_UNPACKED { + let source = std::io::Error::new(std::io::ErrorKind::InvalidData, "too large to read into memory"); + return Err(RpfError::Inflate { archive: self.display.clone(), entry: self.entry_name(entry), source }); + } + let mut data = Vec::with_capacity(entry.size.min(crate::PREALLOCATE) as usize); + self.copy_to(entry, &mut data)?; + Ok(data) + } +} + +/// Joins the chunks of files stored in several streams: a stream that +/// unpacks to exactly [`CHUNK`] bytes continues in the stream right after +/// it. Streams that start inside an earlier one are dropped (a scanner that +/// started in the middle of a file can find such). +fn join_chunks(streams: impl Iterator) -> Vec { + let mut entries: Vec = Vec::new(); + // Unpacked size of the stream before, when the next may continue it. + let mut last_size = 0; + for s in streams { + if let Some(prev) = entries.last_mut() { + let end = prev.offset + prev.stored; + if s.offset < end { + continue; + } + let continues = s.kind == Kind::Zlib + && prev.kind == Kind::Zlib + && last_size == CHUNK + && s.offset == end.next_multiple_of(ALIGN); + if continues { + prev.stored = s.offset + s.stored - prev.offset; + prev.size += s.size; + prev.streams += 1; + last_size = s.size; + continue; + } + } + last_size = s.size; + entries.push(Entry { + offset: s.offset, + stored: s.stored, + size: s.size, + streams: 1, + kind: s.kind, + head: s.head, + head_len: s.head_len, + }); + } + entries +} + +/// Reads a file through a window that moves forward with the scan. +struct Scanner { + file: File, + size: u64, + buf: Vec, + /// File offset of `buf[0]`. + base: u64, + scratch: Vec, +} + +impl Scanner { + fn new(file: File, size: u64) -> Scanner { + Scanner { file, size, buf: Vec::new(), base: 0, scratch: vec![0; 1 << 16] } + } + + /// The bytes from `pos` on: as many as the window holds, none at the end + /// of the file. + fn at(&mut self, pos: u64) -> Result<&[u8], RpfError> { + let end = self.base + self.buf.len() as u64; + let have = if pos >= self.base && pos < end { (end - pos) as usize } else { 0 }; + if have < WINDOW_MIN && end.max(pos) < self.size || have == 0 { + let len = (self.size.saturating_sub(pos)).min(WINDOW as u64) as usize; + self.buf.resize(len, 0); + self.file.seek(SeekFrom::Start(pos))?; + self.file.read_exact(&mut self.buf)?; + self.base = pos; + } + Ok(&self.buf[(pos - self.base) as usize..]) + } + + /// The streams that start in `from..to`; the last one may end after `to`. + fn streams( + &mut self, + from: u64, + to: u64, + cancel: &AtomicBool, + advanced: &mut dyn FnMut(u64), + ) -> Result, RpfError> { + let mut found = Vec::new(); + let (mut pos, mut reported) = (from, from); + while pos < to { + if cancel.load(Ordering::Relaxed) { + return Err(RpfError::Cancelled); + } + if pos - reported >= 16 << 20 { + advanced(pos - reported); + reported = pos; + } + let buf = self.at(pos)?; + let len = buf.len().min((to - pos) as usize); + let Some(i) = memchr::memchr3(0x78, b'K', b'A', &buf[..len]) else { + pos += len as u64; + continue; + }; + let candidate = pos + i as u64; + pos = match self.stream_at(candidate, cancel)? { + Some(s) => { + let end = s.offset + s.stored; + found.push(s); + end + } + None => candidate + 1, + }; + } + advanced(to - reported.min(to)); + Ok(found) + } + + /// The zlib stream, Bink 2 video or audio container that starts at `pos`, + /// if one does. + fn stream_at(&mut self, pos: u64, cancel: &AtomicBool) -> Result, RpfError> { + let size = self.size; + let start = self.at(pos)?; + if start.len() >= 28 && &start[..3] == b"KB2" && start[3].is_ascii_lowercase() { + // Bink 2: length without the first 8 bytes, frame count, …, width, height. + let total = u64::from(crate::word(start, 4)) + 8; + let (frames, width, height) = (crate::word(start, 8), crate::word(start, 20), crate::word(start, 24)); + let plausible = (1..=10_000_000).contains(&frames) + && (1..=16_384).contains(&width) + && (1..=16_384).contains(&height) + && total >= 28 + && total <= size - pos; + let mut head = [0u8; 16]; + head.copy_from_slice(&start[..16]); + return Ok(plausible.then_some(Stream { + offset: pos, + stored: total, + size: total, + kind: Kind::Bink2, + head, + head_len: 16, + })); + } + if pos.is_multiple_of(ALIGN) + && let Some(total) = awc_len(start) + { + let mut head = [0u8; 16]; + head.copy_from_slice(&start[..16]); + return Ok((total <= size - pos).then_some(Stream { + offset: pos, + stored: total, + size: total, + kind: Kind::Awc, + head, + head_len: 16, + })); + } + if start.len() < 2 || start[0] != 0x78 || !matches!(start[1], 0x01 | 0x5E | 0x9C | 0xDA) { + return Ok(None); + } + let mut inflater = flate2::Decompress::new(true); + let mut scratch = std::mem::take(&mut self.scratch); + let (mut head, mut head_len) = ([0u8; 16], 0usize); + let result = loop { + if cancel.load(Ordering::Relaxed) { + self.scratch = scratch; + return Err(RpfError::Cancelled); + } + let (read, written) = (inflater.total_in(), inflater.total_out()); + let input = match self.at(pos + read) { + Ok(input) if !input.is_empty() => input, + Ok(_) => break None, + Err(e) => { + self.scratch = scratch; + return Err(e); + } + }; + let status = inflater.decompress(input, &mut scratch, flate2::FlushDecompress::None); + let produced = (inflater.total_out() - written) as usize; + let take = produced.min(16 - head_len); + head[head_len..head_len + take].copy_from_slice(&scratch[..take]); + head_len += take; + match status { + Ok(flate2::Status::StreamEnd) => break Some(()), + Ok(_) if inflater.total_in() > read || produced > 0 => {} + _ => break None, + } + }; + self.scratch = scratch; + Ok(result.filter(|()| inflater.total_out() > 0).map(|()| Stream { + offset: pos, + stored: inflater.total_in(), + size: inflater.total_out(), + kind: Kind::Zlib, + head, + head_len: head_len as u8, + })) + } +} + +/// The length of the audio container that starts here, from its own tables: +/// `ADAT`, version 1, flags, stream count, header length; optional tables +/// chosen by the flags; a word per stream (id, and in the top three bits its +/// number of chunks); a 64-bit word per chunk (type, size, offset). The +/// container ends where its last chunk does. +fn awc_len(start: &[u8]) -> Option { + if start.len() < 16 || &start[..4] != b"ADAT" || start[4..6] != [1, 0] { + return None; + } + let flags = u16::from_le_bytes([start[6], start[7]]); + let count = crate::word(start, 8) as usize; + let header = u64::from(crate::word(start, 12)); + if !(1..=1 << 16).contains(&count) { + return None; + } + let mut at = 16; + for (flag, len) in [(0x01, count * 2), (0x20, (count + 1) * 4), (0x40, 4)] { + if flags & flag != 0 { + at += len; + } + } + let streams = start.get(at..at + count * 4)?; + let chunks: usize = streams.as_chunks::<4>().0.iter().map(|w| usize::from(w[3] >> 5)).sum(); + at += count * 4; + let table = start.get(at..at + chunks * 8)?; + if (at + chunks * 8) as u64 > header { + return None; + } + let mut end = header; + for c in table.as_chunks::<8>().0 { + let v = u64::from_le_bytes(*c); + end = end.max((v & 0x0FFF_FFFF) + ((v >> 28) & 0x0FFF_FFFF)); + } + Some(end) +} + +const INDEX_RECORD: usize = 46; + +/// The entries as bytes, to store them (see [`decode_index`]). +pub fn encode_index(entries: &[Entry]) -> Vec { + let mut out = Vec::with_capacity(entries.len() * INDEX_RECORD); + for e in entries { + out.extend_from_slice(&e.offset.to_le_bytes()); + out.extend_from_slice(&e.stored.to_le_bytes()); + out.extend_from_slice(&e.size.to_le_bytes()); + out.extend_from_slice(&e.streams.to_le_bytes()); + out.push(match e.kind { + Kind::Zlib => 0, + Kind::Bink2 => 1, + Kind::Awc => 2, + // Read from the archive, never stored. + Kind::Native { .. } => u8::MAX, + }); + out.push(e.head_len.min(16)); + out.extend_from_slice(&e.head); + } + out +} + +/// Entries stored with [`encode_index`]; `None` if the bytes are not such a +/// list or it is not sorted by offset. +pub fn decode_index(data: &[u8]) -> Option> { + let (records, rest) = data.as_chunks::(); + if !rest.is_empty() { + return None; + } + let u64_at = |r: &[u8], at: usize| Some(u64::from_le_bytes(r.get(at..at + 8)?.try_into().ok()?)); + let mut entries = Vec::with_capacity(records.len()); + for r in records { + let kind = match r[28] { + 0 => Kind::Zlib, + 1 => Kind::Bink2, + 2 => Kind::Awc, + _ => return None, + }; + let entry = Entry { + offset: u64_at(r, 0)?, + stored: u64_at(r, 8)?, + size: u64_at(r, 16)?, + streams: crate::word(r, 24), + kind, + head: r[30..46].try_into().ok()?, + head_len: r[29], + }; + let end = entry.offset.checked_add(entry.stored)?; + if entry.offset < HEADER_LEN as u64 + || entry.stored == 0 + || entry.size == 0 + || entry.streams == 0 + || entry.head_len > 16 + || u64::from(entry.head_len) > entry.size + || (entry.kind != Kind::Zlib && (entry.stored != entry.size || entry.streams != 1)) + || u64::from(entry.streams) > entry.stored + || end <= entry.offset + || entries.last().is_some_and(|prev: &Entry| prev.offset + prev.stored > entry.offset) + { + return None; + } + entries.push(entry); + } + Some(entries) +} + +#[cfg(test)] +mod tests { + use super::*; + use flate2::Compression; + use flate2::write::ZlibEncoder; + + /// An audio container of one stream with two chunks, the last one + /// ending at `end`; `flags` chooses the optional tables. + fn awc(flags: u16, end: u32) -> Vec { + let mut out = b"ADAT".to_vec(); + out.extend_from_slice(&1u16.to_le_bytes()); + out.extend_from_slice(&flags.to_le_bytes()); + out.extend_from_slice(&1u32.to_le_bytes()); + let tables: u32 = + [(0x01, 2), (0x20, 8), (0x40, 4)].iter().filter(|(f, _)| flags & f != 0).map(|(_, n)| n).sum(); + let header = 16 + tables + 4 + 16; + out.extend_from_slice(&header.to_le_bytes()); + out.resize(16 + tables as usize, 0xEE); + out.extend_from_slice(&(7u32 | (2 << 29)).to_le_bytes()); + let chunk = |kind: u64, size: u32, offset: u32| (kind << 56) | (u64::from(size) << 28) | u64::from(offset); + out.extend_from_slice(&chunk(0x76, 32, header).to_le_bytes()); + out.extend_from_slice(&chunk(0x55, end - header - 32, header + 32).to_le_bytes()); + out.resize(end as usize, 0x55); + out + } + + #[test] + fn named_entries_are_listed_by_their_names() { + let names = Names::new([ + (0x300, "w_pistol.#dr".to_owned()), + (0x200, "W_Pistol.#dr".to_owned()), + (0x400, "odd name/..#ft".to_owned()), + (0x500, String::new()), + ]); + assert_eq!(names.len(), 3); + // The same name twice: the later entry gets a number. + assert_eq!((names.get(0x200), names.get(0x300)), (Some("W_Pistol.#dr"), Some("w_pistol~2.#dr"))); + assert_eq!(names.get(0x400), Some("odd_name_..#ft")); + assert_eq!(names.offset_of("w_PISTOL~2.#DR"), Some(0x300)); + assert_eq!((Names::group("w_pistol.#dr"), Names::group("plain.#dr")), ("w".to_owned(), "other".to_owned())); + + let (data, _) = archive(); + let dir = std::env::temp_dir().join(format!("rage-rpf9-names-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join("named.rpf"); + std::fs::write(&path, &data).unwrap(); + let rpf = Rpf9::open(&path).unwrap(); + let entries = rpf.scan(&AtomicBool::new(false), &|_, _| {}).unwrap(); + rpf.set_names(Names::new([(entries[0].offset, "veh_car.#ft".to_owned())])); + assert_eq!(rpf.entry_name(&entries[0]), "models/veh/veh_car.#ft"); + assert_eq!(rpf.find(&entries, "Models/VEH/veh_car.#ft"), Some(0)); + assert_eq!(rpf.find(&entries, "xml/000000000100.xml"), None); + assert_eq!(rpf.find(&entries, &rpf.entry_name(&entries[1])), Some(1)); + assert_eq!(rpf.list_dir(&entries, "").0, ["bin", "bk2", "models", "psin"]); + assert_eq!(rpf.list_dir(&entries, "models"), (vec!["veh".to_owned()], vec![])); + assert_eq!(rpf.list_dir(&entries, "models/veh"), (vec![], vec![0])); + // The start of a large entry: at least what was asked for, not all of it. + let start = rpf.read_start(&entries[1], 100).unwrap(); + assert!(start.len() >= 100 && (start.len() as u64) < entries[1].size); + assert_eq!(rpf.read_start(&entries[0], 1 << 20).unwrap(), rpf.read(&entries[0]).unwrap()); + std::fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn finds_audio_containers_by_their_own_tables() { + assert_eq!(awc_len(&awc(0xFF21, 0x900)), Some(0x900)); + assert_eq!(awc_len(&awc(0xFF61, 0x400)), Some(0x400)); + // Not version 1, no streams, a chunk table that is cut off. + let mut other = awc(0xFF21, 0x900); + other[4] = 2; + assert_eq!(awc_len(&other), None); + other = awc(0xFF21, 0x900); + other[8] = 0; + assert_eq!(awc_len(&other), None); + assert_eq!(awc_len(&awc(0xFF21, 0x900)[..40]), None); + + let mut data = vec![0u8; 0x100]; + data[..4].copy_from_slice(&MAGIC.to_le_bytes()); + data[4..8].copy_from_slice(&0x100u32.to_le_bytes()); + data.extend(zlib(b"some text in front")); + pad(&mut data); + let at = data.len() as u64; + data.extend(awc(0xFF21, 0x900)); + pad(&mut data); + data.extend(zlib(b"and some after it")); + let dir = std::env::temp_dir().join(format!("rage-rpf9-awc-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let path = dir.join("audio.rpf"); + std::fs::write(&path, &data).unwrap(); + let rpf = Rpf9::open(&path).unwrap(); + let entries = rpf.scan(&AtomicBool::new(false), &|_, _| {}).unwrap(); + let kinds: Vec = entries.iter().map(|e| e.kind).collect(); + assert_eq!(kinds, [Kind::Zlib, Kind::Awc, Kind::Zlib]); + assert_eq!((entries[1].offset, entries[1].stored, entries[1].extension().as_str()), (at, 0x900, "awc")); + assert_eq!(rpf.read(&entries[1]).unwrap(), awc(0xFF21, 0x900)); + assert_eq!(decode_index(&encode_index(&entries)).as_deref(), Some(&entries[..])); + std::fs::remove_dir_all(dir).unwrap(); + } + + fn zlib(data: &[u8]) -> Vec { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + enc.write_all(data).unwrap(); + enc.finish().unwrap() + } + + fn pad(out: &mut Vec) { + out.resize(out.len().next_multiple_of(ALIGN as usize), 0); + } + + /// An archive with an opaque table and, in its data area: a small XML + /// file, a file of two and a half chunks, noise with a stream header that + /// leads nowhere, a Bink 2 video, a tagged binary. + fn archive() -> (Vec, Vec) { + let mut out = vec![0u8; 0x100]; + out[..4].copy_from_slice(&MAGIC.to_le_bytes()); + out[4..8].copy_from_slice(&0x100u32.to_le_bytes()); + out[0x40..0x100].fill(0xA7); + out.extend(zlib(b"")); + pad(&mut out); + let big: Vec = (0..CHUNK as usize * 2 + 1000).map(|i| (i * 31 % 251) as u8).collect(); + for chunk in big.chunks(CHUNK as usize) { + out.extend(zlib(chunk)); + pad(&mut out); + } + out.extend([0x78, 0x9C, 0xFF, 0xFF, 0x13, 0x37, b'K', b'B', b'2', 0x00]); + pad(&mut out); + let mut video = vec![0u8; 64]; + video[..4].copy_from_slice(b"KB2j"); + video[4..8].copy_from_slice(&56u32.to_le_bytes()); + video[8..12].copy_from_slice(&30u32.to_le_bytes()); + video[20..24].copy_from_slice(&1920u32.to_le_bytes()); + video[24..28].copy_from_slice(&1080u32.to_le_bytes()); + out.extend(&video); + pad(&mut out); + out.extend(zlib(b"PSIN\x01\x00\x00\x00rest of a tagged file")); + (out, big) + } + + fn write(name: &str, data: &[u8]) -> PathBuf { + let path = std::env::temp_dir().join(format!("openrage-rpf9-{}-{name}.rpf", std::process::id())); + std::fs::write(&path, data).unwrap(); + path + } + + #[test] + fn scan_finds_and_joins_streams() { + let (data, big) = archive(); + let path = write("scan", &data); + let rpf = Rpf9::open(&path).unwrap(); + assert_eq!(rpf.header().data_offset, 0x100); + let entries = rpf.entries().unwrap(); + let names: Vec = entries.iter().map(|e| rpf.entry_name(e)).collect(); + let exts: Vec<&str> = names.iter().map(|n| n.split('/').next().unwrap()).collect(); + assert_eq!(exts, ["xml", "bin", "bk2", "psin"]); + assert_eq!(names[0], "xml/000000000100.xml"); + assert_eq!((entries[1].streams, entries[1].size), (3, big.len() as u64)); + assert_eq!(rpf.read(&entries[1]).unwrap(), big); + assert_eq!(rpf.read(&entries[0]).unwrap(), b""); + assert_eq!(rpf.read(&entries[2]).unwrap().len(), 64); + assert!(rpf.read(&entries[3]).unwrap().starts_with(b"PSIN")); + + assert_eq!(rpf.find(&entries, &names[3].to_ascii_uppercase()), Some(3)); + assert_eq!(rpf.find(&entries, "xml/000000000101.xml"), None); + assert_eq!(rpf.find(&entries, &names[3].replace("psin/", "xml/")), None); + let (dirs, files) = rpf.list_dir(&entries, ""); + assert_eq!((dirs, files.len()), (vec!["bin".into(), "bk2".into(), "psin".into(), "xml".into()], 0)); + assert_eq!(rpf.list_dir(&entries, "psin"), (vec![], vec![3])); + assert!(rpf.is_dir(&entries, "bk2") && !rpf.is_dir(&entries, "ytd") && !rpf.is_dir(&entries, "xml/000")); + + assert_eq!(decode_index(&encode_index(&entries)).as_deref(), Some(&entries[..])); + assert_eq!(decode_index(&encode_index(&entries)[1..]), None); + std::fs::remove_file(path).unwrap(); + } + + #[test] + fn a_stream_with_a_wrong_checksum_is_not_a_file() { + let mut data = vec![0u8; 0x40]; + data[..4].copy_from_slice(&MAGIC.to_le_bytes()); + data[4..8].copy_from_slice(&0x40u32.to_le_bytes()); + let mut stream = zlib(b"some text that is long enough to matter"); + let last = stream.len() - 1; + stream[last] ^= 0x55; + data.extend(stream); + let path = write("checksum", &data); + assert_eq!(Rpf9::open(&path).unwrap().entries().unwrap().len(), 0); + std::fs::remove_file(path).unwrap(); + } + + #[test] + fn scan_can_be_cancelled_and_rejects_bad_headers() { + let (data, _) = archive(); + let path = write("cancel", &data); + let rpf = Rpf9::open(&path).unwrap(); + assert!(matches!(rpf.scan(&AtomicBool::new(true), &|_, _| {}), Err(RpfError::Cancelled))); + let mut bad = data.clone(); + bad[4..8].copy_from_slice(&u32::MAX.to_le_bytes()); + std::fs::write(&path, &bad).unwrap(); + assert!(matches!(Rpf9::open(&path), Err(RpfError::CorruptToc { .. }))); + std::fs::remove_file(path).unwrap(); + } + + #[test] + fn clear_header_reports_native_slots_and_transform_tag() { + let mut bytes = [0u8; HEADER_LEN]; + bytes[..4].copy_from_slice(&MAGIC.to_le_bytes()); + bytes[4..8].copy_from_slice(&0x9580u32.to_le_bytes()); + bytes[0x24..0x28].copy_from_slice(&418u32.to_le_bytes()); + bytes[0x2e] = 9; + let header = Header::parse(&bytes).unwrap(); + assert_eq!(header.data_offset, 0x9580); + assert_eq!(header.entry_count, 418); + assert_eq!(header.toc_transform, 9); + assert!(Header::parse(&bytes[..HEADER_LEN - 1]).is_none()); + } + + #[test] + fn a_stream_scan_honors_cancellation_during_inflate() { + let (data, _) = archive(); + let path = write("cancel-inflate", &data); + let mut scanner = Scanner::new(File::open(&path).unwrap(), data.len() as u64); + assert!(matches!(scanner.stream_at(0x100, &AtomicBool::new(true)), Err(RpfError::Cancelled))); + std::fs::remove_file(path).unwrap(); + } + + #[test] + fn extraction_rejects_bad_lengths_and_truncated_stored_files() { + let (data, _) = archive(); + let path = write("read-bounds", &data); + let rpf = Rpf9::open(&path).unwrap(); + let entries = rpf.entries().unwrap(); + let mut entry = entries[0].clone(); + entry.size = 1; + let mut out = Vec::new(); + assert!(rpf.copy_to(&entry, &mut out).is_err()); + assert!(out.len() <= 2); + entry = entries[0].clone(); + entry.offset = 0; + assert!(matches!(rpf.copy_to(&entry, &mut Vec::new()), Err(RpfError::OutOfBounds { .. }))); + + // The file can be replaced after opening an archive. Stored media + // must report a short read just as compressed entries do. + let entry = &entries[2]; + std::fs::OpenOptions::new().write(true).open(&path).unwrap().set_len(entry.offset + 10).unwrap(); + assert!(rpf.copy_to(entry, &mut Vec::new()).is_err()); + std::fs::remove_file(path).unwrap(); + } + + #[test] + fn cached_entries_reject_overflow_overlap_and_invalid_records() { + let (data, _) = archive(); + let path = write("index-bounds", &data); + let entries = Rpf9::open(&path).unwrap().entries().unwrap(); + let encoded = encode_index(&entries); + for (at, bytes) in [ + (0, u64::MAX.to_le_bytes().to_vec()), + (8, 0u64.to_le_bytes().to_vec()), + (24, 0u32.to_le_bytes().to_vec()), + (29, vec![17]), + (INDEX_RECORD, entries[0].offset.to_le_bytes().to_vec()), + ] { + let mut bad = encoded.clone(); + bad[at..at + bytes.len()].copy_from_slice(&bytes); + assert!(decode_index(&bad).is_none(), "accepted invalid field at {at}"); + } + std::fs::remove_file(path).unwrap(); + } + + #[test] + fn extensions_come_from_the_first_bytes() { + let ext = |head: &[u8]| { + let mut e = + Entry { offset: 0, stored: 0, size: 0, streams: 1, kind: Kind::Zlib, head: [0; 16], head_len: 0 }; + e.head[..head.len()].copy_from_slice(head); + e.head_len = head.len() as u8; + e.extension() + }; + assert_eq!(ext(b"\xEF\xBB\xBF\r\n "), "xml"); + assert_eq!(ext(b"NAME = value\r\n"), "txt"); + assert_eq!(ext(b"PSIN\x00\x01\x02\x03"), "psin"); + assert_eq!(ext(b"0DRP\x00\x00\x00\x00"), "0drp"); + assert_eq!(ext(b"17MY\x00\x00\x00\x00"), "bin"); + assert_eq!(ext(b"\x00\x00\x00\x00"), "bin"); + assert_eq!(ext(b""), "bin"); + } +} diff --git a/crates/rage-rpf/src/rpf9_cipher.rs b/crates/rage-rpf/src/rpf9_cipher.rs new file mode 100644 index 0000000..954b54e --- /dev/null +++ b/crates/rage-rpf/src/rpf9_cipher.rs @@ -0,0 +1,357 @@ +//! The Scarlett build's table-driven 16-byte block transform. +//! +//! Reconstructed from the instructions at VA 0x145642c50 of the executable +//! identified below. Tables and key schedules are read from the user's file; +//! none are bundled. This module supports only that exact executable build. + +use std::collections::BTreeMap; + +use sha2::{Digest, Sha256}; + +const EXE_SHA256: [u8; 32] = [ + 0xe9, 0x50, 0x20, 0xb2, 0xfa, 0x4a, 0x72, 0x1d, 0xb3, 0xdf, 0x59, 0xfd, 0xec, 0xf7, 0x56, 0x21, 0x73, 0x0a, 0xc5, + 0x59, 0xd8, 0x83, 0x52, 0x52, 0xf6, 0xc3, 0xb6, 0x58, 0xd5, 0xa0, 0x89, 0x93, +]; +const INITIAL_VA: u64 = 0x146036f30; +const MIDDLE_VA: u64 = 0x146037f30; +const KEY_TABLE_VA: u64 = 0x1466e5900; +const KEY_RECORDS: usize = 24; +const KEY_BLOB_LEN: usize = 0x10f4; + +struct Key { + words: [u32; 60], + end: Vec, +} + +/// Cipher material extracted from a supported local executable. +pub(crate) struct Cipher { + initial: Vec, + middle: Vec, + keys: BTreeMap, + header_iv: [u8; 16], + ctr_initial: Vec, + ctr_middle: Vec, + ctr_keys: BTreeMap, +} + +impl Cipher { + /// Returns `None` for an unknown build or inconsistent PE/key layout. + pub(crate) fn from_exe(exe: &[u8]) -> Option { + if Sha256::digest(exe).as_slice() != EXE_SHA256 { + return None; + } + let initial = pe_bytes(exe, INITIAL_VA, 16 * 256)?.to_vec(); + let header_iv = pe_bytes(exe, 0x1462fd470, 16)?.try_into().ok()?; + let ctr_initial = pe_bytes(exe, 0x146040f30, 16 * 256)?.to_vec(); + let ctr_middle = pe_bytes(exe, 0x146041f30, 16 * 256 * 4)? + .as_chunks::<4>() + .0 + .iter() + .map(|word| u32::from_le_bytes(*word)) + .collect(); + let middle = pe_bytes(exe, MIDDLE_VA, 16 * 256 * 4)? + .as_chunks::<4>() + .0 + .iter() + .map(|word| u32::from_le_bytes(*word)) + .collect(); + let mut keys = BTreeMap::new(); + let mut ctr_keys = BTreeMap::new(); + for record in pe_bytes(exe, KEY_TABLE_VA, KEY_RECORDS * 24)?.as_chunks::<24>().0 { + let tag = u64::from_le_bytes(record[..8].try_into().ok()?); + // The native key lookup uses class 2 for decrypt state 1. + if tag as u32 != 0x02000000 { + continue; + } + let address = u64::from_le_bytes(record[8..16].try_into().ok()?); + let len = u64::from_le_bytes(record[16..24].try_into().ok()?); + if len != KEY_BLOB_LEN as u64 { + return None; + } + let blob = pe_bytes(exe, address, KEY_BLOB_LEN)?; + let magic = u32::from_le_bytes(blob[..4].try_into().ok()?); + if !matches!(magic, 0x4e3b9b8e | 0x2718ce5d) { + // Other algorithms share this key registry. Their serialized + // blobs have different magics and must not be treated as this + // transform's context. + continue; + } + let words = std::array::from_fn(|i| { + u32::from_le_bytes(blob[4 + i * 4..8 + i * 4].try_into().expect("bounded word")) + }); + let target = if magic == 0x4e3b9b8e { &mut keys } else { &mut ctr_keys }; + target.insert((tag >> 32) as u32, Key { words, end: blob[0xf4..].to_vec() }); + } + Some(Self { initial, middle, keys, header_iv, ctr_initial, ctr_middle, ctr_keys }) + } + + pub(crate) fn header_iv(&self) -> [u8; 16] { + self.header_iv + } + + pub(crate) fn has_key(&self, id: u32) -> bool { + self.keys.contains_key(&id) + } + + /// The pure block transform, without a chaining mode or padding. + pub(crate) fn decrypt_block(&self, id: u32, input: &[u8; 16]) -> Option<[u8; 16]> { + let key = self.keys.get(&id)?; + let mut state = [0u32; 4]; + for (column, word) in state.iter_mut().enumerate() { + for byte in 0..4 { + let i = column * 4 + byte; + *word = (*word << 8) ^ u32::from(self.initial[i * 256 + usize::from(input[i])]); + } + *word ^= key.words[column]; + } + let t = |table: usize, word: u32, shift: u32| self.middle[table * 256 + ((word >> shift) & 255) as usize]; + // The native loop processes pairs of rounds, then exits after the + // first half of its seventh iteration (13 rounds in total). + for round in 1..=13 { + let [a, b, c, d] = state; + state = [ + t(0, a, 24) ^ t(7, b, 0) ^ t(10, c, 8) ^ t(13, d, 16) ^ key.words[round * 4], + t(4, b, 24) ^ t(11, c, 0) ^ t(1, a, 16) ^ t(14, d, 8) ^ key.words[round * 4 + 1], + t(8, c, 24) ^ t(15, d, 0) ^ t(2, a, 8) ^ t(5, b, 16) ^ key.words[round * 4 + 2], + t(12, d, 24) ^ t(3, a, 0) ^ t(6, b, 8) ^ t(9, c, 16) ^ key.words[round * 4 + 3], + ]; + } + let [a, b, c, d] = state; + let selected = [ + a >> 24, + d >> 16, + c >> 8, + b, + b >> 24, + a >> 16, + d >> 8, + c, + c >> 24, + b >> 16, + a >> 8, + d, + d >> 24, + c >> 16, + b >> 8, + a, + ]; + Some(std::array::from_fn(|i| key.end[i * 256 + (selected[i] & 255) as usize])) + } + + /// Decrypts complete CBC blocks and updates the caller-owned chaining + /// state, permitting successive metadata spans to share a chain. + pub(crate) fn decrypt_cbc(&self, id: u32, bytes: &mut [u8], iv: &mut [u8; 16]) -> Option<()> { + if !bytes.len().is_multiple_of(16) || !self.has_key(id) { + return None; + } + for block in bytes.as_chunks_mut::<16>().0 { + let stored = *block; + let plain = self.decrypt_block(id, &stored)?; + for i in 0..16 { + block[i] = plain[i] ^ iv[i]; + } + *iv = stored; + } + Some(()) + } + + /// The counter-mode keystream primitive at VA `0x1456437c0`. This is a + /// separate transform from the CBC block primitive, with its own tables. + pub(crate) fn counter_block(&self, id: u32, input: &[u8; 16]) -> Option<[u8; 16]> { + let key = self.ctr_keys.get(&id)?; + let mut state = [0u32; 4]; + for (column, word) in state.iter_mut().enumerate() { + for byte in 0..4 { + let i = column * 4 + byte; + *word = (*word << 8) ^ u32::from(self.ctr_initial[i * 256 + usize::from(input[i])]); + } + *word ^= key.words[column]; + } + let t = |table: usize, word: u32, shift: u32| self.ctr_middle[table * 256 + ((word >> shift) & 255) as usize]; + for round in 1..=13 { + let [a, b, c, d] = state; + state = [ + t(0, a, 24) ^ t(5, b, 16) ^ t(10, c, 8) ^ t(15, d, 0) ^ key.words[round * 4], + t(4, b, 24) ^ t(9, c, 16) ^ t(14, d, 8) ^ t(3, a, 0) ^ key.words[round * 4 + 1], + t(8, c, 24) ^ t(13, d, 16) ^ t(2, a, 8) ^ t(7, b, 0) ^ key.words[round * 4 + 2], + t(12, d, 24) ^ t(1, a, 16) ^ t(6, b, 8) ^ t(11, c, 0) ^ key.words[round * 4 + 3], + ]; + } + let [a, b, c, d] = state; + let selected = [ + a >> 24, + b >> 16, + c >> 8, + d, + b >> 24, + c >> 16, + d >> 8, + a, + c >> 24, + d >> 16, + a >> 8, + b, + d >> 24, + a >> 16, + b >> 8, + c, + ]; + Some(std::array::from_fn(|i| key.end[i * 256 + (selected[i] & 255) as usize])) + } + + /// XORs bytes with algorithm 17's stream at `offset` bytes from the + /// beginning of an encrypted member. The native implementation increments + /// the full 16-byte counter in big-endian order after using each block. + /// `iv` is the descriptor's initial counter and is never modified. + pub(crate) fn crypt_ctr(&self, id: u32, bytes: &mut [u8], iv: &[u8; 16], offset: u64) -> Option<()> { + if !self.ctr_keys.contains_key(&id) { + return None; + } + let mut counter = u128::from_be_bytes(*iv).wrapping_add(u128::from(offset / 16)); + let mut skip = (offset % 16) as usize; + let mut at = 0; + while at < bytes.len() { + let stream = self.counter_block(id, &counter.to_be_bytes())?; + let take = (16 - skip).min(bytes.len() - at); + for i in 0..take { + bytes[at + i] ^= stream[skip + i]; + } + at += take; + skip = 0; + counter = counter.wrapping_add(1); + } + Some(()) + } +} + +/// Converts an original-file PE address to a bounded source range. No +/// executable code is loaded or run by the parser. +fn pe_bytes(exe: &[u8], address: u64, len: usize) -> Option<&[u8]> { + if exe.get(..2)? != b"MZ" { + return None; + } + let pe = u32::from_le_bytes(exe.get(0x3c..0x40)?.try_into().ok()?) as usize; + if exe.get(pe..pe.checked_add(4)?)? != b"PE\0\0" { + return None; + } + let count = u16::from_le_bytes(exe.get(pe + 6..pe + 8)?.try_into().ok()?) as usize; + let opt_len = u16::from_le_bytes(exe.get(pe + 20..pe + 22)?.try_into().ok()?) as usize; + if count > 96 || opt_len < 32 || exe.get(pe + 24..pe + 26)? != [0x0b, 0x02] { + return None; + } + let base = u64::from_le_bytes(exe.get(pe + 48..pe + 56)?.try_into().ok()?); + let rva = address.checked_sub(base)?; + let start = pe.checked_add(24)?.checked_add(opt_len)?; + let sections = exe.get(start..start.checked_add(count.checked_mul(40)?)?)?; + for section in sections.as_chunks::<40>().0 { + let virtual_start = u32::from_le_bytes(section[12..16].try_into().ok()?) as u64; + let stored_len = u32::from_le_bytes(section[16..20].try_into().ok()?) as u64; + let stored_start = u32::from_le_bytes(section[20..24].try_into().ok()?) as u64; + let Some(relative) = rva.checked_sub(virtual_start) else { continue }; + if relative.checked_add(len as u64)? > stored_len { + continue; + } + let offset = usize::try_from(stored_start.checked_add(relative)?).ok()?; + return exe.get(offset..offset.checked_add(len)?); + } + None +} + +#[cfg(test)] +mod tests { + use super::*; + + // Zero tables produce a constant zero block. This isolates the CBC + // chaining contract from the reconstructed block cipher and game data. + fn constant_cipher() -> Cipher { + let key = Key { words: [0; 60], end: vec![0; 16 * 256] }; + Cipher { + initial: vec![0; 16 * 256], + middle: vec![0; 16 * 256], + keys: BTreeMap::from([(7, key)]), + header_iv: [0x12; 16], + ctr_initial: vec![0; 16 * 256], + ctr_middle: vec![0; 16 * 256], + ctr_keys: BTreeMap::new(), + } + } + + #[test] + fn cbc_uses_previous_ciphertext_and_carries_the_chain_between_spans() { + let cipher = constant_cipher(); + let mut first = [0x34; 32]; + first[16..].fill(0x56); + let mut chain = cipher.header_iv(); + cipher.decrypt_cbc(7, &mut first, &mut chain).unwrap(); + assert_eq!(&first[..16], &[0x12; 16]); + assert_eq!(&first[16..], &[0x34; 16]); + assert_eq!(chain, [0x56; 16]); + let mut second = [0x78; 16]; + cipher.decrypt_cbc(7, &mut second, &mut chain).unwrap(); + assert_eq!(second, [0x56; 16]); + assert_eq!(chain, [0x78; 16]); + } + + #[test] + fn cbc_rejects_unknown_keys_and_partial_blocks_before_mutating() { + let cipher = constant_cipher(); + let mut chain = [0x12; 16]; + let mut bytes = [0x34; 17]; + assert!(cipher.decrypt_cbc(7, &mut bytes, &mut chain).is_none()); + assert_eq!(bytes, [0x34; 17]); + assert!(cipher.decrypt_cbc(8, &mut bytes[..16], &mut chain).is_none()); + assert_eq!(bytes, [0x34; 17]); + assert_eq!(chain, [0x12; 16]); + assert!(Cipher::from_exe(b"an unknown executable build").is_none()); + } + + fn counter_cipher() -> Cipher { + let mut cipher = constant_cipher(); + cipher.ctr_initial = (0..16 * 256).map(|i| i as u8).collect(); + cipher.ctr_middle = + (0..16 * 256).map(|i| ((i % 256) as u32).wrapping_mul(0x9e3779b9).rotate_left((i / 256) as u32)).collect(); + cipher.ctr_keys.insert( + 9, + Key { + words: std::array::from_fn(|i| (i as u32).wrapping_mul(0x6a09e667)), + end: (0..16 * 256).map(|i| i as u8).collect(), + }, + ); + cipher + } + + #[test] + fn ctr_increments_the_counter_big_endian_and_wraps() { + let cipher = counter_cipher(); + let mut iv = [0u8; 16]; + iv[15] = 255; + let mut next = [0u8; 16]; + next[14] = 1; + let mut bytes = [0u8; 32]; + cipher.crypt_ctr(9, &mut bytes, &iv, 0).unwrap(); + assert_eq!(&bytes[..16], &cipher.counter_block(9, &iv).unwrap()); + assert_eq!(&bytes[16..], &cipher.counter_block(9, &next).unwrap()); + let mut wrap = [0u8; 32]; + cipher.crypt_ctr(9, &mut wrap, &[255; 16], 0).unwrap(); + assert_eq!(&wrap[16..], &cipher.counter_block(9, &[0; 16]).unwrap()); + } + + #[test] + fn ctr_reads_at_unaligned_offsets_match_whole_member_reads() { + let cipher = counter_cipher(); + let iv = [0x12; 16]; + let plain: Vec = (0..97).collect(); + let mut whole = plain.clone(); + cipher.crypt_ctr(9, &mut whole, &iv, 0).unwrap(); + assert_ne!(&whole[..16], &whole[16..32]); + for (start, end) in [(0, 3), (3, 21), (21, 32), (32, 81), (81, 97)] { + let mut part = plain[start..end].to_vec(); + cipher.crypt_ctr(9, &mut part, &iv, start as u64).unwrap(); + assert_eq!(part, whole[start..end]); + } + cipher.crypt_ctr(9, &mut whole, &iv, 0).unwrap(); + assert_eq!(whole, plain); + assert!(cipher.crypt_ctr(10, &mut whole, &iv, 0).is_none()); + assert_eq!(whole, plain); + } +} diff --git a/crates/rage-rpf/src/rpf9_index.rs b/crates/rage-rpf/src/rpf9_index.rs new file mode 100644 index 0000000..5ecaead --- /dev/null +++ b/crates/rage-rpf/src/rpf9_index.rs @@ -0,0 +1,415 @@ +//! Validated native RPF9 tables after header transforms have been removed. +//! +//! Layout reconstructed from the Scarlett loader and table getters documented +//! in `docs/rpf9-scarlett.md`. Cipher material is supplied separately by the +//! local executable; this parser contains no game data. + +use std::collections::HashSet; + +pub const RESOURCE: u64 = 0xba18_0afb_232d_1b4b; +pub const CHUNKED: u64 = 0x33f7_0dfa_f2c5_0989; +pub const RAW: u64 = 0x4eaa_16dd_8299_95bc; +pub const HASH32: u64 = 0xb707_6b62_45d3_5fb5; +pub const HASH64: u64 = 0x73bc_b72d_ce74_f11f; +pub const CHUNKS: u64 = 0xe0c1_2d7a_5d48_84c5; +pub const ENCRYPTION: u64 = 0x2860_30a3_58a7_89fb; +const MASK40: u64 = (1 << 40) - 1; +const MASK44: u64 = (1 << 44) - 1; +const MASK48: u64 = (1 << 48) - 1; + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Storage { + Raw, + Chunked, + Resource { system_flags: u32, graphics_flags: u32 }, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct NativeEntry { + pub slot: usize, + pub offset: u64, + pub stored: u64, + pub size: u64, + pub type_id: u8, + pub layout: u8, + pub name_hash32: Option, + pub name_hash64: Option, + pub storage: Storage, + records: Vec>, +} + +/// One chunk of a member's data. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Chunk { + /// From the start of the member's data, after a resource's prefix. + pub offset: u64, + /// Stored bytes, without padding. + pub stored: u64, + /// Decoded bytes. + pub size: u64, + /// A zlib stream; otherwise the bytes as they are. + pub zlib: bool, +} + +#[derive(Debug, Clone)] +pub struct Table { + pub type_hash: u64, + pub count: usize, + pub stride: usize, + /// Absolute offset inside the decoded header, not inside archive payload. + pub start: usize, +} + +#[derive(Debug)] +pub struct Catalog { + pub entries: Vec, + pub tables: Vec
, + pub header: Vec, + pub split: usize, +} + +fn u16_at(b: &[u8], at: usize) -> u16 { + u16::from_le_bytes(b[at..at + 2].try_into().expect("validated field")) +} +fn u32_at(b: &[u8], at: usize) -> u32 { + u32::from_le_bytes(b[at..at + 4].try_into().expect("validated field")) +} +fn u64_at(b: &[u8], at: usize) -> u64 { + u64::from_le_bytes(b[at..at + 8].try_into().expect("validated field")) +} +fn aligned(value: usize, alignment: usize) -> Result { + if !alignment.is_power_of_two() { + return Err("invalid native table alignment".into()); + } + value.checked_add(alignment - 1).map(|n| n & !(alignment - 1)).ok_or_else(|| "native table overflow".into()) +} +fn sum(a: usize, b: usize) -> Result { + a.checked_add(b).ok_or_else(|| "native table overflow".into()) +} +fn product(a: usize, b: usize) -> Result { + a.checked_mul(b).ok_or_else(|| "native table overflow".into()) +} + +impl Catalog { + /// Parses already-decoded header bytes and checks all tables, entry + /// indices and payload ranges before exposing any native entries. + pub fn parse(header: Vec, archive_size: u64) -> Result { + if header.len() < 64 || u32_at(&header, 0) != 0x5250_4639 { + return Err("not a native RPF9 header".into()); + } + let extent = u32_at(&header, 4) as usize; + let split = u32_at(&header, 8) as usize; + if extent != header.len() || extent as u64 > archive_size || header.len() > 64 << 20 { + return Err("native header extent is invalid or too large".into()); + } + let directories = usize::from(u16_at(&header, 0x1a)); + let blob_size = u32_at(&header, 0x1c) as usize; + let table_count = usize::from(u16_at(&header, 0x20)); + let secondary = usize::from(u16_at(&header, 0x22)); + let count = u32_at(&header, 0x24) as usize; + let width = usize::from(header[0x2c]); + let wide_align = header[0x2d] & 1 != 0; + if !matches!(width, 1 | 2 | 4) || secondary > table_count || count > 1_000_000 { + return Err("unsupported native table dimensions".into()); + } + if table_count == 0 && count != 0 { + return Err("native entries have no tables".into()); + } + let primary = table_count - secondary; + let directory = aligned(64, if wide_align { 16 } else { 4 })?; + let blob = aligned(sum(directory, product(directories, 8)?)?, if wide_align { 16 } else { 8 })?; + let descriptors = aligned(sum(blob, blob_size)?, if wide_align { 16 } else { 8 })?; + let indices = aligned(sum(descriptors, product(table_count, 24)?)?, width)?; + let data = aligned(sum(indices, product(product(primary, count)?, width)?)?, 8)?; + let secondary_indices = aligned(split, width)?; + let secondary_data = aligned(sum(secondary_indices, product(product(secondary, count)?, width)?)?, 8)?; + if data > split || secondary_data > extent { + return Err("native table arrays lie outside the header".into()); + } + let mut tables = Vec::with_capacity(table_count); + let mut types = HashSet::new(); + for column in 0..table_count { + let at = descriptors + column * 24; + let type_hash = u64_at(&header, at); + let records = u32_at(&header, at + 8) as usize; + let offset = u32_at(&header, at + 12) as usize; + let stride = usize::from(u16_at(&header, at + 16)); + let (base, limit) = if column < primary { (data, split) } else { (secondary_data, extent) }; + let start = sum(base, offset)?; + if start > limit || sum(start, product(records, stride)?)? > limit || records > 0 && stride == 0 { + return Err(format!("native table {column} lies outside its header section")); + } + if !types.insert(type_hash) { + return Err("duplicate native table type".into()); + } + tables.push(Table { type_hash, count: records, stride, start }); + } + let mut entries = Vec::with_capacity(count); + for slot in 0..count { + let mut selected = Vec::with_capacity(table_count); + for (column, table) in tables.iter().enumerate() { + let (matrix, columns, local) = if column < primary { + (indices, primary, column) + } else { + (secondary_indices, secondary, column - primary) + }; + let at = matrix + (slot * columns + local) * width; + let index = match width { + 1 => u32::from(header[at]), + 2 => u32::from(u16_at(&header, at)), + _ => u32_at(&header, at), + }; + let missing = match width { + 1 => 0xff, + 2 => 0xffff, + _ => u32::MAX, + }; + if index == missing { + selected.push(None); + } else if (index as usize) < table.count { + selected.push(Some(table.start + index as usize * table.stride)); + } else { + return Err(format!("slot {slot} has an invalid native table index")); + } + } + let record = |kind: u64, min: usize| -> Result, String> { + let Some(column) = tables.iter().position(|t| t.type_hash == kind) else { return Ok(None) }; + let Some(at) = selected[column] else { return Ok(None) }; + let stride = tables[column].stride; + if stride < min { + return Err(format!("native record {kind:016x} is too short")); + } + Ok(Some(&header[at..at + stride])) + }; + let resource = record(RESOURCE, 18)?; + let chunked = record(CHUNKED, 24)?; + let raw = record(RAW, 16)?; + if [resource.is_some(), chunked.is_some(), raw.is_some()].into_iter().filter(|v| *v).count() != 1 { + return Err(format!("slot {slot} has missing or conflicting payload records")); + } + let (offset, stored, size, type_id, layout, storage) = if let Some(r) = resource { + let system_flags = u32_at(r, 0); + let graphics_flags = u32_at(r, 4); + ( + u64::from(u32_at(r, 12)) << 4, + u64::from(u32_at(r, 8)) << 4, + u64::from(system_flags & 0x7fff_fff0) + u64::from(graphics_flags & 0xffff_fff0), + r[16], + r[17], + Storage::Resource { system_flags, graphics_flags }, + ) + } else if let Some(r) = chunked { + ( + (u64_at(r, 0) & MASK40) << 4, + (u64_at(r, 8) & MASK40) << 4, + u64_at(r, 16) & MASK44, + r[5], + r[6], + Storage::Chunked, + ) + } else { + let r = raw.expect("one checked payload record"); + ( + u64::from(u32_at(r, 4)) << 4, + u64::from(u32_at(r, 0)) << 4, + u64_at(r, 8) & MASK48, + r[14], + r[15], + Storage::Raw, + ) + }; + if offset.checked_add(stored).is_none_or(|end| end > archive_size) + || stored > 0 && offset < extent as u64 + || stored == 0 && size != 0 + { + return Err(format!("slot {slot} payload lies outside the archive")); + } + let name_hash32 = record(HASH32, 4)?.map(|r| u32_at(r, 0)); + let name_hash64 = record(HASH64, 8)?.map(|r| u64_at(r, 0)); + entries.push(NativeEntry { + slot, + offset, + stored, + size, + type_id, + layout, + name_hash32, + name_hash64, + storage, + records: selected, + }); + } + Ok(Self { entries, tables, header, split }) + } + + /// The chunks a member is stored in, or `None` if it is stored whole. A + /// chunk record holds where its list starts, counted from the record + /// itself, the number of chunks, the size of a list item and its format. + pub fn chunks(&self, slot: usize) -> Result>, String> { + let Some(column) = self.tables.iter().position(|t| t.type_hash == CHUNKS) else { return Ok(None) }; + let at = self.entries.get(slot).and_then(|e| e.records.get(column).copied().flatten()); + let Some(at) = at else { return Ok(None) }; + if self.tables[column].stride != 8 || self.header[at + 6] != 8 { + return Err("unsupported chunk record".into()); + } + let list = sum(at, u32_at(&self.header, at) as usize)?; + let count = usize::from(u16_at(&self.header, at + 4)); + let items = self.header.get(list..sum(list, count * 8)?).ok_or("chunk list lies outside the header")?; + let mut chunks = Vec::with_capacity(count); + // Formats 2 and 4 have no offsets: chunks follow each other, padded. + let mut next = 0u64; + for item in items.as_chunks::<8>().0 { + let value = u64::from_le_bytes(*item); + let (low, high) = (value as u32, (value >> 32) as u32); + let wrapped = |v: u32| 0x10000 - u64::from(v & 0xffff); + let (offset, stored, size, codec) = match self.header[at + 7] { + 2 => { + let padded = u64::from(high & 0x03ff_ffff) << 4; + (next, padded.checked_sub(u64::from(high >> 26 & 15)), u64::from(low) << 4, high >> 30) + } + 3 => (u64::from(high & 0x0fff_ffff) << 4, Some(wrapped(low >> 16)), wrapped(low), high >> 28), + 4 => { + let padded = value >> 24 & 0xff_ffff; + (next, padded.checked_sub(u64::from(high >> 20 & 15)), value & 0xff_ffff, high >> 24) + } + format => return Err(format!("chunk format {format} is not supported")), + }; + let stored = stored.ok_or("a chunk is shorter than its padding")?; + if !matches!(codec, 0 | 3) { + return Err(format!("chunk codec {codec} is not supported")); + } + next = (offset + stored).next_multiple_of(16); + chunks.push(Chunk { offset, stored, size, zlib: codec == 3 }); + } + Ok(Some(chunks)) + } + + /// A selected row's native table record, including optional tables whose + /// interpretation is handled by the payload decoder. + pub fn record(&self, slot: usize, table_type: u64) -> Option<&[u8]> { + let column = self.tables.iter().position(|t| t.type_hash == table_type)?; + let at = *self.entries.get(slot)?.records.get(column)?.as_ref()?; + self.header.get(at..at + self.tables[column].stride) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn fixture() -> Vec { + let mut b = vec![0u8; 224]; + let put32 = |b: &mut [u8], at, v: u32| b[at..at + 4].copy_from_slice(&v.to_le_bytes()); + put32(&mut b, 0, 0x5250_4639); + put32(&mut b, 4, 224); + put32(&mut b, 8, 192); + b[0x20..0x22].copy_from_slice(&3u16.to_le_bytes()); + b[0x22..0x24].copy_from_slice(&1u16.to_le_bytes()); + put32(&mut b, 0x24, 2); + b[0x2c] = 1; + b[0x2d] = 1; + for (column, kind, offset, stride) in [(0, RAW, 0u32, 16u16), (1, HASH32, 32, 4), (2, HASH64, 0, 8)] { + let at = 64 + column * 24; + b[at..at + 8].copy_from_slice(&kind.to_le_bytes()); + put32(&mut b, at + 8, 2); + put32(&mut b, at + 12, offset); + b[at + 16..at + 18].copy_from_slice(&stride.to_le_bytes()); + } + b[136..140].copy_from_slice(&[0, 0, 1, 1]); + b[192..194].copy_from_slice(&[0, 1]); + for slot in 0..2 { + let at = 144 + slot * 16; + put32(&mut b, at, 1); + put32(&mut b, at + 4, 16 + slot as u32 * 2); + put32(&mut b, at + 8, 5); + b[at + 14] = 0xff; + put32(&mut b, 176 + slot * 4, 0x1234 + slot as u32); + b[200 + slot * 8..208 + slot * 8].copy_from_slice(&(0xabcd + slot as u64).to_le_bytes()); + } + b + } + + #[test] + fn resolves_split_index_matrices_and_payload_records() { + let catalog = Catalog::parse(fixture(), 320).unwrap(); + assert_eq!(catalog.entries.len(), 2); + let e = &catalog.entries[1]; + assert_eq!((e.slot, e.offset, e.stored, e.size), (1, 288, 16, 5)); + assert_eq!((e.name_hash32, e.name_hash64), (Some(0x1235), Some(0xabce))); + assert_eq!(e.storage, Storage::Raw); + assert_eq!(catalog.record(1, RAW).unwrap().len(), 16); + assert!(catalog.record(2, RAW).is_none()); + assert!(catalog.record(0, RESOURCE).is_none()); + } + + #[test] + fn accepts_absent_optional_records_but_rejects_bad_indices_and_ranges() { + let mut b = fixture(); + b[139] = 0xff; + assert_eq!(Catalog::parse(b.clone(), 320).unwrap().entries[1].name_hash32, None); + b[138] = 2; + assert!(Catalog::parse(b, 320).is_err()); + let mut b = fixture(); + b[148..152].copy_from_slice(&u32::MAX.to_le_bytes()); + assert!(Catalog::parse(b, 320).is_err()); + let mut b = fixture(); + b[64 + 8..64 + 12].copy_from_slice(&u32::MAX.to_le_bytes()); + assert!(Catalog::parse(b, 320).is_err()); + assert!(Catalog::parse(fixture()[..223].to_vec(), 320).is_err()); + assert!(Catalog::parse(fixture(), 200).is_err()); + } + + #[test] + fn reads_the_three_chunk_formats() { + let chunks = |format: u8, items: &[[u8; 8]]| { + // The second table (hashes, 8-byte records here) becomes chunks; + // the list follows the header's other data. + let mut b = fixture(); + b[112..120].copy_from_slice(&CHUNKS.to_le_bytes()); + let record = 200; + let list = b.len(); + b[record..record + 4].copy_from_slice(&((list - record) as u32).to_le_bytes()); + b[record + 4..record + 8].copy_from_slice(&[items.len() as u8, 0, 8, format]); + items.iter().for_each(|item| b.extend_from_slice(item)); + let len = b.len() as u32; + b[4..8].copy_from_slice(&len.to_le_bytes()); + for slot in 0..2 { + b[148 + slot * 16..152 + slot * 16].copy_from_slice(&32u32.to_le_bytes()); + } + Catalog::parse(b, 1024).unwrap().chunks(0) + }; + let chunk = |offset, stored, size, zlib| Chunk { offset, stored, size, zlib }; + // 2: sizes in units of 16, padding in the last one. + let items = [[0, 0x40, 1, 0, 0xfd, 0x50, 0, 0xd4], [2, 0, 0, 0, 2, 0, 0, 0]]; + let expected = vec![chunk(0, 0x50fd0 - 5, 0x14_0000, true), chunk(0x50fd0, 32, 32, false)]; + assert_eq!(chunks(2, &items), Ok(Some(expected))); + // 3: sizes counted down from 64 KiB, with the chunk's offset. + let items = [[0, 0, 0x41, 0xb8, 0, 0, 0, 0x30], [0xf1, 0xff, 0xf1, 0xff, 0x7c, 4, 0, 0]]; + let expected = vec![chunk(0, 0x47bf, 0x10000, true), chunk(0x47c0, 15, 15, false)]; + assert_eq!(chunks(3, &items), Ok(Some(expected))); + // 4: 24-bit sizes, padding, codec. + let items = [[0, 0, 0x13, 0x70, 0xaa, 4, 0x70, 3], [0x0f, 0, 0, 0x10, 0, 0, 0x10, 0]]; + let expected = vec![chunk(0, 0x4aa70 - 7, 0x13_0000, true), chunk(0x4aa70, 15, 15, false)]; + assert_eq!(chunks(4, &items), Ok(Some(expected))); + assert!(chunks(5, &items).is_err()); + assert!(chunks(4, &[[0, 0, 0, 0, 0, 0, 0, 9]]).is_err()); + // Less stored than padding. + assert!(chunks(4, &[[1, 0, 0, 0, 0, 0, 0x10, 0]]).is_err()); + } + + #[test] + fn rejects_bad_dimensions_and_missing_storage() { + let mut b = fixture(); + b[0x2c] = 0; + assert!(Catalog::parse(b, 320).is_err()); + let mut b = fixture(); + b[0x22..0x24].copy_from_slice(&4u16.to_le_bytes()); + assert!(Catalog::parse(b, 320).is_err()); + let mut b = fixture(); + b[136] = 0xff; + assert!(Catalog::parse(b, 320).is_err()); + let mut b = fixture(); + b[64..72].copy_from_slice(&HASH32.to_le_bytes()); + assert!(Catalog::parse(b, 320).is_err()); + } +} diff --git a/crates/rage-rpf/src/rpf9_names.rs b/crates/rage-rpf/src/rpf9_names.rs new file mode 100644 index 0000000..0c974a4 --- /dev/null +++ b/crates/rage-rpf/src/rpf9_names.rs @@ -0,0 +1,478 @@ +//! Name-hash primitives observed in the Scarlett executable. +//! +//! These identify *candidate* paths; hashes do not recover the original text. +//! The 32-bit leaf is normalized Jenkins one-at-a-time. The 64-bit leaves +//! return the first half of MurmurHash3 x64-128, seed zero, with an unusual +//! final length XOR: only the low byte of the length is used. This matters +//! for strings longer than 255 bytes. These are format algorithms, not keys. +//! +//! Native routines treat inputs as C strings. A NUL ends each input; a leading +//! double quote makes the Jenkins leaf stop at the matching quote. The Murmur +//! leaf does not have that quote rule. See `docs/rpf9-name-hashes.md` for the +//! observation and isolated native comparison boundaries. + +use std::collections::HashMap; + +/// ASCII path normalization shared by the observed native hash leaves. +pub fn normalize_byte(byte: u8) -> u8 { + match byte { + b'A'..=b'Z' => byte + (b'a' - b'A'), + b'\\' => b'/', + _ => byte, + } +} + +fn c_string(bytes: &[u8]) -> &[u8] { + &bytes[..bytes.iter().position(|b| *b == 0).unwrap_or(bytes.len())] +} + +/// Native normalized Jenkins name hash, with the leading-quote C-string rule. +pub fn hash32(bytes: &[u8]) -> u32 { + let bytes = c_string(bytes); + let bytes = if let Some(quoted) = bytes.strip_prefix(b"\"") { + "ed[..quoted.iter().position(|b| *b == b'"').unwrap_or(quoted.len())] + } else { + bytes + }; + let mut hash = 0u32; + for byte in bytes { + hash = hash.wrapping_add(u32::from(normalize_byte(*byte))); + hash = hash.wrapping_add(hash << 10); + hash ^= hash >> 6; + } + hash = hash.wrapping_add(hash << 3); + hash ^= hash >> 11; + hash.wrapping_add(hash << 15) +} + +/// Normalized 64-bit native name-hash leaf (ASCII case and slash folding). +pub fn hash64(bytes: &[u8]) -> u64 { + murmur64(c_string(bytes), normalize_byte) +} + +/// Raw 64-bit native name-hash leaf, without case or slash folding. +pub fn hash64_raw(bytes: &[u8]) -> u64 { + murmur64(c_string(bytes), |byte| byte) +} + +fn murmur64(bytes: &[u8], normalize: impl Fn(u8) -> u8) -> u64 { + const C1: u64 = 0x87c3_7b91_1142_53d5; + const C2: u64 = 0x4cf5_ad43_2745_937f; + let mix1 = |value: u64| value.wrapping_mul(C1).rotate_left(31).wrapping_mul(C2); + let mix2 = |value: u64| value.wrapping_mul(C2).rotate_left(33).wrapping_mul(C1); + let word = |slice: &[u8]| { + slice.iter().enumerate().fold(0u64, |value, (i, byte)| value | (u64::from(normalize(*byte)) << (i * 8))) + }; + let (mut h1, mut h2) = (0u64, 0u64); + let (blocks, tail) = bytes.as_chunks::<16>(); + for chunk in blocks { + h1 ^= mix1(word(&chunk[..8])); + h1 = h1.rotate_left(27).wrapping_add(h2).wrapping_mul(5).wrapping_add(0x52dc_e729); + h2 ^= mix2(word(&chunk[8..])); + h2 = h2.rotate_left(31).wrapping_add(h1).wrapping_mul(5).wrapping_add(0x3849_5ab5); + } + if tail.len() > 8 { + h2 ^= mix2(word(&tail[8..])); + } + if !tail.is_empty() { + h1 ^= mix1(word(&tail[..tail.len().min(8)])); + } + // The observed native leaves explicitly zero-extend AL, not EAX. + let length = u64::from(bytes.len() as u8); + h1 ^= length; + h2 ^= length; + h1 = h1.wrapping_add(h2); + h2 = h2.wrapping_add(h1); + fmix(h1).wrapping_add(fmix(h2)) +} + +fn fmix(mut value: u64) -> u64 { + value ^= value >> 33; + value = value.wrapping_mul(0xff51_afd7_ed55_8ccd); + value ^= value >> 33; + value = value.wrapping_mul(0xc4ce_b9fe_1a85_ec53); + value ^ (value >> 33) +} + +/// The extensions of the built-in types, by number, after their family +/// prefix: `z`, `i` and `#` are aliases for each. 0 is `rpf`, without one. +const BUILT_IN: [&str; 19] = [ + "rpf", "mf", "dr", "ft", "dd", "td", "bn", "bd", "pd", "bs", "sd", "mt", "sc", "cs", "datb", "bdr", "bdd", "bft", + "vert", +]; +/// The number of the first type the game registers. +const REGISTERED_FROM: u8 = 64; +/// The extensions of the registered types, in the order of the executable's +/// table (pointers at VA 0x14618dd20 for the `#` family). Those that start +/// with `.` here have no family prefix. +const REGISTERED: [&str; 52] = [ + ".mrf", ".cut", ".gfx", "cd", "ld", "pmd", "pm", "ed", "pt", "map", "typ", "ch", "ldb", "jd", "ad", "nv", "nvs", + "pl", "nd", "vr", "wr", "nh", "fd", "as", "sm", "script", "ascript", "sma", ".iasf", "fc", "lfc", "cg", "asd", + ".rdb", "fbs", "cps", "sp", "tsl", "mmd", "fid", "msk", "hdat", "nmd", "smm", "ascd", "rd", "smam", "ldbmt", "nmd", + "kit", "cgc", "cov", +]; + +/// The type of a lower-case extension without `.`; `None` for extensions that +/// stay in a file's name. The `y` family of GTA V is not an alias. Of the two +/// types with the extension `nmd` this is the first. +pub fn extension_type(extension: &str) -> Option { + if extension == "rpf" { + return Some(0); + } + let rest = extension.strip_prefix(['z', 'i', '#']); + let built_in = || BUILT_IN.iter().skip(1).position(|e| Some(*e) == rest).map(|i| i as u8 + 1); + let registered = || { + let found = REGISTERED.iter().position(|e| match e.strip_prefix('.') { + Some(whole) => whole == extension, + None => Some(*e) == rest, + }); + found.map(|i| i as u8 + REGISTERED_FROM) + }; + built_in().or_else(registered) +} + +/// The extension of a type, of the `#` family; the inverse of +/// [`extension_type`]. `None` for an unknown type. Used to name entries. +pub fn extension_for_type(type_id: u8) -> Option { + let extension = match type_id.checked_sub(REGISTERED_FROM) { + Some(index) => REGISTERED.get(usize::from(index))?, + None => BUILT_IN.get(usize::from(type_id))?, + }; + Some(match extension.strip_prefix('.') { + Some(whole) => whole.to_owned(), + None if type_id == 0 => (*extension).to_owned(), + None => format!("#{extension}"), + }) +} + +/// The extension an entry of this type is shown with when its own is not +/// known: the canonical one, or `type` for an unknown type. +pub fn type_extension(type_id: u8) -> String { + match extension_for_type(type_id) { + Some(ext) => ext, + None if type_id == u8::MAX => "bin".to_owned(), + None => format!("type{type_id}"), + } +} + +/// Texts that may be paths, found by the hashes of the names they could be. +#[derive(Debug, Default)] +pub struct Dictionary { + texts: Vec>, + /// Hash to the text and the part of it that has the hash. + by_hash: HashMap, +} + +impl Dictionary { + /// Adds a path, `mount:/path` or plain name. The mount is dropped, and + /// what follows each slash is a name as well: files name others from + /// different folders up. Names count with and without their extension, + /// as the index leaves out those it has a type for. + pub fn add(&mut self, text: &str) { + if text.len() > 1024 { + return; + } + let Ok(number) = u32::try_from(self.texts.len()) else { return }; + let from = text.find(":/").map_or(0, |at| at + 2); + let starts = std::iter::once(from).chain(text[from..].match_indices('/').map(|(at, _)| from + at + 1)); + let mut used = false; + for start in starts { + let name = &text[start..]; + let stem = name.rsplit_once('.').filter(|(_, ext)| !ext.contains('/')).map(|(stem, _)| stem); + for part in std::iter::once(name).chain(stem).filter(|part| is_relative(part)) { + self.by_hash.entry(hash64(part.as_bytes())).or_insert_with(|| { + used = true; + (number, start as u16, (start + part.len()) as u16) + }); + } + } + if used { + self.texts.push(text.into()); + } + } + + pub fn len(&self) -> usize { + self.by_hash.len() + } + + pub fn is_empty(&self) -> bool { + self.by_hash.is_empty() + } + + /// The path of an entry with these hashes and this type. + pub fn find(&self, hash64: u64, hash32: Option, type_id: u8) -> Option { + let &(number, start, end) = self.by_hash.get(&hash64)?; + let name = &self.texts[number as usize][usize::from(start)..usize::from(end)]; + if hash32.is_some_and(|expected| expected != self::hash32(name.as_bytes())) { + return None; + } + Some(with_type(name, type_id)) + } +} + +/// The path of an entry with this name and type. +pub fn with_type(name: &str, type_id: u8) -> String { + // Texts differ in how they write folders; hashes ignore case. + let folder = name.rfind('/').map_or(0, |at| at + 1); + let name = name[..folder].to_ascii_lowercase() + &name[folder..]; + if type_id == u8::MAX { name } else { format!("{name}.{}", type_extension(type_id)) } +} + +fn is_relative(path: &str) -> bool { + path.len() >= 2 + && !path.contains([':', '%']) + && path.split('/').all(|part| !part.is_empty() && part != "." && part != "..") +} + +/// What follows a name in the name of a file that belongs to it. +const VARIANTS: [&str; 10] = ["", "_hi", "+hi", "_lod", "_b", "_c", "_decals", "_cloth", "_occl", "_metadata"]; + +/// Calls `try_name` with the names that files near the one called `name` +/// may have: its variants, and those of what it starts with. +pub fn related(name: &str, try_name: &mut dyn FnMut(&str)) { + let mut stem = name; + loop { + for variant in VARIANTS { + try_name(&format!("{stem}{variant}")); + } + let Some((shorter, _)) = stem.rsplit_once('_') else { break }; + stem = shorter; + } +} + +/// Calls `try_name` with the numbered names files of a type may have, in a +/// part of them: `part` is below [`GRID_PARTS`]. Navigation meshes and cover +/// are named by their cell of the world, collisions of the terrain by its +/// cell (`s09_w04_55`), height data by its tile. +pub fn numbered(type_id: u8, part: u32, try_name: &mut dyn FnMut(&str)) { + match type_id { + 79 | 100 | 115 => { + let name = if type_id == 115 { "coverregion" } else { "navmesh" }; + (0..GRID_PARTS).for_each(|y| try_name(&format!("{name}[{part}][{y}]"))); + } + 104 | 105 if part < 100 => { + let name = if type_id == 104 { "moverdeepsurfacetype" } else { "minmaxheight" }; + (0..100).for_each(|y| try_name(&format!("{name}/tile_{part}_{y}"))); + } + 6 if part < 80 => { + let row = format!("{}{:02}", if part < 40 { 'n' } else { 's' }, part % 40); + for column in 0..80 { + let cell = format!("{row}_{}{:02}", if column < 40 { 'e' } else { 'w' }, column % 40); + (0..300).for_each(|i| try_name(&format!("{cell}_{i}"))); + } + } + _ => {} + } +} + +/// Number of parts of [`numbered`]: more than the world has cells one way. +pub const GRID_PARTS: u32 = 512; + +/// The texts in a file's data that may be paths or names of files. +pub fn tokens(data: &[u8]) -> Vec { + let belongs = |b: &u8| b.is_ascii_alphanumeric() || b"_/\\.-#@+$:".contains(b); + let mut found: Vec = data + .split(|b| !belongs(b)) + .filter(|t| (3..=255).contains(&t.len()) && t.iter().any(u8::is_ascii_alphabetic)) + .map(|t| String::from_utf8_lossy(t).replace('\\', "/")) + .collect(); + found.sort_unstable(); + found.dedup(); + found +} + +/// Candidate path hashes and the recognized static extension type, if any. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct PathHashes { + pub hash32: u32, + pub hash64: u64, + pub file_type: Option, +} + +/// Hashes a relative path candidate. Recognized extensions are represented by +/// their type and omitted from the hash; unrecognized extensions stay in it. +/// +/// The extension is ASCII-lowercased for candidate matching. This is a helper +/// convention: the observed native extension dispatcher itself uses `strcmp`. +/// No mount prefix is removed by this helper. +pub fn path_hashes(path: &str) -> PathHashes { + let (stem, file_type) = path.rsplit_once('.').map_or((path, None), |(stem, extension)| { + let file_type = extension_type(&extension.to_ascii_lowercase()); + (if file_type.is_some() { stem } else { path }, file_type) + }); + PathHashes { hash32: hash32(stem.as_bytes()), hash64: hash64(stem.as_bytes()), file_type } +} + +/// Collects bounded NUL-terminated ASCII path candidates from an executable. +/// A candidate contains a slash or a static resource/media extension. Literal +/// `mount:/relative/path` strings contribute `relative/path`, matching native +/// mount-prefix removal. No directory or extension guesses are synthesized. +/// Candidates need catalog hash/type checks before being used as names. +pub fn candidates(exe: &[u8]) -> Vec { + let mut found = std::collections::BTreeSet::new(); + let mut start = None; + for (at, byte) in exe.iter().enumerate() { + if byte.is_ascii_graphic() || *byte == b' ' { + start.get_or_insert(at); + } else { + if *byte == 0 + && let Some(from) = start + && (3..=1024).contains(&(at - from)) + && let Ok(text) = std::str::from_utf8(&exe[from..at]) + && let Some(path) = candidate_path(text) + { + found.insert(path); + } + start = None; + } + } + found.into_iter().collect() +} + +/// Converts one literal executable path to a safe relative candidate. +/// Slash direction is normalized, case retained for display. Absolute paths, +/// traversal, format placeholders and invalid Windows filename characters are +/// rejected. This helper does not establish a catalog hash match. +pub fn candidate_path(text: &str) -> Option { + if !text.is_ascii() || text.trim() != text || !(3..=1024).contains(&text.len()) { + return None; + } + let slashes = text.replace('\\', "/"); + let path = if let Some((mount, path)) = slashes.split_once(":/") { + if mount.len() < 2 || !mount.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'_') { + return None; + } + path + } else { + &slashes + }; + if path.is_empty() + || path.starts_with('/') + || path.bytes().any(|b| !b.is_ascii_graphic() && b != b' ' || b"<>\"|:*?%{}".contains(&b)) + || path.split('/').any(|part| part.is_empty() || part == "." || part == "..") + { + return None; + } + let supported_extension = path.rsplit_once('.').is_some_and(|(_, extension)| { + let extension = extension.to_ascii_lowercase(); + extension_type(&extension).is_some() || matches!(extension.as_str(), "bk2" | "awc") + }); + (path.contains('/') || supported_extension).then(|| path.to_owned()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn matches_isolated_native_leaf_results() { + // Synthetic strings, compared with the three native leaf routines. + for (input, short, normalized, raw) in [ + ("", 0, 0, 0), + ("a", 0xca2e_9442, 0x8555_5565_f659_7889, 0x8555_5565_f659_7889), + ("COMMON\\Data\\hello", 0x576c_1635, 0xccf5_dfed_5670_81fa, 0x70cd_be33_24e2_3190), + ("\"foo\"bar", 0x2386_78dd, 0x4538_4fc0_d320_a743, 0x4538_4fc0_d320_a743), + ] { + assert_eq!(hash32(input.as_bytes()), short); + assert_eq!(hash64(input.as_bytes()), normalized); + assert_eq!(hash64_raw(input.as_bytes()), raw); + } + assert_eq!(hash32(b"\"foo\"bar"), hash32(b"foo")); + assert_ne!(hash64(b"\"foo\"bar"), hash64(b"foo")); + assert_eq!(hash32(b"a\0ignored"), hash32(b"a")); + assert_eq!(hash64(b"a\0ignored"), hash64(b"a")); + } + + #[test] + fn matches_native_block_tail_and_length_byte_boundaries() { + for (length, short, normalized, raw) in [ + (15, 0x2f4d_b830, 0x7d07_a8db_fd2e_7fbc, 0x3c58_42c4_cf7d_1737), + (16, 0x1eac_851e, 0xf2c1_180d_62aa_a6ce, 0x37bd_7653_d0d1_9d9a), + (17, 0x9ad8_78a9, 0x6f72_14c7_cef2_d698, 0x8256_209c_f2de_16fd), + (255, 0x3193_730a, 0x6fd9_34f2_7dbd_cf29, 0x6d41_d82f_587f_0654), + (256, 0x5a7c_a609, 0x42bf_fdb3_5fe4_59a8, 0x0a2f_a29d_2b04_d60d), + (257, 0xc6e9_7364, 0xe8fb_e0e1_a76f_a966, 0x9669_0e26_7253_d702), + ] { + let input = vec![b'A'; length]; + assert_eq!(hash32(&input), short); + assert_eq!(hash64(&input), normalized); + assert_eq!(hash64_raw(&input), raw); + } + } + + #[test] + fn candidate_paths_keep_unknown_extensions_and_share_static_aliases() { + assert_eq!(extension_type("rpf"), Some(0)); + assert_eq!(extension_type("zdr"), Some(2)); + assert_eq!(extension_type("idr"), Some(2)); + assert_eq!(extension_type("#dr"), Some(2)); + assert_eq!(extension_type("ydr"), None); + assert_eq!((extension_type("vert"), extension_type("#vert"), extension_type("xml")), (None, Some(18), None)); + assert_eq!((extension_type("gfx"), extension_type("#gfx"), extension_type("zcd")), (Some(66), None, Some(67))); + assert_eq!((extension_type("#script"), extension_type("#cov")), (Some(89), Some(115))); + for id in (0..=18).chain(64..=115).filter(|id| *id != 112) { + assert_eq!(extension_type(&extension_for_type(id).unwrap()), Some(id)); + } + assert_eq!([19, 63, 116, 255].map(extension_for_type), [const { None }; 4]); + let recognized = path_hashes("Models\\Example.ZDR"); + assert_eq!( + recognized, + PathHashes { hash32: hash32(b"models/example"), hash64: hash64(b"models/example"), file_type: Some(2) } + ); + let unknown = path_hashes("data/example.xml"); + assert_eq!(unknown.file_type, None); + assert_eq!(unknown.hash32, hash32(b"data/example.xml")); + assert_eq!(unknown.hash64, hash64(b"data/example.xml")); + } + + #[test] + fn dictionary_finds_names_below_mounts_and_folders() { + let mut names = Dictionary::default(); + names.add("platform:/levels/Props/barrel.rpf"); + names.add("/movies/Intro.bk2"); + names.add("../secret/file.xml"); + let find = |name: &str, ty| names.find(hash64(name.as_bytes()), Some(hash32(name.as_bytes())), ty); + assert_eq!(find("levels/props/barrel", 0).as_deref(), Some("levels/props/barrel.rpf")); + assert_eq!(find("props/barrel", 2).as_deref(), Some("props/barrel.#dr")); + assert_eq!(find("barrel", 74).as_deref(), Some("barrel.#typ")); + assert_eq!(find("movies/intro.bk2", 255).as_deref(), Some("movies/Intro.bk2")); + assert_eq!(find("secret/file.xml", 255).as_deref(), Some("secret/file.xml")); + assert!(find("../secret/file.xml", 255).is_none()); + assert!(names.find(hash64(b"barrel"), Some(1), 0).is_none()); + assert_eq!(tokens(b"\x01ab\0data\\x.xml\xff123 name"), ["data/x.xml", "name"]); + } + + #[test] + fn generates_numbered_and_related_names() { + let has = |type_id, part, wanted: &str| { + let mut found = false; + numbered(type_id, part, &mut |name| found |= name == wanted); + found + }; + assert!(has(79, 204, "navmesh[204][293]") && has(115, 0, "coverregion[0][511]")); + assert!(has(104, 36, "moverdeepsurfacetype/tile_36_34") && has(105, 1, "minmaxheight/tile_1_41")); + assert!(has(6, 49, "s09_w04_55") && has(6, 1, "n01_e00_0") && !has(2, 1, "n01_e00_0")); + let mut names = Vec::new(); + related("sandking_4dr", &mut |name| names.push(name.to_owned())); + assert!(["sandking_4dr_hi", "sandking", "sandking+hi"].iter().all(|n| names.iter().any(|m| m == n))); + } + + #[test] + fn executable_candidates_are_literal_bounded_and_relative() { + let bytes = b"\xffcommon:/Data\\Example.zdr\0common:/Data/Example.zdr\0intro.bk2\0audio.awc\0pack.rpf\0plain.txt\0../bad/file.xml\0https://host/file.xml\0/absolute/file.xml\0%s/path.xml\0word with no path\0unterminated/path.xml"; + assert_eq!(candidates(bytes), ["Data/Example.zdr", "audio.awc", "intro.bk2", "pack.rpf"]); + assert_eq!(candidate_path("data/Example.xml").as_deref(), Some("data/Example.xml")); + for bad in [ + "..\\file.zdr", + "a//file.zdr", + " leading/file.zdr", + "data/file:stream.zdr", + "data/é.zdr", + "C:\\Users\\file.zdr", + ] { + assert_eq!(candidate_path(bad), None); + } + let long = format!("data/{}.zdr\0", "x".repeat(1024)); + assert!(candidates(long.as_bytes()).is_empty()); + } +} diff --git a/crates/rage-rpf/src/rpf9_native.rs b/crates/rage-rpf/src/rpf9_native.rs new file mode 100644 index 0000000..76871fb --- /dev/null +++ b/crates/rage-rpf/src/rpf9_native.rs @@ -0,0 +1,528 @@ +//! Executable-backed native RPF9 indexes. The executable is parsed as data. + +use std::collections::{BTreeSet, HashMap}; +use std::fs::File; +use std::io::{BufReader, Read, Seek, SeekFrom, Write}; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, OnceLock, RwLock}; + +use rayon::prelude::*; + +use crate::rpf9_cipher::Cipher; +use crate::rpf9_index::{Catalog, Chunk, ENCRYPTION, NativeEntry, Storage}; +use crate::rpf9_names; + +pub(crate) struct Materials { + pub cipher: Cipher, + names: rpf9_names::Dictionary, +} + +impl std::fmt::Debug for Materials { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Materials").field("names", &self.names.len()).finish_non_exhaustive() + } +} + +/// Names of files that were learned from other archives, by their hash. +static LEARNED: RwLock>>> = RwLock::new(None); + +/// Adds names files may have, without their extension. Archives opened from +/// now on use them. +pub fn add_names(names: impl IntoIterator) { + let mut learned = LEARNED.write().unwrap_or_else(|e| e.into_inner()); + let learned = learned.get_or_insert_default(); + learned.extend(names.into_iter().map(|name| (rpf9_names::hash64(name.as_bytes()), name.into_boxed_str()))); + OPENED.lock().unwrap_or_else(|e| e.into_inner()).clear(); +} + +type OpenedKey = (PathBuf, u64, u64, Option); +static OPENED: Mutex)>> = Mutex::new(Vec::new()); + +/// Reuses runtime tables, never a checked-in or on-disk key cache. +pub(crate) fn materials(path: &Path) -> Option> { + type Key = (PathBuf, u64, Option); + // `None`: not a supported build, which is not read again and again. + static CACHE: OnceLock>>>> = OnceLock::new(); + let executable = + path.ancestors().skip(1).take(5).map(|p| p.join("game_scarlett_master.exe")).find(|p| p.is_file())?; + let meta = std::fs::metadata(&executable).ok()?; + let key = (executable, meta.len(), meta.modified().ok()); + let mut cache = CACHE.get_or_init(Default::default).lock().ok()?; + if let Some(materials) = cache.get(&key) { + return materials.clone(); + } + let materials = load_materials(&key.0).map(Arc::new); + cache.insert(key, materials.clone()); + materials +} + +fn load_materials(executable: &Path) -> Option { + let bytes = std::fs::read(executable).ok()?; + let cipher = Cipher::from_exe(&bytes)?; + // Names: path strings of the executable and of the metadata in the two + // archives that list most of the game's files. + let mut names = rpf9_names::Dictionary::default(); + for candidate in rpf9_names::candidates(&bytes) { + names.add(&candidate); + } + drop(bytes); + let nameless = Arc::new(Materials { cipher, names: Default::default() }); + let mut strings = Vec::new(); + let read = || { + for archive in ["common.rpf", "data.rpf"].map(|name| executable.with_file_name(name)) { + strings.extend(NativeArchive::strings(&archive, &nameless).unwrap_or_default()); + } + }; + crate::in_own_threads(read); + strings.iter().for_each(|text| names.add(text)); + let cipher = Arc::into_inner(nameless)?.cipher; + Some(Materials { cipher, names }) +} + +#[derive(Debug)] +pub(crate) struct NativeArchive { + pub catalog: Catalog, + materials: Arc, + /// The entries' paths, by slot. + pub paths: Vec, + /// Lower-case path to slot. + by_path: HashMap, + /// Extensions of unnamed entries without a type, from their content. + sniffed: HashMap, +} + +fn u16_at(b: &[u8], at: usize) -> Option { + Some(u16::from_le_bytes(b.get(at..at.checked_add(2)?)?.try_into().ok()?) as usize) +} +fn u32_at(b: &[u8], at: usize) -> Option { + Some(u32::from_le_bytes(b.get(at..at.checked_add(4)?)?.try_into().ok()?) as usize) +} + +pub(crate) fn decode_header(cipher: &Cipher, h: &mut [u8]) -> Option<()> { + if h.len() < 64 || h.get(..4)? != b"9FPR" { + return None; + } + if h[0x2e] == 0 { + return Some(()); + } + // The supported Scarlett build uses selector 9: two metadata spans + // share one CBC chain, leaving the secondary transform prefix intact. + if h[0x2e] != 9 { + return None; + } + let count = u16_at(h, 0x1a)?; + let directory_len = count.checked_mul(8)?.checked_add(15)? & !15; + let blob = 64usize.checked_add(directory_len)?; + let metadata_end = blob.checked_add(u32_at(h, 0x1c)?)?; + let tail = u32_at(h, 0x30)?; + let prefix = metadata_end.checked_sub(tail)?; + let split = u32_at(h, 8)?; + if prefix < blob || split < metadata_end || split > h.len() { + return None; + } + let mut iv = cipher.header_iv(); + cipher.decrypt_cbc(0x10000001, h.get_mut(64..blob)?, &mut iv)?; + cipher.decrypt_cbc(0x10000001, h.get_mut(blob..prefix)?, &mut iv)?; + let descriptor = (0..count).find_map(|i| { + let at = 64 + i * 8; + (u16_at(h, at)? == 1).then(|| blob.checked_add(u32_at(h, at + 4)?)).flatten() + })?; + let key = u32_at(h, descriptor)? as u32; + if u16_at(h, descriptor + 4)? != 16 { + return None; + } + let initial: [u8; 16] = h.get(descriptor + 6..descriptor + 22)?.try_into().ok()?; + let mut iv = initial; + cipher.decrypt_cbc(key, h.get_mut(prefix..split)?, &mut iv)?; + let mut iv = initial; + cipher.decrypt_cbc(key, h.get_mut(split..)?, &mut iv)?; + Some(()) +} + +impl NativeArchive { + pub fn open(path: &Path, base: u64, extent: u64, materials: Arc) -> Result { + let mut file = File::open(path).map_err(|e| e.to_string())?; + file.seek(SeekFrom::Start(base)).map_err(|e| e.to_string())?; + let mut head = [0u8; 64]; + file.read_exact(&mut head).map_err(|e| e.to_string())?; + let len = u32_at(&head, 4).ok_or("short header")?; + if !(64..=64 << 20).contains(&len) || len as u64 > extent { + return Err("native header extent is outside the archive".into()); + } + let mut bytes = vec![0u8; len]; + bytes[..64].copy_from_slice(&head); + file.read_exact(&mut bytes[64..]).map_err(|e| e.to_string())?; + decode_header(&materials.cipher, &mut bytes).ok_or("unsupported or damaged native header transform")?; + let catalog = Catalog::parse(bytes, extent)?; + let mut archive = + Self { catalog, materials, paths: Vec::new(), by_path: HashMap::new(), sniffed: HashMap::new() }; + archive.name_entries(&HashMap::new()); + Ok(archive) + } + + /// The archive at `base` in a file, with the names its own files tell. + /// The last few opened ones are kept. + pub fn cached(path: &Path, base: u64, extent: u64) -> Option> { + let key = (path.to_path_buf(), base, extent, std::fs::metadata(path).and_then(|m| m.modified()).ok()); + if let Some((_, found)) = OPENED.lock().ok()?.iter().find(|(k, _)| *k == key) { + return Some(Arc::clone(found)); + } + let mut archive = Self::open(path, base, extent, materials(path)?).ok()?; + let learned = archive.learn_names(path, base); + archive.sniffed = archive.sniff(path, base); + archive.name_entries(&learned); + let mut guessed = archive.guess_names(); + if !guessed.is_empty() { + guessed.extend(learned); + archive.name_entries(&guessed); + } + let archive = Arc::new(archive); + let mut opened = OPENED.lock().ok()?; + if opened.len() >= KEPT { + opened.remove(0); + } + opened.push((key, Arc::clone(&archive))); + Some(archive) + } + + /// Gives the entries their paths: names by slot, then the known ones. + fn name_entries(&mut self, learned: &HashMap) { + let shared = LEARNED.read().unwrap_or_else(|e| e.into_inner()); + self.paths = Vec::with_capacity(self.catalog.entries.len()); + self.by_path = HashMap::with_capacity(self.catalog.entries.len()); + for entry in &self.catalog.entries { + let name = learned + .get(&entry.slot) + .cloned() + .or_else(|| { + let hash = entry.name_hash64?; + self.materials.names.find(hash, entry.name_hash32, entry.type_id) + }) + .or_else(|| { + // Archives keep the place they were found at. + let hash = entry.name_hash64.filter(|_| entry.type_id != 0)?; + Some(rpf9_names::with_type(shared.as_ref()?.get(&hash)?, entry.type_id)) + }) + .filter(|name| !self.by_path.contains_key(&name.to_ascii_lowercase())); + let path = name.unwrap_or_else(|| { + let sniffed = self.sniffed.get(&entry.slot).cloned(); + let ext = sniffed.unwrap_or_else(|| rpf9_names::type_extension(entry.type_id)); + format!("{UNNAMED}/{:06}_{:016x}.{ext}", entry.slot, entry.name_hash64.unwrap_or(0)) + }); + self.by_path.insert(path.to_ascii_lowercase(), entry.slot); + self.paths.push(path); + } + } + + fn unnamed(&self) -> impl Iterator { + self.catalog.entries.iter().filter(|e| self.is_unnamed(e)) + } + + /// Whether an entry is listed by its slot, as its name is not known. + pub fn is_unnamed(&self, entry: &NativeEntry) -> bool { + self.paths[entry.slot].strip_prefix(UNNAMED).is_some_and(|rest| rest.starts_with('/')) + } + + /// Names of unnamed entries that follow from a pattern or from the names + /// of others in the archive; checked against the hashes in the table. + fn guess_names(&self) -> HashMap { + let mut wanted: HashMap> = HashMap::new(); + let mut types = BTreeSet::new(); + for e in self.unnamed() { + if let Some(hash) = e.name_hash64 { + wanted.entry(hash).or_default().push(e); + types.insert(e.type_id); + } + } + let matching = |name: &str, found: &mut Vec<(usize, String)>| { + for e in wanted.get(&rpf9_names::hash64(name.as_bytes())).into_iter().flatten() { + if e.name_hash32.is_none_or(|hash| hash == rpf9_names::hash32(name.as_bytes())) { + found.push((e.slot, rpf9_names::with_type(name, e.type_id))); + } + } + }; + let mut found: Vec<(usize, String)> = types + .into_par_iter() + .flat_map(|type_id| (0..rpf9_names::GRID_PARTS).into_par_iter().map(move |part| (type_id, part))) + .flat_map_iter(|(type_id, part)| { + let mut found = Vec::new(); + rpf9_names::numbered(type_id, part, &mut |name| matching(name, &mut found)); + found + }) + .collect(); + if !wanted.is_empty() { + found.par_extend(self.paths.par_iter().flat_map_iter(|path| { + let mut found = Vec::new(); + let stem = path.rsplit_once('.').map_or(path.as_str(), |(stem, _)| stem); + rpf9_names::related(stem, &mut |name| matching(name, &mut found)); + found + })); + } + found.into_iter().collect() + } + + /// The extensions of unnamed entries without a type, by how they start. + fn sniff(&self, path: &Path, base: u64) -> HashMap { + /// Takes the first bytes, then ends the unpacking. + struct Head(Vec); + impl Write for Head { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + if self.0.len() >= 16 { + return Err(std::io::ErrorKind::WriteZero.into()); + } + let n = buf.len().min(16 - self.0.len()); + self.0.extend_from_slice(&buf[..n]); + Ok(n) + } + fn flush(&mut self) -> std::io::Result<()> { + Ok(()) + } + } + let unnamed: Vec<&NativeEntry> = self.unnamed().filter(|e| e.type_id == u8::MAX).collect(); + unnamed + .into_par_iter() + .filter_map(|e| { + let mut head = Head(Vec::new()); + // Fails when the head is full, which is fine. + let _ = self.copy_to(path, base, e, &mut head); + Some((e.slot, crate::rpf9::extension_of(&head.0)?)) + }) + .collect() + } + + /// Names of unnamed entries, found in their own data: models, clip + /// dictionaries and some others hold their name. What is found is + /// checked against the hash in the table. + fn learn_names(&self, path: &Path, base: u64) -> HashMap { + let candidates: Vec<&NativeEntry> = + self.unnamed().filter(|e| SELF_NAMED.contains(&e.type_id) && e.size <= LEARN_MAX).collect(); + candidates + .into_par_iter() + .filter_map(|e| { + let wanted = e.name_hash64?; + let mut data = Vec::new(); + self.copy_to(path, base, e, &mut data).ok()?; + let mut names = rpf9_names::Dictionary::default(); + rpf9_names::tokens(&data).iter().for_each(|text| names.add(text)); + Some((e.slot, names.find(wanted, e.name_hash32, e.type_id)?)) + }) + .collect() + } + + /// The slot with this path (case-insensitive). + pub fn find(&self, path: &str) -> Option { + let path = path.to_ascii_lowercase(); + self.by_path.get(&path).copied().or_else(|| { + // Its name was learned since: the stand-in has the slot and the hash. + let (slot, rest) = path.strip_prefix(UNNAMED)?.strip_prefix('/')?.split_once('_')?; + let hash = u64::from_str_radix(rest.get(..16)?, 16).ok()?; + let slot: usize = slot.parse().ok()?; + self.catalog.entries.get(slot).filter(|e| e.slot == slot && e.name_hash64 == Some(hash)).map(|e| e.slot) + }) + } + + /// The path-like strings in an archive's own files. + fn strings(path: &Path, materials: &Arc) -> Result, String> { + let size = std::fs::metadata(path).map_err(|e| e.to_string())?.len(); + let archive = Self::open(path, 0, size, Arc::clone(materials))?; + let mut found: Vec = archive + .catalog + .entries + .par_iter() + .filter(|e| e.type_id != 0 && e.size <= STRINGS_MAX) + .flat_map_iter(|e| { + let mut data = Vec::new(); + let read = archive.copy_to(path, 0, e, &mut data); + if read.is_ok() { rpf9_names::tokens(&data) } else { Vec::new() } + }) + .collect(); + found.par_sort_unstable(); + found.dedup(); + Ok(found) + } + + /// Writes a member's decoded bytes to `out` and returns their number. A + /// resource comes out as its system part followed by its graphics part. + pub fn copy_to(&self, path: &Path, base: u64, entry: &NativeEntry, out: &mut dyn Write) -> Result { + let file = File::open(path).map_err(|e| e.to_string())?; + // A resource starts with a clear 16-byte prefix; the encryption + // pattern and the chunks count from its end. + let resource = matches!(entry.storage, Storage::Resource { .. }); + let prefix = if resource { RESOURCE_PREFIX } else { 0 }; + let start = base.checked_add(entry.offset).and_then(|v| v.checked_add(prefix)).ok_or("offset overflow")?; + let len = if entry.stored == 0 { + 0 + } else { + entry.stored.checked_sub(prefix).ok_or("a resource is shorter than its prefix")? + }; + let cipher = match self.catalog.record(entry.slot, ENCRYPTION) { + Some(record) => Some((&self.materials.cipher, Encryption::parse(record, len)?)), + None => None, + }; + let mut member = Member { file, start, len, at: 0, cipher }; + if let Some(chunks) = self.catalog.chunks(entry.slot)? { + return copy_chunks(&mut member, &chunks, entry.size, out); + } + let written = match entry.layout { + 0 if !resource && entry.size <= len => { + std::io::copy(&mut (&mut member).take(entry.size), out).map_err(|e| e.to_string())? + } + // One raw DEFLATE stream. + 1 if !resource => { + let mut inflate = flate2::bufread::DeflateDecoder::new(BufReader::with_capacity(1 << 16, member)); + // One byte more shows a stream longer than declared. + std::io::copy(&mut (&mut inflate).take(entry.size.saturating_add(1)), out).map_err(|e| e.to_string())? + } + layout => return Err(format!("storage layout {layout} is not supported")), + }; + if written == entry.size { Ok(written) } else { Err("decoded size differs from the index".into()) } + } +} + +/// Where entries without a known name are listed. +const UNNAMED: &str = "entries"; +/// Types whose files hold their own name: drawables, fragments, drawable +/// dictionaries, and registered ones where this was seen in the game's data. +const SELF_NAMED: [u8; 10] = [2, 3, 4, 66, 67, 69, 70, 72, 102, 109]; +/// Larger members are not searched for their own name. +const LEARN_MAX: u64 = 8 << 20; +/// Opened archives to keep. +const KEPT: usize = 192; +/// Larger members are not searched for names of others. +const STRINGS_MAX: u64 = 64 << 20; + +/// Clear bytes in front of a resource's chunks. +const RESOURCE_PREFIX: u64 = 16; + +/// Which bytes of a member are encrypted, and with what. Members are often +/// encrypted only in part: `head` bytes, then from there on `run` bytes of +/// every `run + gap`, and `tail` bytes at the end. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +struct Encryption { + key: u32, + iv: [u8; 16], + head: u64, + run: u64, + gap: u64, + tail_start: u64, +} + +impl Encryption { + fn parse(record: &[u8], len: u64) -> Result { + let word = |at: usize| u32_at(record, at).map(|v| v as u64).ok_or("short encryption record"); + if u16_at(record, 4) != Some(17) { + return Err("unsupported encryption algorithm".into()); + } + let iv = record.get(6..22).and_then(|iv| iv.try_into().ok()).ok_or("short encryption record")?; + let (head, run, gap, tail) = (word(24)?, word(32)?, word(40)?, word(48)?); + if [head, run, gap, tail].iter().any(|v| v % 16 != 0) { + return Err("unaligned encryption pattern".into()); + } + Ok(Self { key: word(0)? as u32, iv, head, run, gap, tail_start: len.saturating_sub(tail) }) + } + + /// Whether the byte at `at` is encrypted, and where that may change next. + fn span(&self, at: u64) -> (bool, u64) { + if at < self.head { + return (true, self.head); + } + if at >= self.tail_start { + return (true, u64::MAX); + } + let period = self.run + self.gap; + if period == 0 { + return (false, self.tail_start); + } + let within = (at - self.head) % period; + let (encrypted, left) = if within < self.run { (true, self.run - within) } else { (false, period - within) }; + (encrypted, at.saturating_add(left).min(self.tail_start)) + } +} + +/// A member's stored bytes, decrypted. +struct Member<'a> { + file: File, + start: u64, + len: u64, + at: u64, + cipher: Option<(&'a Cipher, Encryption)>, +} + +impl Read for Member<'_> { + fn read(&mut self, buf: &mut [u8]) -> std::io::Result { + let mut want = (self.len - self.at).min(buf.len() as u64); + if want == 0 { + return Ok(0); + } + let span = self.cipher.as_ref().map(|(_, e)| e.span(self.at)); + if let Some((_, end)) = span { + want = want.min(end - self.at); + } + self.file.seek(SeekFrom::Start(self.start + self.at))?; + let n = self.file.read(&mut buf[..want as usize])?; + if let (Some((cipher, e)), Some((true, _))) = (&self.cipher, span) { + cipher + .crypt_ctr(e.key, &mut buf[..n], &e.iv, self.at) + .ok_or_else(|| std::io::Error::other("no key for this member"))?; + } + self.at += n as u64; + Ok(n) + } +} + +fn copy_chunks(member: &mut Member, chunks: &[Chunk], size: u64, out: &mut dyn Write) -> Result { + if chunks.iter().try_fold(0u64, |sum, c| sum.checked_add(c.size)) != Some(size) { + return Err("chunk sizes do not add up to the member size".into()); + } + for chunk in chunks { + if chunk.offset.checked_add(chunk.stored).is_none_or(|end| end > member.len) { + return Err("a chunk lies outside its member".into()); + } + member.at = chunk.offset; + let mut stored = member.by_ref().take(chunk.stored); + let written = if chunk.zlib { + let mut inflate = flate2::bufread::ZlibDecoder::new(BufReader::with_capacity(1 << 16, stored)); + // One byte more shows a stream longer than declared, and reading + // to the end checks the stream's checksum. + std::io::copy(&mut (&mut inflate).take(chunk.size + 1), out) + } else { + std::io::copy(&mut stored, out) + } + .map_err(|e| e.to_string())?; + if written != chunk.size { + return Err("a chunk's decoded size differs from the index".into()); + } + } + Ok(size) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn encryption_patterns_name_the_encrypted_spans() { + let mut record = [0u8; 64]; + record[4] = 17; + for (at, v) in [(24, 0x400u32), (32, 0x400), (40, 0x1c00)] { + record[at..at + 4].copy_from_slice(&v.to_le_bytes()); + } + let e = Encryption::parse(&record, 0x10000).unwrap(); + assert_eq!(e.span(0), (true, 0x400)); + assert_eq!(e.span(0x400), (true, 0x800)); + assert_eq!(e.span(0x800), (false, 0x2400)); + assert_eq!(e.span(0x2410), (true, 0x2800)); + assert!(e.span(0xffff).0 == ((0xffff - 0x400) % 0x2000 < 0x400)); + record[48..52].copy_from_slice(&0x1000u32.to_le_bytes()); + let e = Encryption::parse(&record, 0x10000).unwrap(); + assert_eq!(e.span(0xf000), (true, u64::MAX)); + // Without a gap everything is encrypted. + record[24..28].fill(0); + record[40..44].fill(0); + let e = Encryption::parse(&record, 0x10000).unwrap(); + assert!((0..0x10000).step_by(0x100).all(|at| e.span(at).0)); + record[4] = 16; + assert!(Encryption::parse(&record, 0x10000).is_err()); + assert!(Encryption::parse(&record[..30], 0x10000).is_err()); + } +} diff --git a/crates/rage-rpf/src/vfs.rs b/crates/rage-rpf/src/vfs.rs index 315c68a..678b5f1 100644 --- a/crates/rage-rpf/src/vfs.rs +++ b/crates/rage-rpf/src/vfs.rs @@ -11,7 +11,7 @@ use rage_crypto::GtaVKeys; #[cfg(feature = "rdr2")] use crate::Rpf8; -use crate::{EntryId, Gta4Archive, Gta4EntryId, Rpf7, RpfError}; +use crate::{EntryId, Gta4Archive, Gta4EntryId, Rpf7, Rpf9, RpfError}; /// What a virtual path points to. More variants appear with crate features /// (`rdr2`), so matches need a fallback arm. @@ -37,6 +37,10 @@ pub enum Node { Gta4Dir(Arc, Gta4EntryId), /// A file inside a GTA IV archive. Gta4File(Arc, Gta4EntryId), + /// A folder of a GTA VI archive ("" for its top). + Rpf9Dir(Arc, String), + /// A file of a GTA VI archive (index into its entries). + Rpf9File(Arc, usize), } fn is_rpf(name: &str) -> bool { @@ -69,6 +73,10 @@ pub fn resolve(root: &Path, vpath: &str, keys: Option>) -> Result< let rest: Vec = components.collect(); return resolve_rpf8(Arc::new(Rpf8::open_default(&next)?), &rest, vpath); } + if Rpf9::file_is_rpf9(&next) { + let rest: Vec = components.collect(); + return resolve_rpf9(Arc::new(Rpf9::open(&next)?), &rest, vpath); + } archive = Some(Arc::new(Rpf7::open(&next, keys.clone())?)); break; } @@ -129,6 +137,41 @@ fn resolve_rpf8(mut archive: Arc, rest: &[String], vpath: &str) -> Result< Ok(Node::Rpf8Dir(archive, dir)) } +/// Walks the rest of a path inside a GTA VI archive; nested archives are +/// entered. The archive itself resolves without its entries; anything below +/// needs them, which scans the archive if its own table cannot be read and no +/// index is at hand. +fn resolve_rpf9(mut archive: Arc, rest: &[String], vpath: &str) -> Result { + if rest.is_empty() { + return Ok(Node::Rpf9Dir(archive, String::new())); + } + let mut dir = String::new(); + for (n, comp) in rest.iter().enumerate() { + if !dir.is_empty() { + dir.push('/'); + } + dir.push_str(comp); + // Only the last component and archives on the way are entries. + if n + 1 < rest.len() && !is_rpf(comp) { + continue; + } + let entries = archive.entries()?; + let Some(i) = archive.find(&entries, &dir) else { continue }; + if archive.is_archive(&entries[i]) { + archive = Arc::new(archive.open_child(&entries[i])?); + dir.clear(); + } else if n + 1 == rest.len() { + return Ok(Node::Rpf9File(archive, i)); + } else { + return Err(RpfError::NotFound(vpath.to_owned())); + } + } + if archive.is_dir(&archive.entries()?, &dir) { + return Ok(Node::Rpf9Dir(archive, dir.to_ascii_lowercase())); + } + Err(RpfError::NotFound(vpath.to_owned())) +} + /// Walks the rest of a path inside a GTA IV archive. fn resolve_gta4(archive: Arc, rest: &[String], vpath: &str) -> Result { let mut cur = Gta4Archive::ROOT; diff --git a/docs/publishing.md b/docs/publishing.md index fba6895..89087a2 100644 --- a/docs/publishing.md +++ b/docs/publishing.md @@ -16,7 +16,7 @@ Each prepared crate has its own `README.md`, a `LICENSE` (a link to the workspace licence; `cargo package` copies the file), and, where code is derived from CodeWalker, a `NOTICE.md` with the MIT notice. -Workspace path dependencies carry `version = "0.5.0"`, so crates.io resolves +Workspace path dependencies carry `version = "0.6.0"`, so crates.io resolves them once the dependency is published. `cargo package` of a crate that depends on an unpublished workspace crate fails at "no matching package"; publish bottom-up (`rage-core`, `rage-crypto`, `rage-resource`, `rage-tfit2`, @@ -70,7 +70,7 @@ every caller in the CLI and GUI; that is left for later. * **Crate names.** `rage-*` names may be taken or confusing on crates.io; check availability (`cargo search rage-core`) or pick a prefix. -* **Version.** The crates share the workspace version (0.5.0). Independent +* **Version.** The crates share the workspace version (0.6.0). Independent versions per crate (and a 0.1.0 start) are an option. * **MSRV.** `rust-version = "1.99"` is the pinned toolchain, the only one checked. A lower MSRV (edition 2024 needs at least 1.85; the code uses diff --git a/docs/rpf9-name-hashes.md b/docs/rpf9-name-hashes.md new file mode 100644 index 0000000..49150c0 --- /dev/null +++ b/docs/rpf9-name-hashes.md @@ -0,0 +1,112 @@ +# Scarlett native name lookup + +The target is the executable identified in [rpf9-scarlett.md](rpf9-scarlett.md). +These observations use offline GNU objdump disassembly, original-file byte +reads, and isolated calls to three pure hash leaves in private mapped memory. +They are not observations of the running game. No original game file was +written, and no executable entry point or initialization code was called. + +## Lookup observations + +The function at `0x145305880` accepts a device and path string. It checks a +normalized prefix hash against device offset `0x70`, using a prefix length +from `0x78`, and then hashes the relative suffix. The suffix's last dot +selects an extension through `0x14056ee50`. A recognized extension is omitted +from the string hash and retained as a separate type. An unrecognized +extension remains part of the hashed string. + +The path lookup eventually compares typed 32-bit or 64-bit hashes, through +`0x14056ec70` and `0x14056f130`. The getters reveal the index descriptor IDs: + +| Getter | Descriptor type hash | Value | +| --- | --- | --- | +| `0x145305ee0` | `0xb7076b6245d35fb5` | u32 name hash | +| `0x145520ac0` | `0x73bcb72dce74f11f` | u64 name hash | + +These lookup paths do not compare original filename strings. Decrypting the +index therefore does not by itself reverse these hashes into all original +paths. Candidate names can be checked against the hash and type; original +spelling and case are separate unknowns. This bounded lookup inspection does +not establish that no other archive structure or metadata contains names. + +## Hash leaves and comparison + +The native normalization table at `0x1465b23b0` changes only ASCII `A`–`Z` +to `a`–`z` and backslash to slash. All other byte values are unchanged. + +| Leaf address | Algorithm | +| --- | --- | +| `0x144fc21d0` | Jenkins one-at-a-time over normalized bytes; seed zero at this caller | +| `0x144f66de0` | Normalized MurmurHash3 x64-128, seed zero, returning h1 | +| `0x144f67220` | Raw MurmurHash3 x64-128, seed zero, returning h1 | + +The two Murmur leaves XOR only the low byte of the string length into the +final states. This differs from ordinary MurmurHash3 for lengths >= 256. +The Jenkins leaf has a C-string quote rule: if the first byte is a double +quote it skips that byte and stops at the next quote or NUL. Murmur has no +such quote rule. Every leaf stops at the first NUL. + +The native 64-bit wrapper `0x144f66800` chooses a registered function pointer +at `registry + mode * 0x58 + 0x28`. Static initialization at `0x145c35461` +loads the registry pointer, puts the raw leaf at offset `0x28`, and puts the +normalized leaf at offset `0x80` (`0x145c35491`). Thus the inspected +initialization configures mode 0 as raw and mode 1 as normalized. The native +path lookup selects mode 1. This is static initialization evidence, not a +recording of the running game's registration state. + +A small Linux C harness mapped PE sections privately at the preferred image +base, replaced the imported `strlen` trampoline in that private copy with +a local Microsoft-ABI `strlen` stub, and called only the three leaf addresses. +A separately written Python algorithm matched all 354 results for 118 +synthetic inputs: empty/quoted/path strings and deterministic strings with +lengths 1–99, 127–129, 254–257, 511–513 and 1023–1024. An additional six +synthetic repeated-character vectors covered 15/16/17 and 255/256/257 bytes. +The Rust implementation also matched all 354 native outputs for the same +118 synthetic strings. The Rust tests retain selected synthetic inputs and numeric outputs, without +executable code, game data, normalization-table bytes, or keys. + +## Static extension types + +The built-in dispatcher compares `rpf` with type 0 and has three alias +families, with prefixes `z`, `i`, and `#`: + +| Type | Suffix after the family prefix | +| ---: | --- | +| 1 | mf | +| 2 | dr | +| 3 | ft | +| 4 | dd | +| 5 | td | +| 6 | bn | +| 7 | bd | +| 8 | pd | +| 9 | bs | +| 10 | sd | +| 11 | mt | +| 12 | sc | +| 13 | cs | +| 14 | datb | +| 15 | bdr | +| 16 | bdd | +| 17 | bft | +| 18 | vert | + +The dispatcher uses the imported C `strcmp` and can consult additional +registered callbacks. The registered types are numbered from 64 in the order +of three more pointer tables of 52 strings each, before VA `0x14618dec0` (the +`#` family; the `z` and `i` families precede it): `mrf`, `cut`, `gfx`, `#cd`, +`#ld`, … `#cov`. The numbers agree with the content of the archives (66 +Scaleform, 67 clips, 72 particles, 79 navigation meshes, 89 scripts). `y`-prefixed GTA V extensions are not assumed to be +aliases. The Rust candidate helper lowercases extensions before matching as +an explicit candidate-generation convention, rather than claiming that the +native `strcmp` itself ignores case. + +## Candidate collection + +The executable scanner accepts NUL-terminated ASCII strings of 3–1024 bytes +containing a slash or a recognized static resource/media extension. It +normalizes slash direction and removes literal `mount:/` prefixes, consistent +with the inspected device suffix lookup. It synthesizes no directory or +extension guesses. Absolute paths, traversal, invalid filename characters +and format placeholders are rejected. The result is candidate text, never a +verified original name until its hashes and type match a catalog entry. diff --git a/docs/rpf9-scarlett.md b/docs/rpf9-scarlett.md new file mode 100644 index 0000000..020ee2b --- /dev/null +++ b/docs/rpf9-scarlett.md @@ -0,0 +1,139 @@ +# Scarlett RPF9 header observations + +These are static observations of a user-supplied x86-64 PE file, inspected with +GNU `objdump` and a Python byte reader. The executable was read as data and was +not run. No game code, game bytes, cipher tables, or keys are included here. + +Executable: `game_scarlett_master.exe`, 120,181,760 bytes. + +SHA-256: `e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993`. Addresses below are virtual addresses at image base +`0x140000000`. In this build's `.text`, file offset = VA - image base - `0xc00`. +The addresses are build-specific research references, not stable APIs. + +REA CLI 6.8.0 was available, but its doctor reported no configured native +decompiler engine (Ghidra, IDA, Hopper, or Kuna). The following native findings +therefore come from ordinary offline disassembly, not REA decompilation or +runtime evidence. + +## Clear header fields + +| Offset | Width | Observation | +| --- | --- | --- | +| `0x00` | u32 | Magic `0x52504639` | +| `0x04` | u32 | Full header extent used by loader mode 0; recovery data start | +| `0x08` | u32 | Initial header extent used by loader mode 1; the remaining header span is loaded separately | +| `0x24` | u32 | Declared entry/record count; used in layout size arithmetic | +| `0x2e` | u8 | Initial header transform selector; zero skips this transform | + +All integer fields above are little-endian. The count is a declaration; +reading it does not validate or decode the entry table. A nonzero transform +selector does not establish that every payload is encrypted. + +The loader at `0x141fb2600` reads 16 bytes and checks the magic +(`0x141fb268e`). At `0x141fb269e` it converts the caller's mode into an index +of zero or one and reads `[header + 4 + index * 4]` at `0x141fb26a7`. It +allocates that extent and reads the remainder after the initial 16 bytes. +For mode 1, `0x141fb26ec` loads the value at `+4`, `0x141fb26f1` loads `+8`, +and `0x141fb26ff` subtracts the latter from the former. The resulting byte +count is read at archive-relative offset `+8` (`0x141fb2730`–`0x141fb2744`). +Thus `+8` is a split boundary inside the header, not the archive data start. + +The layout builder at `0x14087af70` reads `+0x24` into `r10d` +(`0x14087af9a`) and passes it to `0x14087aff0`. The latter computes successive +table ranges, including `count * 24` (`0x14087b05c`, `0x14087b06d`) and +`(count - subcount) * stride * alignment` (`0x14087b07a`–`0x14087b083`). +This supports exposing the raw count as declared entries, without claiming +those entries have been recovered. + +The transform dispatcher at `0x140a348a0` reads byte `+0x2e` +(`0x140a348ae`), tests it through `0x140b85020` (a nonzero test), then +selects a family with `selector >> 1` (`0x140a348c0`). Selector zero takes +the success return without a transform. A nonzero selector's low bit +selects one combined span or two spans (`0x140a348d3`–`0x140a34962`). +Every root sample below has selector 9. + +## Root archive sample inventory + +Only the first 64 bytes and the full declared header were read for this +inventory. Hashes below identify the **stored full header**, not the complete +archive or its payload. All twelve root archives were sampled. + +| Archive | File bytes | +4 | +8 | Declared entries | Selector | Stored header SHA-256 | +| --- | ---: | ---: | ---: | ---: | ---: | --- | +| `anim.rpf` | 4407626384 | 18016 | 15360 | 265 | 9 | `4d9c1d570f50458508172613902a3075b033e907914c943fddc903d877cce7b2` | +| `appdata0.rpf` | 8880 | 864 | 832 | 2 | 9 | `fdbfc25bd0c41027e9d69d4324291f997db29d39c9513a8f72a512c4113fe95c` | +| `audio.rpf` | 28543454672 | 4944 | 4016 | 103 | 9 | `833969e3c6f13247f9da028653618b7df7733e5e7e51ddb889ffb9293121213a` | +| `common.rpf` | 6642192 | 38272 | 34080 | 418 | 9 | `c00636117394cf649c86c5cb90c1e067132d3d16ef2c66029a517c40c8ba2260` | +| `data.rpf` | 481544304 | 69728 | 62736 | 699 | 9 | `294db409d725a280ca510afe9b41afc40e4c35095545c9f1025976739eda7f42` | +| `levels.rpf` | 76155065056 | 110704 | 89920 | 2078 | 9 | `c34165af2bd74fce0f94ec36973e67796205e73fd36b67bcc79f595fe4b86a57` | +| `movies.rpf` | 8832481776 | 27328 | 22176 | 515 | 9 | `7601da37efd4c06dfc820fe0fc2662ce1e6a2a83515cb066e40eb750cb40ba59` | +| `navmeshes.rpf` | 6707512496 | 1920 | 1648 | 29 | 9 | `fccaa6261127a1628762fe6678e63920d218bedec78c81ecb1b794ef14094290` | +| `packs.rpf` | 4798213264 | 17744 | 16192 | 172 | 9 | `cf37936da5693d17c31445ae0c8f825d645f929433d45d87f7c548bd41722890` | +| `script.rpf` | 4358960 | 608 | 576 | 2 | 9 | `6739bfa0ed3f2ca735db2d7b6b5c5dddfdb0c6d844c27ddbf921eebd57513f1b` | +| `shaders.rpf` | 411695600 | 34368 | 34336 | 3 | 9 | `15f896951d3608eb45ca446c9d8198513076c0c9f2c3dd79981af8eb083a9af1` | +| `textures.rpf` | 192585024 | 1936 | 1728 | 22 | 9 | `d730f6a42de5474a7d9d490c672d4a2c0e35409a238508caf0943fdc660052e9` | + +## Members + +With the header decoded, a member is described by one payload record (raw, +chunked or resource) and optional encryption and chunk records. + +An encryption record is 64 bytes: u32 key, u16 algorithm (17: counter mode +with a big-endian 16-byte counter), the initial counter at `+6`, and a +pattern of byte counts: `+24` head, `+32` run, `+40` gap, `+48` tail. The +head is encrypted, then `run` bytes of every `run + gap`, then the tail. The +counter follows the position in the member, encrypted or not. The usual +pattern (`0x400`, `0x400`, `0x1c00`) encrypts the first 2 KiB and 1 KiB of +every 8 KiB after. The tail field was seen in one resource only. + +A resource starts with a clear 16-byte prefix. The encryption pattern and the +chunks count from its end. Decoded, the system part is followed by the +graphics part. + +A chunk record is 8 bytes: u32 start of the list *counted from the record*, +u16 number of chunks, u8 item size (8), u8 format. Members with lists at the +same distance share records. Items, with codec 0 (stored) or 3 (zlib): + +| Format | Decoded size | Stored size | Offset | Codec | +| ---: | --- | --- | --- | --- | +| 2 | u32 × 16 | bits 32–57 × 16, less padding in bits 58–61 | follows | bits 62–63 | +| 3 | 65536 − bits 0–15 | 65536 − bits 16–31 | bits 32–59 × 16 | bits 60–63 | +| 4 | bits 0–23 | bits 24–47, less padding in bits 52–55 | follows | bits 56–63 | + +A chunk that follows another starts on the next multiple of 16. Members +without a chunk record are stored as they are (layout 0) or as one raw +DEFLATE stream (layout 1). + +All members of the archives above up to 256 MiB, and all members of the +archives inside them, were decoded with this: 790,347 members, with the zlib +checksums and every decoded length matching. + +## Names + +The table holds only hashes, of paths relative to the archive without the +extensions that have a type number. Names come from path strings in the +executable and in the files of `common.rpf` and `data.rpf`, checked against +the hashes. They cover most top-level files. Inside nested archives, drawables, fragments, +clip dictionaries and some other types hold their own name, which is checked +against the hash the same way (over 99% of drawables and fragments in a sample +of 1,826 archives). Some names follow a pattern: navigation meshes +(`navmesh[204][293]`), cover (`coverregion[199][257]`), height and surface +tiles, the terrain's collisions (`s09_w04_55`) and variants of other files +(`_hi`, `+hi`, `_lod`). Files without a name are listed as +`entries/_`. + +## Remaining work + +Names of the other types inside nested archives (most textures, maps and the +collisions of buildings) and of the audio archives, signature checks and archive writing. + +## Local recovery validation + +The updated CLI was built and tested against the local `common.rpf` above. +`info` reported 418 declared native slots and transform tag `0x09` without +scanning the archive. `verify common.rpf` recovered and decoded 277 entries +(47.9 MiB unpacked), with zero read/checksum/length errors. A recursive JSON +listing contained the same 277 entries. Extracting its recovery `xml` folder +wrote 259 files (40.6 MiB) with zero failures, into a temporary output folder. +These checks validate the recovery path only; 277 streams must not be +interpreted as 277 of the 418 native slots. No original archive was changed. diff --git a/site/config.toml b/site/config.toml index 768c628..06ef97d 100644 --- a/site/config.toml +++ b/site/config.toml @@ -40,7 +40,7 @@ pages = [ [[extra.docs]] title = "Games" -pages = [["gta-iv.md", "GTA IV"], ["rdr2.md", "Red Dead Redemption 2"]] +pages = [["gta-vi.md", "GTA VI"], ["gta-iv.md", "GTA IV"], ["rdr2.md", "Red Dead Redemption 2"]] [[extra.docs]] title = "Develop" diff --git a/site/content/_index.md b/site/content/_index.md index 99e6500..0165df1 100644 --- a/site/content/_index.md +++ b/site/content/_index.md @@ -22,9 +22,9 @@ It contains **no game files and no encryption keys**: keys are taken from your o features_title = "Highlights" features_intro = "What OpenRAGE can open, show and change today." screenshots_title = "Screenshots" -screenshots_intro = "Click a picture to enlarge it, arrow keys browse. The screenshots show files from the author's own copy of the game." +screenshots_intro = "Click a picture to enlarge it, arrow keys browse." games_title = "Supported games" -games_intro = "GTA V comes first and Red Dead Redemption 2 can be explored. **GTA VI is next:** support follows as fast as possible once it comes to PC. GTA IV can be explored and modded too: archives, textures, models, collisions, animations, texts, maps in 3D and whole cutscenes." +games_intro = "GTA V comes first and Red Dead Redemption 2 can be explored. GTA VI can be explored (read-only preview). GTA IV can be explored and modded too: archives, textures, models, collisions, animations, texts, maps in 3D and whole cutscenes." details_summary = "Checked against the whole game" download_intro = "Unpack the archive and run `openrage-gui` (or `openrage` for the command line). On first start the GUI detects your game and sets up the keys." why_title = "Why switch from OpenIV" @@ -36,6 +36,12 @@ Out of date? [Open an issue](https://github.com/Two-Play/openrage/issues). """ +# A short section that points to the GTA VI page (content/gta-vi.md). +[extra.gta6] +title = "GTA VI" +text = "OpenRAGE opens GTA VI's archives: the map in 3D, models, textures, animations, sounds and videos. A read-only preview, with your own copy of the game." +link_text = "What works in GTA VI" + [extra.hero] light = "overview-light.png" dark = "overview-dark.png" @@ -167,9 +173,11 @@ formats = "textures, models (viewer, glTF export), texts, metadata, audio and an [[extra.games]] name = "GTA VI" -archives_status = "planned" -archives = "as fast as possible once GTA VI comes to PC" -formats_status = "none" +variant = "preview" +archives_status = "partial" +archives = "RPF9 read, incl. nested archives, with your own copy of the game (Xbox Series build)" +formats_status = "partial" +formats = "models, animations, textures, maps in 3D, collisions, navigation meshes, metadata, game text, audio and videos (read-only)" [[extra.games]] name = "GTA IV" @@ -194,7 +202,7 @@ text = "Native on both, Steam and Proton installs included." [[extra.reasons]] icon = "🛠️" title = "Actively developed" -text = "Supports GTA V Enhanced, GTA VI follows as fast as possible. OpenIV's last release, 4.1, is from January 2022." +text = "Supports GTA V Enhanced, GTA VI can be explored. OpenIV's last release, 4.1, is from January 2022." [[extra.reasons]] icon = "↩️" @@ -245,7 +253,7 @@ edge = "openrage" [[extra.compare]] feature = "Other games" openiv = "GTA IV, EFLC, Max Payne 3" -openrage = "RDR2 archives, textures, models, texts, metadata, audio and animations; GTA IV archives, textures, models, texts, placements and cutscenes; GTA VI as soon as it is on PC" +openrage = "RDR2 archives, textures, models, texts, metadata, audio and animations; GTA IV archives, textures, models, texts, placements and cutscenes; GTA VI read-only (preview)" edge = "openiv" [[extra.compare]] diff --git a/site/content/cli.md b/site/content/cli.md index a4bb7b4..ac06335 100644 --- a/site/content/cli.md +++ b/site/content/cli.md @@ -80,6 +80,7 @@ openrage model …/adder.yft --render adder.png [--yaw 1.2] # software-rend openrage export-openformats …/prop_x.ydr -o out/ # OpenIV openFormats: .odr/.oft/.odd/.otd + .mesh, .skel, .dds openrage audio x64/audio/sfx/RADIO_02_POP.rpf/alright.awc --export out/ # sounds → .wav openrage clips x64c.rpf/anim/ingame/clip_move_.rpf/move_m@generic.ycd # clips of a .ycd +openrage clips …/clip_car.rpf/gameplay@vehicles@….#cd # clips of a GTA VI .#cd openrage model …/a_m_y_hipster_01.ydd --render pose.png --anim "…/move_m@generic.ycd:walk@0.5" openrage model …/csb_bogdan.ydd --render pose.png --anim "…/cuts_sil.rpf/sil_int.cut:csb_bogdan_dual@75" # cutscene pose openrage xml …/ufo.ymap [-o ufo.ymap.xml] # metadata (.ymap/.ytyp/.ymt/.ymf/.cut/.pso) → XML diff --git a/site/content/gta-vi.md b/site/content/gta-vi.md new file mode 100644 index 0000000..2947976 --- /dev/null +++ b/site/content/gta-vi.md @@ -0,0 +1,155 @@ ++++ +title = "GTA VI" +description = "GTA VI in OpenRAGE: the map in 3D, RPF9 archives, models, textures, animations, sounds, videos and metadata. A read-only preview." +template = "gta-vi.html" + +[extra] +# **bold** parts are shown in the accent colour. +eyebrow = "Read-only preview" +headline = "Explore **GTA VI**" +lead = "Open RPF9 archives like folders, search the whole game and look at what is inside, on Linux and Windows." +features_title = "What you can do" +features_intro = "Everything is read from your own copy of the game. Nothing in it is changed." +screenshots_title = "Screenshots" +screenshots_intro = "OpenRAGE showing files of GTA VI. Click a picture to enlarge it, arrow keys browse." +status_title = "At a glance" +status_intro = "What OpenRAGE reads today. Scripts (`.#script`), particle effects (`.#pt`) and texture volumes are not read yet." + +# Pictures are files in static/. +[extra.hero] +image = "gta6/fly.webp" +width = 1100 +height = 720 +alt = "OpenRAGE flying over the map of GTA VI at dusk: villas on an island, towers across the water and the settings for the time of day" + +[[extra.features]] +icon = "🗺️" +title = "The map in 3D" +text = "The whole world from afar; details load where you fly." + +[[extra.features]] +icon = "🗂️" +title = "Archives" +text = "RPF9 archives, nested ones too, with folders and names." + +[[extra.features]] +icon = "🚗" +title = "Models" +text = "Skeletons, textures, normal and specular maps, glTF export." + +[[extra.features]] +icon = "🏃" +title = "Animations" +text = "Clips play on vehicles, weapons, props and parts of people." + +[[extra.features]] +icon = "🔊" +title = "Sounds and videos" +text = "Sounds with WAV export; videos in a player of their own." + +[[extra.features]] +icon = "🔎" +title = "Search" +text = "Names, hashes and full text of the whole game." + +[[extra.screenshots]] +image = "gta6/map.webp" +width = 1100 +height = 720 +alt = "The whole map of GTA VI from afar in OpenRAGE's map window" +title = "The whole map" +caption = "every distant model in one scene" + +[[extra.screenshots]] +image = "gta6/model.webp" +width = 1100 +height = 760 +alt = "A deer trophy prop with textures in OpenRAGE's model viewer" +title = "Model viewer" +caption = "textures, normal and specular maps" + +[[extra.screenshots]] +image = "gta6/video.webp" +width = 960 +height = 600 +alt = "OpenRAGE's video player showing an abstract neon animation" +title = "Video player" +caption = "volume, repeat and full screen" + +[[extra.formats]] +what = "Archives" +files = "`.rpf` (RPF9)" +status = "browse and extract" + +[[extra.formats]] +what = "Maps" +files = "`.#map`" +status = "in 3D: a place with its surroundings, or the whole map; glTF export" + +[[extra.formats]] +what = "Models" +files = "`.#dr`, `.#ft`, `.#dd`" +status = "view, export glTF" + +[[extra.formats]] +what = "Animations" +files = "`.#cd`" +status = "play" + +[[extra.formats]] +what = "Textures" +files = "`.ttpf`, `.#td`" +status = "view, export" + +[[extra.formats]] +what = "Collisions, navigation meshes" +files = "`.#bn`, `.#nv`" +status = "view in 3D" + +[[extra.formats]] +what = "Metadata, game text" +files = "`.#mt`, `.#typ`, `.#ldbmt` and others" +status = "read as XML, search" + +[[extra.formats]] +what = "Sounds, videos" +files = "`.awc`, `.bk2`" +status = "play; export WAV" ++++ + +## Setup + +Choose the folder that contains `game_scarlett_master.exe` or RPF9 archives in the setup dialog, or under +**File → Switch game… → Add a game…**. + +With the supported executable beside the archives, OpenRAGE reads their tables of contents with the keys in it. The +game is not started, and the keys are not stored. Without the executable, or with another build, archives are shown in +a recovery view: their files are found by their content, grouped by type and offset, and without folders. + +> [!NOTE] +> OpenRAGE contains no game files and no keys, and does not help to obtain either; you need your own copy. + +## The map + +**Tools → Map of the game (3D)…** shows the whole world. The search index must be complete; the first time, all map +files are read, which takes a minute or two. A single `.#map` opens as XML; **Show in 3D** there puts its objects +together with those around it. Interiors are not filled yet. + +**Fly (F)** flies through it: W A S D move, Q and E go down and up, Shift is faster, dragging looks around and the wheel +sets the speed. In the whole map, details are loaded where the camera is, as the game's own levels of detail tell. +**View** beside it sets the time of day, brightness, haze, the sea, the field of view and how far details reach. + +## Names + +Archives store hashes of their files' names. OpenRAGE finds the names in the executable, in the game's metadata, in the +files themselves and, once the search index is built, in all the other archives. Files whose name is not known are +listed under `entries/`. + +## Command line + +``` +openrage --game ls common.rpf +openrage --game index +openrage --game search walk +openrage --game map --render map.png +``` diff --git a/site/content/viewers.md b/site/content/viewers.md index cc22082..0f4399d 100644 --- a/site/content/viewers.md +++ b/site/content/viewers.md @@ -8,7 +8,7 @@ lead = "Format by format: what you see, what you can export, and what is not the toc = true +++ -This page describes GTA V. [GTA IV](@/gta-iv.md) and [Red Dead Redemption 2](@/rdr2.md) have their own pages. +This page describes GTA V. [GTA VI](@/gta-vi.md), [GTA IV](@/gta-iv.md) and [Red Dead Redemption 2](@/rdr2.md) have their own pages. Changing files is described in [Modding](@/modding.md). ## Textures diff --git a/site/static/gta6/fly.webp b/site/static/gta6/fly.webp new file mode 100644 index 0000000000000000000000000000000000000000..ddcd6fa7d694a2abb1c99178518bcd5aab60bc15 GIT binary patch literal 94898 zcmZs>V~{0Gu&&#-jhVKlZM&y!+qP}n*0gQgwr$(iTIW0a?)&G)&0iH!6%`d(Z)H~G zlS-0eVwFyyAnKyR3Tg_RMF0L9qclL|f>O&s%!Bds{fhZpNL+yCIl@Q;KHSviLl##C zc#(a%gW1o1mGiIx(69Z(efP(1YY?+eT4#5fVe>Eo4E^pK;BlLPu_0di&qM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xaegE zqxxC$KYp1#o^(OVUqK7l{LV>n;sZf9v1@Cjh63wuHI9PD-TxWtL@9@Kotc+YxF*U> z5Nk9}yZN+F|A2d{If^a_gUtazOG%2GCgbpT@n^T=RJ(7tfkI1_h_8X z_EG>Uhfx2!NF&bm`Gq6`^p#w_cERzc+*s4C{nb_~000000000000006W&i*H00000 W000000000000000000000001J@Ch9N literal 0 HcmV?d00001 diff --git a/site/static/gta6/map.webp b/site/static/gta6/map.webp new file mode 100644 index 0000000000000000000000000000000000000000..f0daaf14ad1d69f1b5ce931b63877d9018a19249 GIT binary patch literal 24582 zcmeFYQ>-vh(=~Q%+qP}nwr$(CZJ+1Zwr$(C?Y?dDxBdHlZF=2wt|t3plHpp}lTnfs z6Z_Q%08kedQczRiAb9+bKA#Ji3rHmcG7rQjNfIwcR76NfgrQ-e010Vnci{eVYb@B` zCvt54SN)65r=8=!>OT4$Jxjh~pP9c7uWK*E|M0ff1HiAqYt>`SKWno69{-hpugvw$j)62l-X?HE~}N^t@e1@BeyxAcKlOX>U;D29-S@_ynBVtD=sWP${R!~h|2_Wm_sRbo zAF#LMf9ehJ$M<{pyY`)alm1Ts_h+lW|M&72{ZVs0b(R0?f7c7>U-TFF*Yk1oTle=L z>GA*Td+hoAJ^TCk%l_Lt@qexQ%g{88X|+C7ZB74cW4@XGa^~Bf`=6Bi!U{JG7x#G- zEBhiwXp^mu^4ho!^%>()DrcF^q1)c`pLWDgz|CP8wL|$t|8$X@1>nIM9B*&B*zscM&x|5IGq%f316C7ZDf2vo*aoBE z$VDlh)%h>RvYM_wlc4>|pAm`vJ&malrk`j(x^W}GBkC<$PaAy&(~^b(nta>O3w3!_bRjcM$L(Z(g1wl37!akBVk&W+1- zJJKqeB~hsN1lk`epyS@S&Fl1 zhIFGn5kZJ%7ny}@!^PBf+H)*rw3fs4u-|BNsXi16y2;-ZPwD9YrSi8jFAb_aL4B3P z`J(v?{c8<$X|s|YOc(4kMs&yV*AE2bTqOQebpX?%@dF2q_8tyr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f;qe zB~4YB2C~r+NUSfY&QKzpN7tmcG9&Q$mmqjb2MT!ytm@KA+;rPk_Z7QVWv7@ zKtraccdb*&{!~y5wd`3i#b%R8P|}MI)CZAO;V1OLy4f)zsfyf{8FcF+RLnmsF3uJJ z9eb)j!+kivamSkbMg{}vfZBN#QmdkozcpH@C>S9|`GcT_jtP$kw=XD05*q5ai__t7{QO@}vqsNL~W3@=$KUa)kM8I#;7TFcFDwGNecdN?gKxj;o=&GvWeSXy|I?6^Y%IM33Y(4ND9R2D%n~+RQtU`w zc*M+jXLc3ad*N*ibe0LP`H{%SSyTApXe?NZvoESke#RbB_5y6Lhl<&S1e@e&nm|Ug z3zTj4pymnnVvUdeh4{n|Cq;O>F|fnAx?H6tC^}>gaV}SK{Oi`A2P@&Ar#RNt-cax+ zj0HEV@@VF&EA8@<##$nwRKh$GRG*%7ibh(7CBi^VqnkJM*weiLDG{3%JvN3CBPSO= m4%lCus5N|(+DkPP!Jd87Z43o(LBtrP3H!tV000000001vD(LS3 literal 0 HcmV?d00001 diff --git a/site/static/gta6/video.webp b/site/static/gta6/video.webp new file mode 100644 index 0000000000000000000000000000000000000000..5b64a6f37af984873ffe8e6c3e1acaa3d6e90278 GIT binary patch literal 13742 zcmbWdV~j3Lw=Md#d$n!bw%xtjwrv}$?e5jKZQHhO+qTZT_sKcm-e303&AsziB~_`+ z%o=lyk*ZSsEhbjX3IM2y3dyU=a}cEeGrqL|$^xS51yKj)`%Mxnnx9WtLhLNjy8G*w zneCpNtXLJ)tK>Is+97tx z&9&LJTPMUfzLwr*mtarz&-O*&Bg6gWv)%W~kME1t21HF@VZzBD)F0~Q8i!6W9?>_G zH@jDSRB~9ifv=iUm`f&*&yvG}Ctv-Z6aE$7lMi9vf}erwogIkfp0}<6-;^JNAE&Q} zm(Z7=i_q1TtCOD}XS>xnUQ5D(^MDB5y(d9Ydi(d>{FGK7c?GFWzEX;!YkXxC#TWQ; zC`zx;B`}n({~rr&1aP%LgFwdT>jg88{>L4Pv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VPRGb=1Asd&A|IzFm(-gb9JCYNmC MHoyPiLjd4^0bktVivR!s literal 0 HcmV?d00001 diff --git a/site/static/style.css b/site/static/style.css index 767843e..3db183a 100644 --- a/site/static/style.css +++ b/site/static/style.css @@ -15,6 +15,11 @@ --ok: #15803d; --planned: #6b7280; --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08); + /* GTA VI: the teaser and its page only */ + --vice-1: #d6247f; + --vice-2: #e8622a; + --vice-3: #b87a00; + --vice-glow: 12%; --radius: 10px; --max: 1120px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif; @@ -33,6 +38,10 @@ --accent: #fb923c; --accent-hover: #fdba74; --accent-text: #1a1206; + --vice-1: #ff4fa3; + --vice-2: #ff8a4c; + --vice-3: #ffd166; + --vice-glow: 22%; --code-bg: #262628; --ok: #4ade80; --planned: #9ca3af; @@ -51,6 +60,10 @@ --accent: #fb923c; --accent-hover: #fdba74; --accent-text: #1a1206; + --vice-1: #ff4fa3; + --vice-2: #ff8a4c; + --vice-3: #ffd166; + --vice-glow: 22%; --code-bg: #262628; --ok: #4ade80; --planned: #9ca3af; @@ -733,3 +746,60 @@ table.compare td.edge::after { /* Shorter sections: more air between them, compact tables in prose */ .prose h3 { margin-top: 1.8rem; } + +/* Short section that points to another page */ +.teaser { padding: 1.75rem 0 0; } +.teaser .card { + flex-direction: row; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.75rem 1.5rem; +} +.teaser .card > div { flex: 1 1 26rem; } +.teaser h2 { font-size: 1.15rem; margin: 0 0 0.25rem; } +.teaser p { margin: 0; color: var(--text-muted); font-size: 0.97rem; } +.teaser .card .btn { flex: none; align-self: center; margin: 0; } + +/* Landing pages: the text below the sections */ +.landing-text { max-width: 75ch; } + +/* GTA VI accent: a pink to yellow gradient (tokens --vice-* at the top) */ +.vice { + --vice: linear-gradient(100deg, var(--vice-1), var(--vice-2) 55%, var(--vice-3)); + --vice-shadow: 0 0 28px color-mix(in srgb, var(--vice-1) var(--vice-glow), transparent); +} +.vice.teaser .card { + border: 2px solid transparent; + background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--vice) border-box; + box-shadow: var(--vice-shadow); +} +.vice.teaser .card:hover { border-color: transparent; } +.vice.teaser h2, .vice .hero h1 strong { + width: fit-content; + background: var(--vice); + background-clip: text; + -webkit-background-clip: text; + color: transparent; +} +.vice .hero .eyebrow { + border-color: color-mix(in srgb, var(--vice-1) 45%, var(--border)); + background: color-mix(in srgb, var(--vice-1) 10%, transparent); + color: var(--vice-1); +} +.vice .hero { + background: radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--vice-1) var(--vice-glow), transparent), transparent 70%); +} +.vice .hero::after { + content: ""; + display: block; + width: min(320px, 60%); + height: 3px; + margin: 2.25rem auto 0; + border-radius: 999px; + background: var(--vice); +} +.vice .hero-shot { box-shadow: var(--shadow), var(--vice-shadow); } +@media (forced-colors: active) { + .vice.teaser h2, .vice .hero h1 strong { background: none; color: CanvasText; } +} diff --git a/site/templates/base.html b/site/templates/base.html index 2bce8b4..2c1f496 100644 --- a/site/templates/base.html +++ b/site/templates/base.html @@ -76,7 +76,6 @@

Grand Theft Auto, Red Dead Redemption, RAGE and Rockstar Games are trademarks of Take-Two Interactive Software, Inc. OpenRAGE is not affiliated with or endorsed by Rockstar Games or Take-Two Interactive. - The screenshots show OpenRAGE displaying files from the author's own copy of the game.

diff --git a/site/templates/gta-vi.html b/site/templates/gta-vi.html new file mode 100644 index 0000000..f33738b --- /dev/null +++ b/site/templates/gta-vi.html @@ -0,0 +1,83 @@ +{% extends "base.html" %} +{#- A game's landing page. All text comes from content/gta-vi.md. -#} + +{% block main %} +{%- set x = page.extra %} +
+ + +
+
+

{{ x.features_title }}

+
{{ x.features_intro | markdown | safe }}
+
    + {%- for f in x.features %} +
  • {{ f.title }}

    {{ f.text | markdown(inline=true) | safe }}

  • + {%- endfor %} +
+
+
+ +
+
+

{{ x.screenshots_title }}

+

{{ x.screenshots_intro | markdown(inline=true) | safe }}

+ +
+
+ +
+
+

{{ x.status_title }}

+
{{ x.status_intro | markdown | safe }}
+
+
+ + + + + {%- for f in x.formats %} + + + + + + {%- endfor %} + +
WhatFilesStatus
{{ f.what }}{{ f.files | markdown(inline=true) | safe }}{{ f.status | markdown(inline=true) | safe }}
+ + + + +
+
+
+ {{ page.content | safe }} +
+
+
+ +{% endblock main %} diff --git a/site/templates/index.html b/site/templates/index.html index de4b9ca..0f75c6d 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -20,7 +20,7 @@

{{ x.headline | markdown(inline=true) | safe }}

  • Latest release
  • Linux & Windows
  • GTA V · RDR2 archives
  • -
  • GTA VI next
  • +
  • GTA VI preview
  • GPL-3.0
  • @@ -35,6 +35,21 @@

    {{ x.headline | markdown(inline=true) | safe }}

    {{ x.notice | markdown | safe }}
    + {%- if x?.gta6 %} + +
    +
    +
    +
    +

    {{ x.gta6.title }}

    +

    {{ x.gta6.text | markdown(inline=true) | safe }}

    +
    + {{ x.gta6.link_text }} +
    +
    +
    + {%- endif %} +

    {{ x.features_title }}