From 82ca14a47284d85bb615330b18f39e835011a653 Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Fri, 17 Nov 2023 21:36:54 +1100 Subject: [PATCH 01/24] feat: add support for Kotlin --- Cargo.lock | 12 ++++++++++++ crates/tabby-common/Cargo.toml | 1 + crates/tabby-common/assets/languages.toml | 24 +++++++++++++++++++++++ crates/tabby-scheduler/Cargo.toml | 1 + crates/tabby-scheduler/src/dataset.rs | 12 ++++++++++++ website/docs/programming-languages.md | 2 ++ 6 files changed, 52 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index cf095c7e137b..45da1b2da2ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4402,6 +4402,7 @@ dependencies = [ "serde-jsonlines", "serdeconv", "tantivy", + "tree-sitter-kotlin", "uuid 1.4.1", ] @@ -4450,6 +4451,7 @@ dependencies = [ "tracing-test", "tree-sitter-go", "tree-sitter-java", + "tree-sitter-kotlin", "tree-sitter-python", "tree-sitter-ruby", "tree-sitter-rust", @@ -5302,6 +5304,16 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "tree-sitter-kotlin" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5f367466210220a194a2d8831fc12d15aa13305e7bcdf2dba47714aa328e86" +dependencies = [ + "cc", + "tree-sitter", +] + [[package]] name = "tree-sitter-python" version = "0.20.2" diff --git a/crates/tabby-common/Cargo.toml b/crates/tabby-common/Cargo.toml index c2223700e79a..9f0842e44175 100644 --- a/crates/tabby-common/Cargo.toml +++ b/crates/tabby-common/Cargo.toml @@ -13,6 +13,7 @@ reqwest = { workspace = true, features = [ "json" ] } uuid = { version = "1.4.1", features = ["v4"] } tantivy.workspace = true anyhow.workspace = true +tree-sitter-kotlin = "0.3.1" [features] testutils = [] diff --git a/crates/tabby-common/assets/languages.toml b/crates/tabby-common/assets/languages.toml index d6e5b9f35c29..e77ab0a37c38 100644 --- a/crates/tabby-common/assets/languages.toml +++ b/crates/tabby-common/assets/languages.toml @@ -41,6 +41,30 @@ top_level_keywords = [ "return", ] +[[config]] +languages = ["kotlin"] +line_comment = "//" +top_level_keywords = [ + "abstract", + "public", + "private", + "companion", + "class", + "data", + "const", + "actual", + "expect", + "sealed", + "suspend", + "fun", + "import", + "interface", + "package", + "var", + "val", + "enum", +] + [[config]] languages = ["javascript", "typescript", "javascriptreact", "typescriptreact"] line_comment = "//" diff --git a/crates/tabby-scheduler/Cargo.toml b/crates/tabby-scheduler/Cargo.toml index 912dd0256074..c4e407f875a5 100644 --- a/crates/tabby-scheduler/Cargo.toml +++ b/crates/tabby-scheduler/Cargo.toml @@ -17,6 +17,7 @@ serde-jsonlines = { workspace = true } file-rotate = "0.7.5" tree-sitter-python = "0.20.2" tree-sitter-java = "0.20.2" +tree-sitter-kotlin = "0.3.1" tree-sitter-rust = "0.20.3" tree-sitter-typescript = "0.20.3" tree-sitter-go = "0.20.0" diff --git a/crates/tabby-scheduler/src/dataset.rs b/crates/tabby-scheduler/src/dataset.rs index bddbb9761986..e9ae98e75244 100644 --- a/crates/tabby-scheduler/src/dataset.rs +++ b/crates/tabby-scheduler/src/dataset.rs @@ -191,6 +191,7 @@ lazy_static! { ("haskell", vec!["hs"]), ("html", vec!["html"]), ("java", vec!["java"]), + ("kotlin", vec!["kt", "kts"]), ("julia", vec!["jl"]), ("lua", vec!["lua"]), ("makefile", vec!["Makefile"]), @@ -257,6 +258,17 @@ lazy_static! { .unwrap(), ), ), + ( + "kotlin", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_kotlin::language(), + tree_sitter_kotlin::TAGGING_QUERY, + "", + ) + .unwrap(), + ), + ), ( "javascript-typescript", TagsConfigurationSync( diff --git a/website/docs/programming-languages.md b/website/docs/programming-languages.md index 23a11a8e9e9d..4c9586b94f09 100644 --- a/website/docs/programming-languages.md +++ b/website/docs/programming-languages.md @@ -28,6 +28,7 @@ For an actual example of an issue or pull request adding the above support, plea * [Golang](https://go.dev/): Since v0.4.0 * [Ruby](https://www.ruby-lang.org/): Since v0.4.0 * [Java](https://www.java.com/): Since v0.6.0 +* [Kotlin](https://www.kotlinlang.org/): Since v0.6.0 ## Languages Missing Certain Support @@ -42,3 +43,4 @@ For an actual example of an issue or pull request adding the above support, plea | PHP | 🚫 | 🚫 | | Perl | 🚫 | 🚫 | | Scala | 🚫 | 🚫 | +| Kotlin | 🚫 | 🚫 | From e32f4d17ec4aa100545886eabc6d549ca31af61e Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 22:07:55 -0800 Subject: [PATCH 02/24] Update programming-languages.md --- website/docs/programming-languages.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/programming-languages.md b/website/docs/programming-languages.md index 4c9586b94f09..c9ebbdc436f3 100644 --- a/website/docs/programming-languages.md +++ b/website/docs/programming-languages.md @@ -43,4 +43,3 @@ For an actual example of an issue or pull request adding the above support, plea | PHP | 🚫 | 🚫 | | Perl | 🚫 | 🚫 | | Scala | 🚫 | 🚫 | -| Kotlin | 🚫 | 🚫 | From 79075d62cab01acbf4b90c845ddaef36b1d99950 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 22:08:49 -0800 Subject: [PATCH 03/24] Update Cargo.toml --- crates/tabby-common/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/tabby-common/Cargo.toml b/crates/tabby-common/Cargo.toml index 9f0842e44175..c2223700e79a 100644 --- a/crates/tabby-common/Cargo.toml +++ b/crates/tabby-common/Cargo.toml @@ -13,7 +13,6 @@ reqwest = { workspace = true, features = [ "json" ] } uuid = { version = "1.4.1", features = ["v4"] } tantivy.workspace = true anyhow.workspace = true -tree-sitter-kotlin = "0.3.1" [features] testutils = [] From a593b6645c47ae44255fffb19dd2aa1914cc7a92 Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Sat, 18 Nov 2023 21:02:20 +1100 Subject: [PATCH 04/24] fix: kotlin missing TAGGING_QUERY --- crates/tabby-scheduler/src/dataset.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/tabby-scheduler/src/dataset.rs b/crates/tabby-scheduler/src/dataset.rs index e9ae98e75244..513a9dea024d 100644 --- a/crates/tabby-scheduler/src/dataset.rs +++ b/crates/tabby-scheduler/src/dataset.rs @@ -261,12 +261,7 @@ lazy_static! { ( "kotlin", TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_kotlin::language(), - tree_sitter_kotlin::TAGGING_QUERY, - "", - ) - .unwrap(), + TagsConfiguration::new(tree_sitter_kotlin::language(), "", "").unwrap(), ), ), ( From d3be178d228b7e42c7659e0f493d34b9f6523e05 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 11:43:16 -0800 Subject: [PATCH 05/24] docs: remove 0.5.0 warning as tabby adapt same format for remote / local storage --- MODEL_SPEC.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/MODEL_SPEC.md b/MODEL_SPEC.md index ebb826d1862e..d214d61e2365 100644 --- a/MODEL_SPEC.md +++ b/MODEL_SPEC.md @@ -1,8 +1,5 @@ # Tabby Model Specification (Unstable) -> [!WARNING] -> **Since v0.5.0** This document is intended exclusively for local models. For remote models, we rely on the `tabby-registry` repository within each organization or user. You can refer to https://github.com/TabbyML/registry-tabby/blob/main/models.json for an example. - Tabby organizes the model within a directory. This document provides an explanation of the necessary contents for supporting model serving. An example model directory can be found at https://huggingface.co/TabbyML/StarCoder-1B The minimal Tabby model directory should include the following contents: From 2b41dc175babca3ca7b99822034a103e9ccdd30d Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 14:35:58 -0800 Subject: [PATCH 06/24] feat: make --model optional, so user can start a chat only instance (#817) --- CHANGELOG.md | 1 + crates/tabby/src/serve.rs | 62 ++++++++++++------- crates/tabby/src/services/health.rs | 7 ++- ee/tabby-ui/app/(dashboard)/page.tsx | 13 ++-- ee/tabby-ui/lib/hooks/use-health.tsx | 2 +- ee/tabby-webserver/ui/404.html | 2 +- ...aef036b0bc.js => page-fe128a03e1e2a101.js} | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 ee/tabby-webserver/ui/index.html | 2 +- ee/tabby-webserver/ui/index.txt | 4 +- ee/tabby-webserver/ui/playground.html | 2 +- ee/tabby-webserver/ui/playground.txt | 2 +- ee/tabby-webserver/ui/swagger.html | 2 +- ee/tabby-webserver/ui/swagger.txt | 2 +- 15 files changed, 60 insertions(+), 43 deletions(-) rename ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/{page-1cc6ccaef036b0bc.js => page-fe128a03e1e2a101.js} (65%) rename ee/tabby-webserver/ui/_next/static/{y8UTfVMfS3WRo-O_Ue2fm => mnxnTVxz0_SgSNkjMXene}/_buildManifest.js (100%) rename ee/tabby-webserver/ui/_next/static/{y8UTfVMfS3WRo-O_Ue2fm => mnxnTVxz0_SgSNkjMXene}/_ssgManifest.js (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 097d4f86b053..a4447dff88f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## Fixes and Improvements * Fix the slow repository indexing due to constraint memory arena in tantivy index writer. +* Make `--model` optional, so users can create a chat only instance. # v0.5.5 diff --git a/crates/tabby/src/serve.rs b/crates/tabby/src/serve.rs index efe3a7bd44e8..b2a73482a5f2 100644 --- a/crates/tabby/src/serve.rs +++ b/crates/tabby/src/serve.rs @@ -70,7 +70,7 @@ struct ApiDoc; pub struct ServeArgs { /// Model id for `/completions` API endpoint. #[clap(long)] - model: String, + model: Option, /// Model id for `/chat/completions` API endpoints. #[clap(long)] @@ -122,7 +122,10 @@ pub async fn main(config: &Config, args: &ServeArgs) { } async fn load_model(args: &ServeArgs) { - download_model_if_needed(&args.model).await; + if let Some(model) = &args.model { + download_model_if_needed(model).await; + } + if let Some(chat_model) = &args.chat_model { download_model_if_needed(chat_model).await } @@ -131,16 +134,21 @@ async fn load_model(args: &ServeArgs) { async fn api_router(args: &ServeArgs, config: &Config) -> Router { let logger = Arc::new(create_logger()); let code = Arc::new(crate::services::code::create_code_search()); - let completion = Arc::new( - create_completion_service( - code.clone(), - logger.clone(), - &args.model, - &args.device, - args.parallelism, - ) - .await, - ); + + let completion_state = if let Some(model) = &args.model { + Some(Arc::new( + create_completion_service( + code.clone(), + logger.clone(), + model, + &args.device, + args.parallelism, + ) + .await, + )) + } else { + None + }; let chat_state = if let Some(chat_model) = &args.chat_model { Some(Arc::new( @@ -153,7 +161,7 @@ async fn api_router(args: &ServeArgs, config: &Config) -> Router { let mut routers = vec![]; let health_state = Arc::new(health::HealthState::new( - &args.model, + args.model.as_deref(), args.chat_model.as_deref(), &args.device, )); @@ -173,16 +181,18 @@ async fn api_router(args: &ServeArgs, config: &Config) -> Router { ) }); - routers.push({ - Router::new() - .route( - "/v1/completions", - routing::post(routes::completions).with_state(completion), - ) - .layer(TimeoutLayer::new(Duration::from_secs( - config.server.completion_timeout, - ))) - }); + if let Some(completion_state) = completion_state { + routers.push({ + Router::new() + .route( + "/v1/completions", + routing::post(routes::completions).with_state(completion_state), + ) + .layer(TimeoutLayer::new(Duration::from_secs( + config.server.completion_timeout, + ))) + }); + } if let Some(chat_state) = chat_state { routers.push({ @@ -209,7 +219,11 @@ async fn api_router(args: &ServeArgs, config: &Config) -> Router { } fn start_heartbeat(args: &ServeArgs) { - let state = health::HealthState::new(&args.model, args.chat_model.as_deref(), &args.device); + let state = health::HealthState::new( + args.model.as_deref(), + args.chat_model.as_deref(), + &args.device, + ); tokio::spawn(async move { loop { usage::capture("ServeHealth", &state).await; diff --git a/crates/tabby/src/services/health.rs b/crates/tabby/src/services/health.rs index a55db993d9c8..5e48efe34b9c 100644 --- a/crates/tabby/src/services/health.rs +++ b/crates/tabby/src/services/health.rs @@ -10,7 +10,8 @@ use crate::Device; #[derive(Serialize, Deserialize, ToSchema, Clone, Debug)] pub struct HealthState { - model: String, + #[serde(skip_serializing_if = "Option::is_none")] + model: Option, #[serde(skip_serializing_if = "Option::is_none")] chat_model: Option, device: String, @@ -22,7 +23,7 @@ pub struct HealthState { } impl HealthState { - pub fn new(model: &str, chat_model: Option<&str>, device: &Device) -> Self { + pub fn new(model: Option<&str>, chat_model: Option<&str>, device: &Device) -> Self { let (cpu_info, cpu_count) = read_cpu_info(); let cuda_devices = match read_cuda_devices() { @@ -31,7 +32,7 @@ impl HealthState { }; Self { - model: model.to_owned(), + model: model.map(|x| x.to_owned()), chat_model: chat_model.map(|x| x.to_owned()), device: device.to_string(), arch: ARCH.to_string(), diff --git a/ee/tabby-ui/app/(dashboard)/page.tsx b/ee/tabby-ui/app/(dashboard)/page.tsx index 4bd985616eac..ab3a9285bf01 100644 --- a/ee/tabby-ui/app/(dashboard)/page.tsx +++ b/ee/tabby-ui/app/(dashboard)/page.tsx @@ -98,12 +98,13 @@ function MainPanel() {
Workers
- + {healthInfo.model && + } {healthInfo.chat_model && ( 404: This page could not be found.Tabby

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.Tabby

404

This page could not be found.

\ No newline at end of file diff --git a/ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/page-1cc6ccaef036b0bc.js b/ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/page-fe128a03e1e2a101.js similarity index 65% rename from ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/page-1cc6ccaef036b0bc.js rename to ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/page-fe128a03e1e2a101.js index c182ab412c9b..355f9df53d4a 100644 --- a/ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/page-1cc6ccaef036b0bc.js +++ b/ee/tabby-webserver/ui/_next/static/chunks/app/(dashboard)/page-fe128a03e1e2a101.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[130],{75045:function(e,t,s){Promise.resolve().then(s.bind(s,60901))},60901:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return v}});var a=s(57437),r=s(93023),n=s(12609),l=s(84168),o=s(16775),i=s(13287),d=s(2265),c=s(39311);let h=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...r})});h.displayName="Card";let x=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",s),...r})});x.displayName="CardHeader";let m=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",s),...r})});m.displayName="CardTitle";let p=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",s),...r})});p.displayName="CardDescription";let u=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",s),...r})});u.displayName="CardContent";let f=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",s),...r})});function j(e){let{source:t,name:s,type:r,health:n}=e,{device:l,cuda_devices:o}=n;return(0,a.jsxs)(h,{className:"rounded-xl p-2 shadow-md",children:[(0,a.jsx)(x,{className:"p-0 px-4 pb-2 pt-4",children:(0,a.jsxs)(m,{className:"text-md flex items-center font-normal",children:[(0,a.jsx)(w,{type:r}),(0,a.jsx)("p",{className:"ml-2",children:s})]})}),(0,a.jsxs)(u,{className:"flex flex-col gap-2 p-0 px-4 pb-4 pt-2",children:[(0,a.jsxs)(g,{children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:" h-5 w-5 text-gray-400",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"16",y:"16",width:"6",height:"6",rx:"1"}),(0,a.jsx)("rect",{x:"2",y:"16",width:"6",height:"6",rx:"1"}),(0,a.jsx)("rect",{x:"9",y:"2",width:"6",height:"6",rx:"1"}),(0,a.jsx)("path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}),(0,a.jsx)("path",{d:"M12 12V8"})]}),(0,a.jsx)("p",{className:"ml-2",children:t})]}),(0,a.jsxs)(g,{children:[(0,a.jsxs)("svg",{className:" h-5 w-5 text-gray-400",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("rect",{height:"16",rx:"2",width:"16",x:"4",y:"4"}),(0,a.jsx)("rect",{height:"6",width:"6",x:"9",y:"9"}),(0,a.jsx)("path",{d:"M15 2v2"}),(0,a.jsx)("path",{d:"M15 20v2"}),(0,a.jsx)("path",{d:"M2 15h2"}),(0,a.jsx)("path",{d:"M2 9h2"}),(0,a.jsx)("path",{d:"M20 15h2"}),(0,a.jsx)("path",{d:"M20 9h2"}),(0,a.jsx)("path",{d:"M9 2v2"}),(0,a.jsx)("path",{d:"M9 20v2"})]}),(0,a.jsxs)("p",{className:"ml-2",children:[n.cpu_info," (",n.cpu_count," cores)"]})]}),"cuda"==l&&o.map((e,t)=>(0,a.jsxs)(g,{children:[(0,a.jsxs)("svg",{className:" h-5 w-5 text-gray-400",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M6 19v-3"}),(0,a.jsx)("path",{d:"M10 19v-3"}),(0,a.jsx)("path",{d:"M14 19v-3"}),(0,a.jsx)("path",{d:"M18 19v-3"}),(0,a.jsx)("path",{d:"M8 11V9"}),(0,a.jsx)("path",{d:"M16 11V9"}),(0,a.jsx)("path",{d:"M12 11V9"}),(0,a.jsx)("path",{d:"M2 15h20"}),(0,a.jsx)("path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z"})]}),(0,a.jsx)("p",{className:"ml-2",children:e})]},t))]})]})}function g(e){let{children:t}=e;return(0,a.jsx)("div",{className:"mt-2 flex items-center text-sm text-gray-500",children:t})}function w(e){let{type:t}=e,s="h-5 w-5";return"completion"==t?(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:s,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,a.jsx)("path",{d:"m10 13-2 2 2 2"}),(0,a.jsx)("path",{d:"m14 17 2-2-2-2"})]}):"chat"==t?(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:s,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2v5Z"}),(0,a.jsx)("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}):"index"==t?(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:s,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"m9 9-2 2 2 2"}),(0,a.jsx)("path",{d:"m13 13 2-2-2-2"}),(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("path",{d:"m21 21-4.3-4.3"})]}):void 0}f.displayName="CardFooter";let N="community-dialog-shown";function v(){let[e,t]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{localStorage.getItem(N)||(t(!0),localStorage.setItem(N,"true"))},[]),(0,a.jsxs)("div",{className:"p-4 lg:p-16",children:[(0,a.jsx)(y,{}),(0,a.jsx)(n.Vq,{open:e,onOpenChange:t,children:(0,a.jsxs)(n.cZ,{children:[(0,a.jsxs)(n.fK,{className:"gap-3",children:[(0,a.jsx)(n.$N,{children:"Join the Tabby community"}),(0,a.jsx)(n.Be,{children:"Connect with other contributors building Tabby. Share knowledge, get help, and contribute to the open-source project."})]}),(0,a.jsx)(n.cN,{className:"sm:justify-start",children:(0,a.jsxs)("a",{target:"_blank",href:"https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA",className:(0,r.d)(),children:[(0,a.jsx)(l.gx,{className:"-ml-2 h-8 w-8"}),"Join us on Slack"]})})]})})]})}function y(){let{data:e}=(0,i.Q)();if(e)return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,a.jsxs)("h1",{children:[(0,a.jsx)("span",{className:"font-bold",children:"Congratulations"}),", your tabby instance is up!"]}),(0,a.jsx)("span",{className:"flex flex-wrap gap-1",children:(0,a.jsx)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby/releases/tag/".concat(e.version.git_describe),children:(0,a.jsx)("img",{src:"https://img.shields.io/badge/version-".concat(encodeURIComponent(e.version.git_describe.replaceAll("-","--")),"-green")})})}),(0,a.jsx)(o.Z,{}),(0,a.jsxs)("div",{className:"mt-4 rounded-lg bg-zinc-100 p-4 dark:bg-zinc-800",children:[(0,a.jsx)("span",{className:"font-bold",children:"Workers"}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-4 lg:flex-row lg:flex-wrap",children:[(0,a.jsx)(j,{source:"localhost",name:e.model,type:"completion",health:e}),e.chat_model&&(0,a.jsx)(j,{source:"localhost",name:e.chat_model,type:"chat",health:e}),(0,a.jsx)(j,{source:"localhost",name:"Code Search Index",type:"index",health:e})]})]})]})}},12609:function(e,t,s){"use strict";s.d(t,{$N:function(){return p},Be:function(){return u},Vq:function(){return i},cN:function(){return m},cZ:function(){return h},fK:function(){return x}});var a=s(57437),r=s(2265),n=s(25555),l=s(39311),o=s(84168);let i=n.fC;n.xz;let d=e=>{let{className:t,children:s,...r}=e;return(0,a.jsx)(n.h_,{className:(0,l.cn)(t),...r,children:(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center sm:items-center",children:s})})};d.displayName=n.h_.displayName;let c=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(n.aV,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",s),...r})});c.displayName=n.aV.displayName;let h=r.forwardRef((e,t)=>{let{className:s,children:r,...i}=e;return(0,a.jsxs)(d,{children:[(0,a.jsx)(c,{}),(0,a.jsxs)(n.VY,{ref:t,className:(0,l.cn)("fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-sm animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",s),...i,children:[r,(0,a.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(o.bM,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});h.displayName=n.VY.displayName;let x=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...s})};x.displayName="DialogHeader";let m=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};m.displayName="DialogFooter";let p=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(n.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",s),...r})});p.displayName=n.Dx.displayName;let u=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(n.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...r})});u.displayName=n.dk.displayName},16775:function(e,t,s){"use strict";s.d(t,{Z:function(){return o}});var a=s(57437),r=s(2265),n=s(26823),l=s(39311);let o=r.forwardRef((e,t)=>{let{className:s,orientation:r="horizontal",decorative:o=!0,...i}=e;return(0,a.jsx)(n.f,{ref:t,decorative:o,orientation:r,className:(0,l.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",s),...i})});o.displayName=n.f.displayName},13287:function(e,t,s){"use strict";s.d(t,{Q:function(){return n}});var a=s(1589),r=s(97605);function n(){return(0,a.Z)("/v1/health",r.Z)}},1589:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(30713),r=s(44796);let n=(0,r.xD)(a.ZP,e=>(t,s,a)=>(a.revalidateOnFocus=!1,a.revalidateIfStale=!1,a.revalidateOnReconnect=!1,e(t,s,a)))}},function(e){e.O(0,[882,576,286,967,971,590,744],function(){return e(e.s=75045)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[130],{75045:function(e,t,s){Promise.resolve().then(s.bind(s,60901))},60901:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return v}});var a=s(57437),r=s(93023),n=s(12609),l=s(84168),o=s(16775),i=s(13287),d=s(2265),c=s(39311);let h=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...r})});h.displayName="Card";let x=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",s),...r})});x.displayName="CardHeader";let m=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",s),...r})});m.displayName="CardTitle";let p=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",s),...r})});p.displayName="CardDescription";let u=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",s),...r})});u.displayName="CardContent";let f=d.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",s),...r})});function j(e){let{source:t,name:s,type:r,health:n}=e,{device:l,cuda_devices:o}=n;return(0,a.jsxs)(h,{className:"rounded-xl p-2 shadow-md",children:[(0,a.jsx)(x,{className:"p-0 px-4 pb-2 pt-4",children:(0,a.jsxs)(m,{className:"text-md flex items-center font-normal",children:[(0,a.jsx)(w,{type:r}),(0,a.jsx)("p",{className:"ml-2",children:s})]})}),(0,a.jsxs)(u,{className:"flex flex-col gap-2 p-0 px-4 pb-4 pt-2",children:[(0,a.jsxs)(g,{children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:" h-5 w-5 text-gray-400",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"16",y:"16",width:"6",height:"6",rx:"1"}),(0,a.jsx)("rect",{x:"2",y:"16",width:"6",height:"6",rx:"1"}),(0,a.jsx)("rect",{x:"9",y:"2",width:"6",height:"6",rx:"1"}),(0,a.jsx)("path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"}),(0,a.jsx)("path",{d:"M12 12V8"})]}),(0,a.jsx)("p",{className:"ml-2",children:t})]}),(0,a.jsxs)(g,{children:[(0,a.jsxs)("svg",{className:" h-5 w-5 text-gray-400",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("rect",{height:"16",rx:"2",width:"16",x:"4",y:"4"}),(0,a.jsx)("rect",{height:"6",width:"6",x:"9",y:"9"}),(0,a.jsx)("path",{d:"M15 2v2"}),(0,a.jsx)("path",{d:"M15 20v2"}),(0,a.jsx)("path",{d:"M2 15h2"}),(0,a.jsx)("path",{d:"M2 9h2"}),(0,a.jsx)("path",{d:"M20 15h2"}),(0,a.jsx)("path",{d:"M20 9h2"}),(0,a.jsx)("path",{d:"M9 2v2"}),(0,a.jsx)("path",{d:"M9 20v2"})]}),(0,a.jsxs)("p",{className:"ml-2",children:[n.cpu_info," (",n.cpu_count," cores)"]})]}),"cuda"==l&&o.map((e,t)=>(0,a.jsxs)(g,{children:[(0,a.jsxs)("svg",{className:" h-5 w-5 text-gray-400",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M6 19v-3"}),(0,a.jsx)("path",{d:"M10 19v-3"}),(0,a.jsx)("path",{d:"M14 19v-3"}),(0,a.jsx)("path",{d:"M18 19v-3"}),(0,a.jsx)("path",{d:"M8 11V9"}),(0,a.jsx)("path",{d:"M16 11V9"}),(0,a.jsx)("path",{d:"M12 11V9"}),(0,a.jsx)("path",{d:"M2 15h20"}),(0,a.jsx)("path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z"})]}),(0,a.jsx)("p",{className:"ml-2",children:e})]},t))]})]})}function g(e){let{children:t}=e;return(0,a.jsx)("div",{className:"mt-2 flex items-center text-sm text-gray-500",children:t})}function w(e){let{type:t}=e,s="h-5 w-5";return"completion"==t?(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:s,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,a.jsx)("path",{d:"m10 13-2 2 2 2"}),(0,a.jsx)("path",{d:"m14 17 2-2-2-2"})]}):"chat"==t?(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:s,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2v5Z"}),(0,a.jsx)("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}):"index"==t?(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:s,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"m9 9-2 2 2 2"}),(0,a.jsx)("path",{d:"m13 13 2-2-2-2"}),(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("path",{d:"m21 21-4.3-4.3"})]}):void 0}f.displayName="CardFooter";let N="community-dialog-shown";function v(){let[e,t]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{localStorage.getItem(N)||(t(!0),localStorage.setItem(N,"true"))},[]),(0,a.jsxs)("div",{className:"p-4 lg:p-16",children:[(0,a.jsx)(y,{}),(0,a.jsx)(n.Vq,{open:e,onOpenChange:t,children:(0,a.jsxs)(n.cZ,{children:[(0,a.jsxs)(n.fK,{className:"gap-3",children:[(0,a.jsx)(n.$N,{children:"Join the Tabby community"}),(0,a.jsx)(n.Be,{children:"Connect with other contributors building Tabby. Share knowledge, get help, and contribute to the open-source project."})]}),(0,a.jsx)(n.cN,{className:"sm:justify-start",children:(0,a.jsxs)("a",{target:"_blank",href:"https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA",className:(0,r.d)(),children:[(0,a.jsx)(l.gx,{className:"-ml-2 h-8 w-8"}),"Join us on Slack"]})})]})})]})}function y(){let{data:e}=(0,i.Q)();if(e)return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,a.jsxs)("h1",{children:[(0,a.jsx)("span",{className:"font-bold",children:"Congratulations"}),", your tabby instance is up!"]}),(0,a.jsx)("span",{className:"flex flex-wrap gap-1",children:(0,a.jsx)("a",{target:"_blank",href:"https://github.com/TabbyML/tabby/releases/tag/".concat(e.version.git_describe),children:(0,a.jsx)("img",{src:"https://img.shields.io/badge/version-".concat(encodeURIComponent(e.version.git_describe.replaceAll("-","--")),"-green")})})}),(0,a.jsx)(o.Z,{}),(0,a.jsxs)("div",{className:"mt-4 rounded-lg bg-zinc-100 p-4 dark:bg-zinc-800",children:[(0,a.jsx)("span",{className:"font-bold",children:"Workers"}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-4 lg:flex-row lg:flex-wrap",children:[e.model&&(0,a.jsx)(j,{source:"localhost",name:e.model,type:"completion",health:e}),e.chat_model&&(0,a.jsx)(j,{source:"localhost",name:e.chat_model,type:"chat",health:e}),(0,a.jsx)(j,{source:"localhost",name:"Code Search Index",type:"index",health:e})]})]})]})}},12609:function(e,t,s){"use strict";s.d(t,{$N:function(){return p},Be:function(){return u},Vq:function(){return i},cN:function(){return m},cZ:function(){return h},fK:function(){return x}});var a=s(57437),r=s(2265),n=s(25555),l=s(39311),o=s(84168);let i=n.fC;n.xz;let d=e=>{let{className:t,children:s,...r}=e;return(0,a.jsx)(n.h_,{className:(0,l.cn)(t),...r,children:(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center sm:items-center",children:s})})};d.displayName=n.h_.displayName;let c=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(n.aV,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",s),...r})});c.displayName=n.aV.displayName;let h=r.forwardRef((e,t)=>{let{className:s,children:r,...i}=e;return(0,a.jsxs)(d,{children:[(0,a.jsx)(c,{}),(0,a.jsxs)(n.VY,{ref:t,className:(0,l.cn)("fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-sm animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",s),...i,children:[r,(0,a.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(o.bM,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});h.displayName=n.VY.displayName;let x=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...s})};x.displayName="DialogHeader";let m=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};m.displayName="DialogFooter";let p=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(n.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",s),...r})});p.displayName=n.Dx.displayName;let u=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(n.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...r})});u.displayName=n.dk.displayName},16775:function(e,t,s){"use strict";s.d(t,{Z:function(){return o}});var a=s(57437),r=s(2265),n=s(26823),l=s(39311);let o=r.forwardRef((e,t)=>{let{className:s,orientation:r="horizontal",decorative:o=!0,...i}=e;return(0,a.jsx)(n.f,{ref:t,decorative:o,orientation:r,className:(0,l.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",s),...i})});o.displayName=n.f.displayName},13287:function(e,t,s){"use strict";s.d(t,{Q:function(){return n}});var a=s(1589),r=s(97605);function n(){return(0,a.Z)("/v1/health",r.Z)}},1589:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(30713),r=s(44796);let n=(0,r.xD)(a.ZP,e=>(t,s,a)=>(a.revalidateOnFocus=!1,a.revalidateIfStale=!1,a.revalidateOnReconnect=!1,e(t,s,a)))}},function(e){e.O(0,[882,576,286,967,971,590,744],function(){return e(e.s=75045)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ee/tabby-webserver/ui/_next/static/y8UTfVMfS3WRo-O_Ue2fm/_buildManifest.js b/ee/tabby-webserver/ui/_next/static/mnxnTVxz0_SgSNkjMXene/_buildManifest.js similarity index 100% rename from ee/tabby-webserver/ui/_next/static/y8UTfVMfS3WRo-O_Ue2fm/_buildManifest.js rename to ee/tabby-webserver/ui/_next/static/mnxnTVxz0_SgSNkjMXene/_buildManifest.js diff --git a/ee/tabby-webserver/ui/_next/static/y8UTfVMfS3WRo-O_Ue2fm/_ssgManifest.js b/ee/tabby-webserver/ui/_next/static/mnxnTVxz0_SgSNkjMXene/_ssgManifest.js similarity index 100% rename from ee/tabby-webserver/ui/_next/static/y8UTfVMfS3WRo-O_Ue2fm/_ssgManifest.js rename to ee/tabby-webserver/ui/_next/static/mnxnTVxz0_SgSNkjMXene/_ssgManifest.js diff --git a/ee/tabby-webserver/ui/index.html b/ee/tabby-webserver/ui/index.html index 720bfd2888b5..0efed4418b1d 100644 --- a/ee/tabby-webserver/ui/index.html +++ b/ee/tabby-webserver/ui/index.html @@ -1 +1 @@ -Tabby - Dashboard
\ No newline at end of file +Tabby - Dashboard
\ No newline at end of file diff --git a/ee/tabby-webserver/ui/index.txt b/ee/tabby-webserver/ui/index.txt index 65a75e718400..7519956f00b7 100644 --- a/ee/tabby-webserver/ui/index.txt +++ b/ee/tabby-webserver/ui/index.txt @@ -1,7 +1,7 @@ 1:HL["/_next/static/media/86fdec36ddd9097e-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 2:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 3:HL["/_next/static/css/83506ffe28f4b91c.css","style"] -0:["y8UTfVMfS3WRo-O_Ue2fm",[[["",{"children":["(dashboard)",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/83506ffe28f4b91c.css","precedence":"next"}]],"$L5"]]]] +0:["mnxnTVxz0_SgSNkjMXene",[[["",{"children":["(dashboard)",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/83506ffe28f4b91c.css","precedence":"next"}]],"$L5"]]]] 6:I{"id":5925,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Toaster","async":false} 7:I{"id":78495,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Providers","async":false} 8:I{"id":11486,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Header","async":false} @@ -9,7 +9,7 @@ a:I{"id":18639,"chunks":["272:static/chunks/webpack-7f4514982162b5cb.js","971:static/chunks/fd9d1056-6779f76bb208370f.js","590:static/chunks/590-758bf4c4ecd0fce8.js"],"name":"","async":false} b:I{"id":30831,"chunks":["882:static/chunks/882-5574357230a12cf9.js","396:static/chunks/396-89319c375c83667c.js","642:static/chunks/app/(dashboard)/layout-81899020c101ed0e.js"],"name":"","async":false} d:I{"id":65146,"chunks":["272:static/chunks/webpack-7f4514982162b5cb.js","971:static/chunks/fd9d1056-6779f76bb208370f.js","590:static/chunks/590-758bf4c4ecd0fce8.js"],"name":"","async":false} -e:I{"id":60901,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","286:static/chunks/286-453e01dda7220f79.js","967:static/chunks/967-f02728ac0b1b01a8.js","130:static/chunks/app/(dashboard)/page-1cc6ccaef036b0bc.js"],"name":"","async":false} +e:I{"id":60901,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","286:static/chunks/286-453e01dda7220f79.js","967:static/chunks/967-f02728ac0b1b01a8.js","130:static/chunks/app/(dashboard)/page-fe128a03e1e2a101.js"],"name":"","async":false} 5:[["$","meta","0",{"charSet":"utf-8"}],["$","title","1",{"children":"Tabby - Dashboard"}],["$","meta","2",{"name":"description","content":"Tabby, an opensource, self-hosted AI coding assistant."}],["$","meta","3",{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"white"}],["$","meta","4",{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"black"}],["$","meta","5",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","6",{"name":"next-size-adjust"}]] 4:[null,["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"font-sans antialiased __variable_e66fe9 __variable_bd9c35","children":[["$","$L6",null,{}],["$","$L7",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"children":[["$","div",null,{"className":"flex min-h-screen flex-col","children":[["$","$L8",null,{}],["$","main",null,{"className":"bg-muted/50 flex flex-1 flex-col","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":[null,["$","$Lb",null,{"className":"flex-1","children":["$","$L9",null,{"parallelRouterKey":"children","segmentPath":["children","(dashboard)","children"],"loading":"$undefined","loadingStyles":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$Lc",["$","$Ld",null,{"propsForComponent":{"params":{}},"Component":"$e"}],null],"segment":"__PAGE__"},"styles":[]}]}],null],"segment":"(dashboard)"},"styles":[]}]}]]}],null]}]]}]]}],null] c:null diff --git a/ee/tabby-webserver/ui/playground.html b/ee/tabby-webserver/ui/playground.html index fbbf1f68b229..1e7f2b496eb1 100644 --- a/ee/tabby-webserver/ui/playground.html +++ b/ee/tabby-webserver/ui/playground.html @@ -1 +1 @@ -Tabby - Playground
\ No newline at end of file +Tabby - Playground
\ No newline at end of file diff --git a/ee/tabby-webserver/ui/playground.txt b/ee/tabby-webserver/ui/playground.txt index 044bdffaa68d..e5d69ff00243 100644 --- a/ee/tabby-webserver/ui/playground.txt +++ b/ee/tabby-webserver/ui/playground.txt @@ -1,7 +1,7 @@ 1:HL["/_next/static/media/86fdec36ddd9097e-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 2:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 3:HL["/_next/static/css/83506ffe28f4b91c.css","style"] -0:["y8UTfVMfS3WRo-O_Ue2fm",[[["",{"children":["playground",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/83506ffe28f4b91c.css","precedence":"next"}]],"$L5"]]]] +0:["mnxnTVxz0_SgSNkjMXene",[[["",{"children":["playground",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/83506ffe28f4b91c.css","precedence":"next"}]],"$L5"]]]] 6:I{"id":5925,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Toaster","async":false} 7:I{"id":78495,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Providers","async":false} 8:I{"id":11486,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Header","async":false} diff --git a/ee/tabby-webserver/ui/swagger.html b/ee/tabby-webserver/ui/swagger.html index 5d2eb0e3dede..ae03cf85dbac 100644 --- a/ee/tabby-webserver/ui/swagger.html +++ b/ee/tabby-webserver/ui/swagger.html @@ -1 +1 @@ -API
\ No newline at end of file +API
\ No newline at end of file diff --git a/ee/tabby-webserver/ui/swagger.txt b/ee/tabby-webserver/ui/swagger.txt index c0f11411c5cc..4fcf09334667 100644 --- a/ee/tabby-webserver/ui/swagger.txt +++ b/ee/tabby-webserver/ui/swagger.txt @@ -1,7 +1,7 @@ 1:HL["/_next/static/media/86fdec36ddd9097e-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 2:HL["/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 3:HL["/_next/static/css/83506ffe28f4b91c.css","style"] -0:["y8UTfVMfS3WRo-O_Ue2fm",[[["",{"children":["(dashboard)",{"children":["swagger",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/83506ffe28f4b91c.css","precedence":"next"}]],"$L5"]]]] +0:["mnxnTVxz0_SgSNkjMXene",[[["",{"children":["(dashboard)",{"children":["swagger",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],"$L4",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/83506ffe28f4b91c.css","precedence":"next"}]],"$L5"]]]] 6:I{"id":5925,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Toaster","async":false} 7:I{"id":78495,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Providers","async":false} 8:I{"id":11486,"chunks":["882:static/chunks/882-5574357230a12cf9.js","576:static/chunks/576-75ac7546de3029d6.js","197:static/chunks/197-f00b4479a1649cf2.js","396:static/chunks/396-89319c375c83667c.js","967:static/chunks/967-f02728ac0b1b01a8.js","185:static/chunks/app/layout-7d7d333b8349675e.js"],"name":"Header","async":false} From cae8e5ae7ed8510a05b4b0f3a09850fe02900183 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 15:08:29 -0800 Subject: [PATCH 07/24] fix: mark tabby-ui as yarn managed --- ee/tabby-ui/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ee/tabby-ui/package.json b/ee/tabby-ui/package.json index f8b81a24d911..08083db90a3e 100644 --- a/ee/tabby-ui/package.json +++ b/ee/tabby-ui/package.json @@ -70,6 +70,5 @@ "tailwindcss": "^3.3.1", "tailwindcss-animate": "^1.0.5", "typescript": "^5.1.3" - }, - "packageManager": "pnpm@8.6.3" + } } From e3bd652909efc7076c096a07870e7b15dc0d609a Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 15:21:47 -0800 Subject: [PATCH 08/24] fix: rust build caused by 1.74.0 release (#819) --- .github/workflows/ci.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 154115a74d00..9701a15a838d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.73.0 - name: Sccache cache uses: mozilla-actions/sccache-action@v0.0.3 diff --git a/Dockerfile b/Dockerfile index d76ecf50b473..1b796b3a03c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # setup rust. -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y +RUN curl https://sh.rustup.rs -sSf | bash -s -- --default-toolchain 1.73.0 -y ENV PATH="/root/.cargo/bin:${PATH}" WORKDIR /root/workspace From 9d0f449adf9d00b47ecbbd1b91c7f9388c97306c Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 15:45:47 -0800 Subject: [PATCH 09/24] chore: exclude experimental directory for language stats --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 0585b18f7a05..e3607a475187 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,4 @@ website/** linguist-vendored clients/** linguist-vendored ee/tabby-ui/** linguist-vendored crates/tabby/ui/** linguist-vendored +experimental/** linguist-vendored From f2955172f8fcd9d349e584acfcfa41dded5432e7 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 15:50:27 -0800 Subject: [PATCH 10/24] chore: exclude ee/tabby-webserver/ui to language stats --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index e3607a475187..33ac82d4d9a4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,5 +2,5 @@ website/** linguist-vendored clients/** linguist-vendored ee/tabby-ui/** linguist-vendored -crates/tabby/ui/** linguist-vendored +ee/tabby-webserver/ui/** linguist-vendored experimental/** linguist-vendored From 15e130c6743a4d95d33dd259f74515d12e42be60 Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 18 Nov 2023 10:08:07 +0800 Subject: [PATCH 11/24] fix: move db path, fix compile error (#820) --- crates/tabby/src/services/model.rs | 2 +- ee/tabby-webserver/src/db.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/tabby/src/services/model.rs b/crates/tabby/src/services/model.rs index 8b3568136a79..8c5bd484f2f0 100644 --- a/crates/tabby/src/services/model.rs +++ b/crates/tabby/src/services/model.rs @@ -14,7 +14,7 @@ pub async fn load_text_generation( parallelism: u8, ) -> (Arc, PromptInfo) { #[cfg(feature = "experimental-http")] - if args.device == crate::serve::Device::ExperimentalHttp { + if device == &Device::ExperimentalHttp { let (engine, prompt_template) = http_api_bindings::create(model_id); return ( engine, diff --git a/ee/tabby-webserver/src/db.rs b/ee/tabby-webserver/src/db.rs index 46c61ae2072e..57d820cdf6a6 100644 --- a/ee/tabby-webserver/src/db.rs +++ b/ee/tabby-webserver/src/db.rs @@ -21,8 +21,10 @@ lazy_static! { ),]); } -fn db_file() -> PathBuf { - tabby_root().join("db.sqlite3") +async fn db_path() -> Result { + let db_dir = tabby_root().join("ee"); + tokio::fs::create_dir_all(db_dir.clone()).await?; + Ok(db_dir.join("db.sqlite")) } pub struct DbConn { @@ -31,7 +33,8 @@ pub struct DbConn { impl DbConn { pub async fn new() -> Result { - let conn = Connection::open(db_file()).await?; + let db_path = db_path().await?; + let conn = Connection::open(db_path).await?; Self::init_db(conn).await } From 400a5c1b63388a8e3ba30eb533bba6031dbf94bc Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Sat, 18 Nov 2023 12:33:59 +0800 Subject: [PATCH 12/24] feat(vscode): Add dont-show-again for warnings. Add online help links. (#821) --- clients/vscode/package.json | 10 +- clients/vscode/src/TabbyCompletionProvider.ts | 10 +- clients/vscode/src/TabbyStatusBarItem.ts | 38 +++++- clients/vscode/src/commands.ts | 124 ++++++++++++++++-- clients/vscode/src/extension.ts | 6 +- clients/vscode/src/notifications.ts | 60 ++++++--- 6 files changed, 194 insertions(+), 54 deletions(-) diff --git a/clients/vscode/package.json b/clients/vscode/package.json index be8a3a18c3eb..716582f9c141 100644 --- a/clients/vscode/package.json +++ b/clients/vscode/package.json @@ -57,6 +57,14 @@ { "command": "tabby.gettingStarted", "title": "Tabby: Getting Started" + }, + { + "command": "tabby.openOnlineHelp", + "title": "Tabby: Online Help" + }, + { + "command": "tabby.notifications.resetMuted", + "title": "Tabby: Reset notifications marked as \"Don't Show Again\"" } ], "menus": { @@ -147,7 +155,7 @@ "tabby.usage.anonymousUsageTracking": { "type": "boolean", "default": false, - "markdownDescription": "**Disable anonymous usage tracking** \nTabby collects aggregated anonymous usage data and sends it to the Tabby team to help improve our products. \nYour code, generated completions, or any identifying information is never tracked or transmitted. \nFor more details on data collection, please check our [online documentation](https://tabby.tabbyml.com/docs/extensions/configuration#usage-collection)." + "markdownDescription": "**Disable anonymous usage tracking** \nTabby collects aggregated anonymous usage data and sends it to the Tabby team to help improve our products. \nYour code, generated completions, or any identifying information is never tracked or transmitted. \nFor more details on data collection, please check our [online documentation](https://tabby.tabbyml.com/docs/extensions/configurations#usage-collection)." } } }, diff --git a/clients/vscode/src/TabbyCompletionProvider.ts b/clients/vscode/src/TabbyCompletionProvider.ts index 0cfbe0098945..a9b08df2f25d 100644 --- a/clients/vscode/src/TabbyCompletionProvider.ts +++ b/clients/vscode/src/TabbyCompletionProvider.ts @@ -14,20 +14,12 @@ import { CompletionRequest, CompletionResponse, LogEventRequest } from "tabby-ag import { agent } from "./agent"; export class TabbyCompletionProvider extends EventEmitter implements InlineCompletionItemProvider { - static instance: TabbyCompletionProvider; - static getInstance(): TabbyCompletionProvider { - if (!TabbyCompletionProvider.instance) { - TabbyCompletionProvider.instance = new TabbyCompletionProvider(); - } - return TabbyCompletionProvider.instance; - } - private triggerMode: "automatic" | "manual" | "disabled" = "automatic"; private onGoingRequestAbortController: AbortController | null = null; private loading: boolean = false; private latestCompletions: CompletionResponse | null = null; - private constructor() { + public constructor() { super(); this.updateConfiguration(); workspace.onDidChangeConfiguration((event) => { diff --git a/clients/vscode/src/TabbyStatusBarItem.ts b/clients/vscode/src/TabbyStatusBarItem.ts index d3f6473a71e5..28cfe0358d00 100644 --- a/clients/vscode/src/TabbyStatusBarItem.ts +++ b/clients/vscode/src/TabbyStatusBarItem.ts @@ -1,4 +1,4 @@ -import { StatusBarAlignment, ThemeColor, window } from "vscode"; +import { StatusBarAlignment, ThemeColor, ExtensionContext, window } from "vscode"; import { createMachine, interpret } from "@xstate/fsm"; import type { StatusChangedEvent, AuthRequiredEvent, IssuesUpdatedEvent } from "tabby-agent"; import { agent } from "./agent"; @@ -20,13 +20,26 @@ const backgroundColorWarning = new ThemeColor("statusBarItem.warningBackground") export class TabbyStatusBarItem { private item = window.createStatusBarItem(StatusBarAlignment.Right); + private extensionContext: ExtensionContext; private completionProvider: TabbyCompletionProvider; private completionResponseWarningShown = false; private subStatusForReady = [ { target: "issuesExist", - cond: () => agent().getIssues().length > 0, + cond: () => { + let issues = agent().getIssues(); + if ( + this.extensionContext.globalState + .get("notifications.muted", []) + .includes("completionResponseTimeIssues") + ) { + issues = issues.filter( + (issue) => issue !== "highCompletionTimeoutRate" && issue !== "slowCompletionResponseTime", + ); + } + return issues.length > 0; + }, }, { target: "automatic", @@ -126,18 +139,20 @@ export class TabbyStatusBarItem { private fsmService = interpret(this.fsm); - constructor(completionProvider: TabbyCompletionProvider) { + constructor(context: ExtensionContext, completionProvider: TabbyCompletionProvider) { + this.extensionContext = context; this.completionProvider = completionProvider; this.fsmService.start(); this.fsmService.send(agent().getStatus()); this.item.show(); this.completionProvider.on("triggerModeUpdated", () => { - this.fsmService.send(agent().getStatus()); + this.refresh(); }); this.completionProvider.on("loadingStatusUpdated", () => { - this.fsmService.send(agent().getStatus()); + this.refresh(); }); + agent().on("statusChanged", (event: StatusChangedEvent) => { console.debug("Tabby agent statusChanged", { event }); this.fsmService.send(event.status); @@ -158,12 +173,17 @@ export class TabbyStatusBarItem { agent().on("issuesUpdated", (event: IssuesUpdatedEvent) => { console.debug("Tabby agent issuesUpdated", { event }); this.fsmService.send(agent().getStatus()); + const showCompletionResponseWarnings = + !this.completionResponseWarningShown && + !this.extensionContext.globalState + .get("notifications.muted", []) + .includes("completionResponseTimeIssues"); if (event.issues.includes("connectionFailed")) { notifications.showInformationWhenDisconnected(); - } else if (!this.completionResponseWarningShown && event.issues.includes("highCompletionTimeoutRate")) { + } else if (showCompletionResponseWarnings && event.issues.includes("highCompletionTimeoutRate")) { this.completionResponseWarningShown = true; notifications.showInformationWhenHighCompletionTimeoutRate(); - } else if (!this.completionResponseWarningShown && event.issues.includes("slowCompletionResponseTime")) { + } else if (showCompletionResponseWarnings && event.issues.includes("slowCompletionResponseTime")) { this.completionResponseWarningShown = true; notifications.showInformationWhenSlowCompletionResponseTime(); } @@ -174,6 +194,10 @@ export class TabbyStatusBarItem { return this.item; } + public refresh() { + this.fsmService.send(agent().getStatus()); + } + private toInitializing() { this.item.color = colorNormal; this.item.backgroundColor = backgroundColorNormal; diff --git a/clients/vscode/src/commands.ts b/clients/vscode/src/commands.ts index cfe8377cc81a..d3de4cfc0959 100644 --- a/clients/vscode/src/commands.ts +++ b/clients/vscode/src/commands.ts @@ -3,6 +3,8 @@ import { InputBoxValidationSeverity, ProgressLocation, Uri, + ThemeIcon, + ExtensionContext, workspace, window, env, @@ -12,6 +14,7 @@ import { strict as assert } from "assert"; import { agent } from "./agent"; import { notifications } from "./notifications"; import { TabbyCompletionProvider } from "./TabbyCompletionProvider"; +import { TabbyStatusBarItem } from "./TabbyStatusBarItem"; const configTarget = ConfigurationTarget.Global; @@ -175,24 +178,114 @@ const acceptInlineCompletion: Command = { }, }; -const acceptInlineCompletionNextWord: Command = { - command: "tabby.inlineCompletion.acceptNextWord", - callback: () => { - TabbyCompletionProvider.getInstance().postEvent("accept_word"); - commands.executeCommand("editor.action.inlineSuggest.acceptNextWord"); - }, +const acceptInlineCompletionNextWord = (completionProvider: TabbyCompletionProvider): Command => { + return { + command: "tabby.inlineCompletion.acceptNextWord", + callback: () => { + completionProvider.postEvent("accept_word"); + commands.executeCommand("editor.action.inlineSuggest.acceptNextWord"); + }, + }; }; -const acceptInlineCompletionNextLine: Command = { - command: "tabby.inlineCompletion.acceptNextLine", +const acceptInlineCompletionNextLine = (completionProvider: TabbyCompletionProvider): Command => { + return { + command: "tabby.inlineCompletion.acceptNextLine", + callback: () => { + completionProvider.postEvent("accept_line"); + // FIXME: this command move cursor to next line, but we want to move cursor to the end of current line + commands.executeCommand("editor.action.inlineSuggest.acceptNextLine"); + }, + }; +}; + +const openOnlineHelp: Command = { + command: "tabby.openOnlineHelp", callback: () => { - TabbyCompletionProvider.getInstance().postEvent("accept_line"); - // FIXME: this command move cursor to next line, but we want to move cursor to the end of current line - commands.executeCommand("editor.action.inlineSuggest.acceptNextLine"); + window + .showQuickPick([ + { + label: "Online Documentation", + iconPath: new ThemeIcon("book"), + alwaysShow: true, + }, + { + label: "Model Registry", + description: "Explore more recommend models from Tabby's model registry", + iconPath: new ThemeIcon("library"), + alwaysShow: true, + }, + { + label: "Tabby Slack Community", + description: "Join Tabby's Slack community to get help or feed back", + iconPath: new ThemeIcon("comment-discussion"), + alwaysShow: true, + }, + { + label: "Tabby GitHub Repository", + description: "View the source code for Tabby, and open issues", + iconPath: new ThemeIcon("github"), + alwaysShow: true, + }, + ]) + .then((selection) => { + if (selection) { + switch (selection.label) { + case "Online Documentation": + env.openExternal(Uri.parse("https://tabby.tabbyml.com/")); + break; + case "Model Registry": + env.openExternal(Uri.parse("https://tabby.tabbyml.com/docs/models/")); + break; + case "Tabby Slack Community": + env.openExternal( + Uri.parse("https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA"), + ); + break; + case "Tabby GitHub Repository": + env.openExternal(Uri.parse("https://github.com/tabbyml/tabby")); + break; + } + } + }); }, }; -export const tabbyCommands = () => +const muteNotifications = (context: ExtensionContext, statusBarItem: TabbyStatusBarItem): Command => { + return { + command: "tabby.notifications.mute", + callback: (type: string) => { + const notifications = context.globalState.get("notifications.muted", []); + notifications.push(type); + context.globalState.update("notifications.muted", notifications); + statusBarItem.refresh(); + }, + }; +}; + +const resetMutedNotifications = (context: ExtensionContext, statusBarItem: TabbyStatusBarItem): Command => { + return { + command: "tabby.notifications.resetMuted", + callback: (type?: string) => { + const notifications = context.globalState.get("notifications.muted", []); + if (type) { + context.globalState.update( + "notifications.muted", + notifications.filter((t) => t !== type), + ); + } else { + context.globalState.update("notifications.muted", []); + } + statusBarItem.refresh(); + }, + }; +}; + +export const tabbyCommands = ( + context: ExtensionContext, + completionProvider: TabbyCompletionProvider, + statusBarItem: TabbyStatusBarItem, +) => [ toggleInlineCompletionTriggerMode, setApiEndpoint, @@ -204,6 +297,9 @@ export const tabbyCommands = () => applyCallback, triggerInlineCompletion, acceptInlineCompletion, - acceptInlineCompletionNextWord, - acceptInlineCompletionNextLine, + acceptInlineCompletionNextWord(completionProvider), + acceptInlineCompletionNextLine(completionProvider), + openOnlineHelp, + muteNotifications(context, statusBarItem), + resetMutedNotifications(context, statusBarItem), ].map((command) => commands.registerCommand(command.command, command.callback, command.thisArg)); diff --git a/clients/vscode/src/extension.ts b/clients/vscode/src/extension.ts index 8804628f4bd5..c98caafc3a34 100644 --- a/clients/vscode/src/extension.ts +++ b/clients/vscode/src/extension.ts @@ -11,12 +11,12 @@ import { TabbyStatusBarItem } from "./TabbyStatusBarItem"; export async function activate(context: ExtensionContext) { console.debug("Activating Tabby extension", new Date()); await createAgentInstance(context); - const completionProvider = TabbyCompletionProvider.getInstance(); - const statusBarItem = new TabbyStatusBarItem(completionProvider); + const completionProvider = new TabbyCompletionProvider(); + const statusBarItem = new TabbyStatusBarItem(context, completionProvider); context.subscriptions.push( languages.registerInlineCompletionItemProvider({ pattern: "**" }, completionProvider), statusBarItem.register(), - ...tabbyCommands(), + ...tabbyCommands(context, completionProvider, statusBarItem), ); } diff --git a/clients/vscode/src/notifications.ts b/clients/vscode/src/notifications.ts index 3c34614cc837..fd6023c00050 100644 --- a/clients/vscode/src/notifications.ts +++ b/clients/vscode/src/notifications.ts @@ -1,4 +1,4 @@ -import { commands, window, workspace, env, ConfigurationTarget, Uri } from "vscode"; +import { commands, window, workspace, ConfigurationTarget } from "vscode"; import type { HighCompletionTimeoutRateIssue, SlowCompletionResponseTimeIssue, @@ -100,9 +100,13 @@ function showInformationWhenDisconnected(modal: boolean = false) { detail: message, }, "Settings", + "Online Help...", ) .then((selection) => { switch (selection) { + case "Online Help...": + commands.executeCommand("tabby.openOnlineHelp"); + break; case "Settings": commands.executeCommand("tabby.openSettings"); break; @@ -165,7 +169,7 @@ function getHelpMessageForCompletionResponseTimeIssue() { helpMessageForRunningLargeModelOnCPU += `Your Tabby server is running model ${serverHealthState?.model} on CPU. ` + "This model may be performing poorly due to its large parameter size, please consider trying smaller models or switch to GPU. " + - "You can find a list of supported models in the model directory.\n"; + "You can find a list of recommend models in the online documentation.\n"; } let commonHelpMessage = ""; const host = new URL(agent().getConfig().server.endpoint).host; @@ -174,7 +178,7 @@ function getHelpMessageForCompletionResponseTimeIssue() { serverHealthState?.model ?? "" } may be performing poorly due to its large parameter size. `; commonHelpMessage += - "Please consider trying smaller models. You can find a list of supported models in the model directory.\n"; + "Please consider trying smaller models. You can find a list of recommend models in the online documentation.\n"; } if (!(host.startsWith("localhost") || host.startsWith("127.0.0.1"))) { commonHelpMessage += " - A poor network connection. Please check your network and proxy settings.\n"; @@ -212,18 +216,22 @@ function showInformationWhenSlowCompletionResponseTime(modal: boolean = false) { modal: true, detail: statsMessage + getHelpMessageForCompletionResponseTimeIssue(), }, - "Model Directory", + "Online Help...", + "Don't Show Again", ) .then((selection) => { switch (selection) { - case "Model Directory": - env.openExternal(Uri.parse("https://tabby.tabbyml.com/docs/models/")); + case "Online Help...": + commands.executeCommand("tabby.openOnlineHelp"); + break; + case "Don't Show Again": + commands.executeCommand("tabby.notifications.mute", "completionResponseTimeIssues"); break; } }); } else { window - .showWarningMessage("Completion requests appear to take too much time.", "Detail", "Settings") + .showWarningMessage("Completion requests appear to take too much time.", "Detail", "Settings", "Don't Show Again") .then((selection) => { switch (selection) { case "Detail": @@ -232,6 +240,9 @@ function showInformationWhenSlowCompletionResponseTime(modal: boolean = false) { case "Settings": commands.executeCommand("tabby.openSettings"); break; + case "Don't Show Again": + commands.executeCommand("tabby.notifications.mute", "completionResponseTimeIssues"); + break; } }); } @@ -252,26 +263,35 @@ function showInformationWhenHighCompletionTimeoutRate(modal: boolean = false) { modal: true, detail: statsMessage + getHelpMessageForCompletionResponseTimeIssue(), }, - "Model Directory", + "Online Help...", + "Don't Show Again", ) .then((selection) => { switch (selection) { - case "Model Directory": - env.openExternal(Uri.parse("https://tabby.tabbyml.com/docs/models/")); + case "Online Help...": + commands.executeCommand("tabby.openOnlineHelp"); + break; + case "Don't Show Again": + commands.executeCommand("tabby.notifications.mute", "completionResponseTimeIssues"); break; } }); } else { - window.showWarningMessage("Most completion requests timed out.", "Detail", "Settings").then((selection) => { - switch (selection) { - case "Detail": - showInformationWhenHighCompletionTimeoutRate(true); - break; - case "Settings": - commands.executeCommand("tabby.openSettings"); - break; - } - }); + window + .showWarningMessage("Most completion requests timed out.", "Detail", "Settings", "Don't Show Again") + .then((selection) => { + switch (selection) { + case "Detail": + showInformationWhenHighCompletionTimeoutRate(true); + break; + case "Settings": + commands.executeCommand("tabby.openSettings"); + break; + case "Don't Show Again": + commands.executeCommand("tabby.notifications.mute", "completionResponseTimeIssues"); + break; + } + }); } } From 7dfd139977904341c66ff6ac6eaf49c72a56a7bc Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 22:50:58 -0800 Subject: [PATCH 13/24] refactor: delete contrib/jetson/Dockerfile as it's no longer compatible post 0.5 feel free to sending pr of adding it back if you get it work with llama.cpp based docker image --- contrib/jetson/Dockerfile | 54 --------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 contrib/jetson/Dockerfile diff --git a/contrib/jetson/Dockerfile b/contrib/jetson/Dockerfile deleted file mode 100644 index 4d4a031e4636..000000000000 --- a/contrib/jetson/Dockerfile +++ /dev/null @@ -1,54 +0,0 @@ -FROM nvcr.io/nvidia/l4t-cuda:11.4.19-devel as builder - -ENV DEBIAN_FRONTEND=noninteractive -# Use kitware's repo to make sure CMake is newer than 3.26, which is required by CTranslate2 -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null |\ - gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' |\ - tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - curl \ - pkg-config \ - libssl-dev \ - libcudnn8-dev \ - protobuf-compiler \ - git \ - cmake \ - && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# setup rust. -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -WORKDIR /root/workspace -COPY . . - -RUN mkdir -p /opt/tabby/bin -RUN mkdir -p /opt/tabby/lib -RUN mkdir -p target - -RUN --mount=type=cache,target=/usr/local/cargo/registry \ - --mount=type=cache,target=/root/workspace/target \ - cargo build --features link_static_cuda --release && \ - cp target/release/tabby /opt/tabby/bin/ - -FROM nvcr.io/nvidia/l4t-cuda:11.4.19-runtime - -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - git libcudnn8 tini && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Disable safe directory in docker -# Context: https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 -RUN git config --system --add safe.directory "*" - -COPY --from=builder /opt/tabby /opt/tabby - -ENV TABBY_ROOT=/data - -ENTRYPOINT ["/usr/bin/tini", "--", "/opt/tabby/bin/tabby"] From 9121763b70ade035a9f43bf0cfaed8246b1f25fe Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Sat, 18 Nov 2023 15:59:12 +0800 Subject: [PATCH 14/24] feat(vim): update tabby-agent. (#824) --- clients/vim/.gitattributes | 1 + clients/vim/node_scripts/tabby-agent.js | 196 ++++++++---------- .../vim/node_scripts/wasm/tree-sitter-go.wasm | 3 + .../node_scripts/wasm/tree-sitter-python.wasm | 3 + .../node_scripts/wasm/tree-sitter-ruby.wasm | 3 + .../node_scripts/wasm/tree-sitter-rust.wasm | 3 + .../node_scripts/wasm/tree-sitter-tsx.wasm | 3 + .../vim/node_scripts/wasm/tree-sitter.wasm | 3 + clients/vim/package.json | 2 +- 9 files changed, 108 insertions(+), 109 deletions(-) create mode 100644 clients/vim/.gitattributes create mode 100644 clients/vim/node_scripts/wasm/tree-sitter-go.wasm create mode 100644 clients/vim/node_scripts/wasm/tree-sitter-python.wasm create mode 100644 clients/vim/node_scripts/wasm/tree-sitter-ruby.wasm create mode 100644 clients/vim/node_scripts/wasm/tree-sitter-rust.wasm create mode 100644 clients/vim/node_scripts/wasm/tree-sitter-tsx.wasm create mode 100644 clients/vim/node_scripts/wasm/tree-sitter.wasm diff --git a/clients/vim/.gitattributes b/clients/vim/.gitattributes new file mode 100644 index 000000000000..5f2fd032fb30 --- /dev/null +++ b/clients/vim/.gitattributes @@ -0,0 +1 @@ +*.wasm filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/clients/vim/node_scripts/tabby-agent.js b/clients/vim/node_scripts/tabby-agent.js index e97017abee12..b8294eb97aba 100755 --- a/clients/vim/node_scripts/tabby-agent.js +++ b/clients/vim/node_scripts/tabby-agent.js @@ -9,59 +9,60 @@ var promises = require('fs/promises'); var path = require('path'); var util = require('util'); var events = require('events'); -var ZE = require('crypto'); +var fE = require('crypto'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } -var ZE__default = /*#__PURE__*/_interopDefault(ZE); +var fE__default = /*#__PURE__*/_interopDefault(fE); -var KE=Object.create;var Dn=Object.defineProperty;var VE=Object.getOwnPropertyDescriptor;var YE=Object.getOwnPropertyNames;var JE=Object.getPrototypeOf,XE=Object.prototype.hasOwnProperty;var QE=(t,e,r)=>e in t?Dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var z=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var qi=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wo=(t,e)=>{for(var r in e)Dn(t,r,{get:e[r],enumerable:!0});},Cf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YE(e))!XE.call(t,s)&&s!==r&&Dn(t,s,{get:()=>e[s],enumerable:!(n=VE(e,s))||n.enumerable});return t};var Nn=(t,e,r)=>(r=t!=null?KE(JE(t)):{},Cf(e||!t||!t.__esModule?Dn(r,"default",{value:t,enumerable:!0}):r,t)),zo=t=>Cf(Dn({},"__esModule",{value:!0}),t);var ne=(t,e,r)=>(QE(t,typeof e!="symbol"?e+"":e,r),r),Go=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var S=(t,e,r)=>(Go(t,e,"read from private field"),r?r.call(t):e.get(t)),ae=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r);},re=(t,e,r,n)=>(Go(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Di=(t,e,r,n)=>({set _(s){re(t,e,s,r);},get _(){return S(t,e,n)}}),ee=(t,e,r)=>(Go(t,e,"access private method"),r);var Yo=R((Lq,Pf)=>{var Of=Object.prototype.toString;Pf.exports=function(e){var r=Of.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Of.call(e.callee)==="[object Function]"),n};});var Nf=R((Fq,Df)=>{var qf;Object.keys||(Mn=Object.prototype.hasOwnProperty,Jo=Object.prototype.toString,Tf=Yo(),Xo=Object.prototype.propertyIsEnumerable,$f=!Xo.call({toString:null},"toString"),If=Xo.call(function(){},"prototype"),jn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ji=function(t){var e=t.constructor;return e&&e.prototype===t},kf={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Lf=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!kf["$"+t]&&Mn.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{ji(window[t]);}catch{return !0}}catch{return !0}return !1}(),Ff=function(t){if(typeof window>"u"||!Lf)return ji(t);try{return ji(t)}catch{return !1}},qf=function(e){var r=e!==null&&typeof e=="object",n=Jo.call(e)==="[object Function]",s=Tf(e),i=r&&Jo.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var l=If&&n;if(i&&e.length>0&&!Mn.call(e,0))for(var c=0;c0)for(var p=0;p{var rA=Array.prototype.slice,nA=Yo(),Mf=Object.keys,Bi=Mf?function(e){return Mf(e)}:Nf(),jf=Object.keys;Bi.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return nA(n)?jf(rA.call(n)):jf(n)});}else Object.keys=Bi;return Object.keys||Bi};Bf.exports=Bi;});var Ui=R((Dq,Hf)=>{Hf.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==s||o.enumerable!==!0)return !1}return !0};});var Qo=R((Nq,Wf)=>{var Uf=typeof Symbol<"u"&&Symbol,iA=Ui();Wf.exports=function(){return typeof Uf!="function"||typeof Symbol!="function"||typeof Uf("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:iA()};});var Kf=R((Mq,Gf)=>{var zf={foo:{}},sA=Object;Gf.exports=function(){return {__proto__:zf}.foo===zf.foo&&!({__proto__:null}instanceof sA)};});var Yf=R((jq,Vf)=>{var oA="Function.prototype.bind called on incompatible ",Zo=Array.prototype.slice,aA=Object.prototype.toString,lA="[object Function]";Vf.exports=function(e){var r=this;if(typeof r!="function"||aA.call(r)!==lA)throw new TypeError(oA+r);for(var n=Zo.call(arguments,1),s,i=function(){if(this instanceof s){var u=r.apply(this,n.concat(Zo.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(Zo.call(arguments)))},o=Math.max(0,r.length-n.length),l=[],c=0;c{var uA=Yf();Jf.exports=Function.prototype.bind||uA;});var Qf=R((Hq,Xf)=>{var cA=Wi();Xf.exports=cA.call(Function.call,Object.prototype.hasOwnProperty);});var kt=R((Uq,nh)=>{var fe,Xr=SyntaxError,rh=Function,Jr=TypeError,ea=function(t){try{return rh('"use strict"; return ('+t+").constructor;")()}catch{}},_r=Object.getOwnPropertyDescriptor;var ta=function(){throw new Jr},fA=_r?function(){try{return ta}catch{try{return _r(arguments,"callee").get}catch{return ta}}}():ta,Vr=Qo()(),hA=Kf()(),Ie=Object.getPrototypeOf||(hA?function(t){return t.__proto__}:null),Yr={},pA=typeof Uint8Array>"u"||!Ie?fe:Ie(Uint8Array),xr={"%AggregateError%":typeof AggregateError>"u"?fe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?fe:ArrayBuffer,"%ArrayIteratorPrototype%":Vr&&Ie?Ie([][Symbol.iterator]()):fe,"%AsyncFromSyncIteratorPrototype%":fe,"%AsyncFunction%":Yr,"%AsyncGenerator%":Yr,"%AsyncGeneratorFunction%":Yr,"%AsyncIteratorPrototype%":Yr,"%Atomics%":typeof Atomics>"u"?fe:Atomics,"%BigInt%":typeof BigInt>"u"?fe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?fe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?fe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?fe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?fe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?fe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?fe:FinalizationRegistry,"%Function%":rh,"%GeneratorFunction%":Yr,"%Int8Array%":typeof Int8Array>"u"?fe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?fe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?fe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vr&&Ie?Ie(Ie([][Symbol.iterator]())):fe,"%JSON%":typeof JSON=="object"?JSON:fe,"%Map%":typeof Map>"u"?fe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vr||!Ie?fe:Ie(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?fe:Promise,"%Proxy%":typeof Proxy>"u"?fe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?fe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?fe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vr||!Ie?fe:Ie(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?fe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vr&&Ie?Ie(""[Symbol.iterator]()):fe,"%Symbol%":Vr?Symbol:fe,"%SyntaxError%":Xr,"%ThrowTypeError%":fA,"%TypedArray%":pA,"%TypeError%":Jr,"%Uint8Array%":typeof Uint8Array>"u"?fe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?fe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?fe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?fe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?fe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?fe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?fe:WeakSet};var dA=function t(e){var r;if(e==="%AsyncFunction%")r=ea("async function () {}");else if(e==="%GeneratorFunction%")r=ea("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ea("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Ie&&(r=Ie(s.prototype));}return xr[e]=r,r},eh={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Bn=Wi(),zi=Qf(),gA=Bn.call(Function.call,Array.prototype.concat),yA=Bn.call(Function.apply,Array.prototype.splice),th=Bn.call(Function.call,String.prototype.replace),Gi=Bn.call(Function.call,String.prototype.slice),mA=Bn.call(Function.call,RegExp.prototype.exec),vA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wA=/\\(\\)?/g,SA=function(e){var r=Gi(e,0,1),n=Gi(e,-1);if(r==="%"&&n!=="%")throw new Xr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xr("invalid intrinsic syntax, expected opening `%`");var s=[];return th(e,vA,function(i,o,l,c){s[s.length]=l?th(c,wA,"$1"):o||i;}),s},bA=function(e,r){var n=e,s;if(zi(eh,n)&&(s=eh[n],n="%"+s[0]+"%"),zi(xr,n)){var i=xr[n];if(i===Yr&&(i=dA(n)),typeof i>"u"&&!r)throw new Jr("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new Xr("intrinsic "+e+" does not exist!")};nh.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Jr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Jr('"allowMissing" argument must be a boolean');if(mA(/^%?[^%]*%?$/,e)===null)throw new Xr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SA(e),s=n.length>0?n[0]:"",i=bA("%"+s+"%",r),o=i.name,l=i.value,c=!1,p=i.alias;p&&(s=p[0],yA(n,gA([0,1],p)));for(var u=1,g=!0;u=n.length){var b=_r(l,y);g=!!b,g&&"get"in b&&!("originalValue"in b.get)?l=b.get:l=l[y];}else g=zi(l,y),l=l[y];g&&!c&&(xr[o]=l);}}return l};});var Ki=R((Wq,ih)=>{var EA=kt(),ra=EA("%Object.defineProperty%",!0),na=function(){if(ra)try{return ra({},"a",{value:1}),!0}catch{return !1}return !1};na.hasArrayLengthDefineBug=function(){if(!na())return null;try{return ra([],"length",{value:1}).length!==1}catch{return !0}};ih.exports=na;});var ia=R((zq,sh)=>{var AA=kt(),Vi=AA("%Object.getOwnPropertyDescriptor%",!0);if(Vi)try{Vi([],"length");}catch{Vi=null;}sh.exports=Vi;});var oa=R((Gq,lh)=>{var _A=Ki()(),sa=kt(),oh=_A&&sa("%Object.defineProperty%",!0),xA=sa("%SyntaxError%"),Qr=sa("%TypeError%"),ah=ia();lh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Qr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qr("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!ah&&ah(e,r);if(oh)oh(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:i===null&&c?c.writable:!i});else if(l||!s&&!i&&!o)e[r]=n;else throw new xA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var rr=R((Kq,hh)=>{var CA=Hi(),RA=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",OA=Object.prototype.toString,PA=Array.prototype.concat,uh=oa(),TA=function(t){return typeof t=="function"&&OA.call(t)==="[object Function]"},ch=Ki()(),$A=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!TA(n)||!n())return}ch?uh(t,e,r,!0):uh(t,e,r);},fh=function(t,e){var r=arguments.length>2?arguments[2]:{},n=CA(e);RA&&(n=PA.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s{var aa=Wi(),Zr=kt(),gh=Zr("%Function.prototype.apply%"),yh=Zr("%Function.prototype.call%"),mh=Zr("%Reflect.apply%",!0)||aa.call(yh,gh),ph=Zr("%Object.getOwnPropertyDescriptor%",!0),Cr=Zr("%Object.defineProperty%",!0),IA=Zr("%Math.max%");if(Cr)try{Cr({},"a",{value:1});}catch{Cr=null;}Yi.exports=function(e){var r=mh(aa,yh,arguments);if(ph&&Cr){var n=ph(r,"length");n.configurable&&Cr(r,"length",{value:1+IA(0,e.length-(arguments.length-1))});}return r};var dh=function(){return mh(aa,gh,arguments)};Cr?Cr(Yi.exports,"apply",{value:dh}):Yi.exports.apply=dh;});var mt=R((Yq,Sh)=>{var vh=kt(),wh=Rr(),kA=wh(vh("String.prototype.indexOf"));Sh.exports=function(e,r){var n=vh(e,!!r);return typeof n=="function"&&kA(e,".prototype.")>-1?wh(n):n};});var la=R((Jq,xh)=>{var LA=Hi(),Ah=Ui()(),_h=mt(),bh=Object,FA=_h("Array.prototype.push"),Eh=_h("Object.prototype.propertyIsEnumerable"),qA=Ah?Object.getOwnPropertySymbols:null;xh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=bh(e);if(arguments.length===1)return n;for(var s=1;s{var ua=la(),DA=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var MA=rr(),jA=ca();Rh.exports=function(){var e=jA();return MA(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var Ih=R((Zq,$h)=>{var BA=rr(),HA=Rr(),UA=la(),Ph=ca(),WA=Oh(),zA=HA.apply(Ph()),Th=function(e,r){return zA(Object,arguments)};BA(Th,{getPolyfill:Ph,implementation:UA,shim:WA});$h.exports=Th;});var Lh=R((eD,kh)=>{var Un=function(){return typeof function(){}.name=="string"},Hn=Object.getOwnPropertyDescriptor;Un.functionsHaveConfigurableNames=function(){if(!Un()||!Hn)return !1;var e=Hn(function(){},"name");return !!e&&!!e.configurable};var GA=Function.prototype.bind;Un.boundFunctionsHaveNames=function(){return Un()&&typeof GA=="function"&&function(){}.bind().name!==""};kh.exports=Un;});var Dh=R((tD,qh)=>{var Fh=oa(),KA=Ki()(),VA=Lh().functionsHaveConfigurableNames(),YA=TypeError;qh.exports=function(e,r){if(typeof e!="function")throw new YA("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||VA)&&(KA?Fh(e,"name",r,!0,!0):Fh(e,"name",r)),e};});var fa=R((rD,Nh)=>{var JA=Dh(),XA=Object,QA=TypeError;Nh.exports=JA(function(){if(this!=null&&this!==XA(this))throw new QA("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var ha=R((nD,Mh)=>{var ZA=fa(),e_=rr().supportsDescriptors,t_=Object.getOwnPropertyDescriptor;Mh.exports=function(){if(e_&&/a/mig.flags==="gim"){var e=t_(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return ZA};});var Hh=R((iD,Bh)=>{var r_=rr().supportsDescriptors,n_=ha(),i_=Object.getOwnPropertyDescriptor,s_=Object.defineProperty,o_=TypeError,jh=Object.getPrototypeOf,a_=/a/;Bh.exports=function(){if(!r_||!jh)throw new o_("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=n_(),r=jh(a_),n=i_(r,"flags");return (!n||n.get!==e)&&s_(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var Gh=R((sD,zh)=>{var l_=rr(),u_=Rr(),c_=fa(),Uh=ha(),f_=Hh(),Wh=u_(Uh());l_(Wh,{getPolyfill:Uh,implementation:c_,shim:f_});zh.exports=Wh;});var Yh=R((oD,Vh)=>{var Kh=Symbol.iterator;Vh.exports=function(e){if(e!=null&&typeof e[Kh]<"u")return e[Kh]()};});var Xh=R((aD,Jh)=>{Jh.exports=z("util").inspect;});var mp=R((lD,yp)=>{var Ea=typeof Map=="function"&&Map.prototype,pa=Object.getOwnPropertyDescriptor&&Ea?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xi=Ea&&pa&&typeof pa.get=="function"?pa.get:null,Qh=Ea&&Map.prototype.forEach,Aa=typeof Set=="function"&&Set.prototype,da=Object.getOwnPropertyDescriptor&&Aa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qi=Aa&&da&&typeof da.get=="function"?da.get:null,Zh=Aa&&Set.prototype.forEach,h_=typeof WeakMap=="function"&&WeakMap.prototype,zn=h_?WeakMap.prototype.has:null,p_=typeof WeakSet=="function"&&WeakSet.prototype,Gn=p_?WeakSet.prototype.has:null,d_=typeof WeakRef=="function"&&WeakRef.prototype,ep=d_?WeakRef.prototype.deref:null,g_=Boolean.prototype.valueOf,y_=Object.prototype.toString,m_=Function.prototype.toString,v_=String.prototype.match,_a=String.prototype.slice,ir=String.prototype.replace,w_=String.prototype.toUpperCase,tp=String.prototype.toLowerCase,cp=RegExp.prototype.test,rp=Array.prototype.concat,Lt=Array.prototype.join,S_=Array.prototype.slice,np=Math.floor,ma=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ga=Object.getOwnPropertySymbols,va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,en=typeof Symbol=="function"&&typeof Symbol.iterator=="object",We=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===en||"symbol")?Symbol.toStringTag:null,fp=Object.prototype.propertyIsEnumerable,ip=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function sp(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||cp.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-np(-t):np(t);if(n!==t){var s=String(n),i=_a.call(e,s.length+1);return ir.call(s,r,"$&_")+"."+ir.call(ir.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ir.call(e,r,"$&_")}var wa=Xh(),op=wa.custom,ap=pp(op)?op:null;yp.exports=function t(e,r,n,s){var i=r||{};if(nr(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(nr(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=nr(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(nr(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(nr(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return gp(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?sp(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return l?sp(e,p):p}var u=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return Sa(e)?"[Array]":"[Object]";var g=N_(i,n);if(typeof s>"u")s=[];else if(dp(s,e)>=0)return "[Circular]";function y(Y,se,T){if(se&&(s=S_.call(s),s.push(se)),T){var $={depth:i.depth};return nr(i,"quoteStyle")&&($.quoteStyle=i.quoteStyle),t(Y,$,n+1,s)}return t(Y,i,n+1,s)}if(typeof e=="function"&&!lp(e)){var m=P_(e),v=Ji(e,y);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(v.length>0?" { "+Lt.call(v,", ")+" }":"")}if(pp(e)){var b=en?ir.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):va.call(e);return typeof e=="object"&&!en?Wn(b):b}if(F_(e)){for(var _="<"+tp.call(String(e.nodeName)),x=e.attributes||[],A=0;A",_}if(Sa(e)){if(e.length===0)return "[]";var O=Ji(e,y);return g&&!D_(O)?"["+ba(O,g)+"]":"[ "+Lt.call(O,", ")+" ]"}if(A_(e)){var I=Ji(e,y);return !("cause"in Error.prototype)&&"cause"in e&&!fp.call(e,"cause")?"{ ["+String(e)+"] "+Lt.call(rp.call("[cause]: "+y(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Lt.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ap&&typeof e[ap]=="function"&&wa)return wa(e,{depth:u-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(T_(e)){var F=[];return Qh&&Qh.call(e,function(Y,se){F.push(y(se,e,!0)+" => "+y(Y,e));}),up("Map",Xi.call(e),F,g)}if(k_(e)){var U=[];return Zh&&Zh.call(e,function(Y){U.push(y(Y,e));}),up("Set",Qi.call(e),U,g)}if($_(e))return ya("WeakMap");if(L_(e))return ya("WeakSet");if(I_(e))return ya("WeakRef");if(x_(e))return Wn(y(Number(e)));if(R_(e))return Wn(y(ma.call(e)));if(C_(e))return Wn(g_.call(e));if(__(e))return Wn(y(String(e)));if(!E_(e)&&!lp(e)){var H=Ji(e,y),q=ip?ip(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",j=!q&&We&&Object(e)===e&&We in e?_a.call(sr(e),8,-1):k?"Object":"",C=q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=C+(j||k?"["+Lt.call(rp.call([],j||[],k||[]),": ")+"] ":"");return H.length===0?V+"{}":g?V+"{"+ba(H,g)+"}":V+"{ "+Lt.call(H,", ")+" }"}return String(e)};function hp(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function b_(t){return ir.call(String(t),/"/g,""")}function Sa(t){return sr(t)==="[object Array]"&&(!We||!(typeof t=="object"&&We in t))}function E_(t){return sr(t)==="[object Date]"&&(!We||!(typeof t=="object"&&We in t))}function lp(t){return sr(t)==="[object RegExp]"&&(!We||!(typeof t=="object"&&We in t))}function A_(t){return sr(t)==="[object Error]"&&(!We||!(typeof t=="object"&&We in t))}function __(t){return sr(t)==="[object String]"&&(!We||!(typeof t=="object"&&We in t))}function x_(t){return sr(t)==="[object Number]"&&(!We||!(typeof t=="object"&&We in t))}function C_(t){return sr(t)==="[object Boolean]"&&(!We||!(typeof t=="object"&&We in t))}function pp(t){if(en)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!va)return !1;try{return va.call(t),!0}catch{}return !1}function R_(t){if(!t||typeof t!="object"||!ma)return !1;try{return ma.call(t),!0}catch{}return !1}var O_=Object.prototype.hasOwnProperty||function(t){return t in this};function nr(t,e){return O_.call(t,e)}function sr(t){return y_.call(t)}function P_(t){if(t.name)return t.name;var e=v_.call(m_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function dp(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return gp(_a.call(t,0,e.maxStringLength),e)+n}var s=ir.call(ir.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q_);return hp(s,"single",e)}function q_(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w_.call(e.toString(16))}function Wn(t){return "Object("+t+")"}function ya(t){return t+" { ? }"}function up(t,e,r,n){var s=n?ba(r,n):Lt.call(r,", ");return t+" ("+e+") {"+s+"}"}function D_(t){for(var e=0;e=0)return !1;return !0}function N_(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Lt.call(Array(t.indent+1)," ");else return null;return {base:r,prev:Lt.call(Array(e+1),r)}}function ba(t,e){if(t.length===0)return "";var r=` -`+e.prev+e.base;return r+Lt.call(t,","+r)+` -`+e.prev}function Ji(t,e){var r=Sa(t),n=[];if(r){n.length=t.length;for(var s=0;s{var xa=kt(),tn=mt(),M_=mp(),j_=xa("%TypeError%"),Zi=xa("%WeakMap%",!0),es=xa("%Map%",!0),B_=tn("WeakMap.prototype.get",!0),H_=tn("WeakMap.prototype.set",!0),U_=tn("WeakMap.prototype.has",!0),W_=tn("Map.prototype.get",!0),z_=tn("Map.prototype.set",!0),G_=tn("Map.prototype.has",!0),Ca=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},K_=function(t,e){var r=Ca(t,e);return r&&r.value},V_=function(t,e,r){var n=Ca(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},Y_=function(t,e){return !!Ca(t,e)};vp.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new j_("Side channel does not contain "+M_(i))},get:function(i){if(Zi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return B_(e,i)}else if(es){if(r)return W_(r,i)}else if(n)return K_(n,i)},has:function(i){if(Zi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return U_(e,i)}else if(es){if(r)return G_(r,i)}else if(n)return Y_(n,i);return !1},set:function(i,o){Zi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Zi),H_(e,i,o)):es?(r||(r=new es),z_(r,i,o)):(n||(n={key:{},next:null}),V_(n,i,o));}};return s};});var Ra=R((cD,bp)=>{var Sp=function(t){return t!==t};bp.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Sp(e)&&Sp(r))};});var Oa=R((fD,Ep)=>{var J_=Ra();Ep.exports=function(){return typeof Object.is=="function"?Object.is:J_};});var _p=R((hD,Ap)=>{var X_=Oa(),Q_=rr();Ap.exports=function(){var e=X_();return Q_(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var Op=R((pD,Rp)=>{var Z_=rr(),ex=Rr(),tx=Ra(),xp=Oa(),rx=_p(),Cp=ex(xp(),Object);Z_(Cp,{getPolyfill:xp,implementation:tx,shim:rx});Rp.exports=Cp;});var or=R((dD,Pp)=>{var nx=Ui();Pp.exports=function(){return nx()&&!!Symbol.toStringTag};});var Ip=R((gD,$p)=>{var ix=or()(),sx=mt(),Pa=sx("Object.prototype.toString"),ts=function(e){return ix&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Pa(e)==="[object Arguments]"},Tp=function(e){return ts(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Pa(e)!=="[object Array]"&&Pa(e.callee)==="[object Function]"},ox=function(){return ts(arguments)}();ts.isLegacyArguments=Tp;$p.exports=ox?ts:Tp;});var Lp=R((yD,kp)=>{var ax={}.toString;kp.exports=Array.isArray||function(t){return ax.call(t)=="[object Array]"};});var Np=R((mD,Dp)=>{var qp=Function.prototype.toString,rn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,$a,rs;if(typeof rn=="function"&&typeof Object.defineProperty=="function")try{$a=Object.defineProperty({},"length",{get:function(){throw rs}}),rs={},rn(function(){throw 42},null,$a);}catch(t){t!==rs&&(rn=null);}else rn=null;var lx=/^\s*class\b/,Ia=function(e){try{var r=qp.call(e);return lx.test(r)}catch{return !1}},Ta=function(e){try{return Ia(e)?!1:(qp.call(e),!0)}catch{return !1}},ns=Object.prototype.toString,ux="[object Object]",cx="[object Function]",fx="[object GeneratorFunction]",hx="[object HTMLAllCollection]",px="[object HTML document.all class]",dx="[object HTMLCollection]",gx=typeof Symbol=="function"&&!!Symbol.toStringTag,yx=!(0 in[,]),ka=function(){return !1};typeof document=="object"&&(Fp=document.all,ns.call(Fp)===ns.call(document.all)&&(ka=function(e){if((yx||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ns.call(e);return (r===hx||r===px||r===dx||r===ux)&&e("")==null}catch{}return !1}));var Fp;Dp.exports=rn?function(e){if(ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{rn(e,null,$a);}catch(r){if(r!==rs)return !1}return !Ia(e)&&Ta(e)}:function(e){if(ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(gx)return Ta(e);if(Ia(e))return !1;var r=ns.call(e);return r!==cx&&r!==fx&&!/^\[object HTML/.test(r)?!1:Ta(e)};});var Bp=R((vD,jp)=>{var mx=Np(),vx=Object.prototype.toString,Mp=Object.prototype.hasOwnProperty,wx=function(e,r,n){for(var s=0,i=e.length;s=3&&(s=n),vx.call(e)==="[object Array]"?wx(e,r,s):typeof e=="string"?Sx(e,r,s):bx(e,r,s);};jp.exports=Ex;});var Up=R((wD,Hp)=>{var La=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],Ax=typeof globalThis>"u"?global:globalThis;Hp.exports=function(){for(var e=[],r=0;r{var ss=Bp(),_x=Up(),Wp=Rr(),Da=mt(),is=ia(),xx=Da("Object.prototype.toString"),Gp=or()(),zp=typeof globalThis>"u"?global:globalThis,qa=_x(),Na=Da("String.prototype.slice"),Fa=Object.getPrototypeOf,Cx=Da("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:Ox(e)}return is?Rx(e):null};});var Yp=R((bD,Vp)=>{var Px=Ma();Vp.exports=function(e){return !!Px(e)};});var ja=R((ED,td)=>{var Tx=Rr(),$x=mt(),ed=kt(),Ix=Yp(),Jp=ed("ArrayBuffer",!0),Xp=ed("Float32Array",!0),as=$x("ArrayBuffer.prototype.byteLength",!0),Qp=Jp&&!as&&new Jp().slice,Zp=Qp&&Tx(Qp);td.exports=as||Zp?function(e){if(!e||typeof e!="object")return !1;try{return as?as(e):Zp(e,0),!0}catch{return !1}}:Xp?function(e){try{return new Xp(e).buffer===e&&!Ix(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var nd=R((AD,rd)=>{var kx=Date.prototype.getDay,Lx=function(e){try{return kx.call(e),!0}catch{return !1}},Fx=Object.prototype.toString,qx="[object Date]",Dx=or()();rd.exports=function(e){return typeof e!="object"||e===null?!1:Dx?Lx(e):Fx.call(e)===qx};});var ld=R((_D,ad)=>{var Ba=mt(),id=or()(),sd,od,Ha,Ua;id&&(sd=Ba("Object.prototype.hasOwnProperty"),od=Ba("RegExp.prototype.exec"),Ha={},ls=function(){throw Ha},Ua={toString:ls,valueOf:ls},typeof Symbol.toPrimitive=="symbol"&&(Ua[Symbol.toPrimitive]=ls));var ls,Nx=Ba("Object.prototype.toString"),Mx=Object.getOwnPropertyDescriptor,jx="[object RegExp]";ad.exports=id?function(e){if(!e||typeof e!="object")return !1;var r=Mx(e,"lastIndex"),n=r&&sd(r,"value");if(!n)return !1;try{od(e,Ua);}catch(s){return s===Ha}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:Nx(e)===jx};});var fd=R((xD,cd)=>{var Bx=mt(),ud=Bx("SharedArrayBuffer.prototype.byteLength",!0);cd.exports=ud?function(e){if(!e||typeof e!="object")return !1;try{return ud(e),!0}catch{return !1}}:function(e){return !1};});var pd=R((CD,hd)=>{var Hx=String.prototype.valueOf,Ux=function(e){try{return Hx.call(e),!0}catch{return !1}},Wx=Object.prototype.toString,zx="[object String]",Gx=or()();hd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:Gx?Ux(e):Wx.call(e)===zx};});var gd=R((RD,dd)=>{var Kx=Number.prototype.toString,Vx=function(e){try{return Kx.call(e),!0}catch{return !1}},Yx=Object.prototype.toString,Jx="[object Number]",Xx=or()();dd.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:Xx?Vx(e):Yx.call(e)===Jx};});var vd=R((OD,md)=>{var yd=mt(),Qx=yd("Boolean.prototype.toString"),Zx=yd("Object.prototype.toString"),eC=function(e){try{return Qx(e),!0}catch{return !1}},tC="[object Boolean]",rC=or()();md.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:rC&&Symbol.toStringTag in e?eC(e):Zx(e)===tC};});var Ed=R((PD,Wa)=>{var nC=Object.prototype.toString,iC=Qo()();iC?(wd=Symbol.prototype.toString,Sd=/^Symbol\(.*\)$/,bd=function(e){return typeof e.valueOf()!="symbol"?!1:Sd.test(wd.call(e))},Wa.exports=function(e){if(typeof e=="symbol")return !0;if(nC.call(e)!=="[object Symbol]")return !1;try{return bd(e)}catch{return !1}}):Wa.exports=function(e){return !1};var wd,Sd,bd;});var xd=R((TD,_d)=>{var Ad=typeof BigInt<"u"&&BigInt;_d.exports=function(){return typeof Ad=="function"&&typeof BigInt=="function"&&typeof Ad(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var Od=R(($D,za)=>{var sC=xd()();sC?(Cd=BigInt.prototype.valueOf,Rd=function(e){try{return Cd.call(e),!0}catch{}return !1},za.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Rd(e)}):za.exports=function(e){return !1};var Cd,Rd;});var Td=R((ID,Pd)=>{var oC=pd(),aC=gd(),lC=vd(),uC=Ed(),cC=Od();Pd.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(oC(e))return "String";if(aC(e))return "Number";if(lC(e))return "Boolean";if(uC(e))return "Symbol";if(cC(e))return "BigInt"};});var Ld=R((kD,kd)=>{var Ga=typeof Map=="function"&&Map.prototype?Map:null,fC=typeof Set=="function"&&Set.prototype?Set:null,us;Ga||(us=function(e){return !1});var Id=Ga?Map.prototype.has:null,$d=fC?Set.prototype.has:null;!us&&!Id&&(us=function(e){return !1});kd.exports=us||function(e){if(!e||typeof e!="object")return !1;try{if(Id.call(e),$d)try{$d.call(e);}catch{return !0}return e instanceof Ga}catch{}return !1};});var Nd=R((LD,Dd)=>{var hC=typeof Map=="function"&&Map.prototype?Map:null,Ka=typeof Set=="function"&&Set.prototype?Set:null,cs;Ka||(cs=function(e){return !1});var Fd=hC?Map.prototype.has:null,qd=Ka?Set.prototype.has:null;!cs&&!qd&&(cs=function(e){return !1});Dd.exports=cs||function(e){if(!e||typeof e!="object")return !1;try{if(qd.call(e),Fd)try{Fd.call(e);}catch{return !0}return e instanceof Ka}catch{}return !1};});var Bd=R((FD,jd)=>{var fs=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Md=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,hs;fs||(hs=function(e){return !1});var Ya=fs?fs.prototype.has:null,Va=Md?Md.prototype.has:null;!hs&&!Ya&&(hs=function(e){return !1});jd.exports=hs||function(e){if(!e||typeof e!="object")return !1;try{if(Ya.call(e,Ya),Va)try{Va.call(e,Va);}catch{return !0}return e instanceof fs}catch{}return !1};});var Ud=R((qD,Xa)=>{var pC=kt(),Hd=mt(),dC=pC("%WeakSet%",!0),Ja=Hd("WeakSet.prototype.has",!0);Ja?(ps=Hd("WeakMap.prototype.has",!0),Xa.exports=function(e){if(!e||typeof e!="object")return !1;try{if(Ja(e,Ja),ps)try{ps(e,ps);}catch{return !0}return e instanceof dC}catch{}return !1}):Xa.exports=function(e){return !1};var ps;});var zd=R((DD,Wd)=>{var gC=Ld(),yC=Nd(),mC=Bd(),vC=Ud();Wd.exports=function(e){if(e&&typeof e=="object"){if(gC(e))return "Map";if(yC(e))return "Set";if(mC(e))return "WeakMap";if(vC(e))return "WeakSet"}return !1};});var Vd=R((ND,Kd)=>{var wC=mt(),Gd=wC("ArrayBuffer.prototype.byteLength",!0),SC=ja();Kd.exports=function(e){return SC(e)?Gd?Gd(e):e.byteLength:NaN};});var wg=R((MD,vg)=>{var gg=Ih(),Ft=mt(),Yd=Gh(),bC=kt(),nn=Yh(),EC=wp(),Jd=Op(),Xd=Ip(),Qd=Lp(),Zd=ja(),eg=nd(),tg=ld(),rg=fd(),ng=Hi(),ig=Td(),sg=zd(),og=Ma(),ag=Vd(),lg=Ft("SharedArrayBuffer.prototype.byteLength",!0),ug=Ft("Date.prototype.getTime"),Qa=Object.getPrototypeOf,cg=Ft("Object.prototype.toString"),gs=bC("%Set%",!0),Za=Ft("Map.prototype.has",!0),ys=Ft("Map.prototype.get",!0),fg=Ft("Map.prototype.size",!0),ms=Ft("Set.prototype.add",!0),yg=Ft("Set.prototype.delete",!0),vs=Ft("Set.prototype.has",!0),ds=Ft("Set.prototype.size",!0);function hg(t,e,r,n){for(var s=nn(t),i;(i=s.next())&&!i.done;)if(bt(e,i.value,r,n))return yg(t,i.value),!0;return !1}function mg(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function AC(t,e,r,n,s,i){var o=mg(r);if(o!=null)return o;var l=ys(e,o),c=gg({},s,{strict:!1});return typeof l>"u"&&!Za(e,o)||!bt(n,l,c,i)?!1:!Za(t,o)&&bt(n,l,c,i)}function _C(t,e,r){var n=mg(r);return n??(vs(e,n)&&!vs(t,n))}function pg(t,e,r,n,s,i){for(var o=nn(t),l,c;(l=o.next())&&!l.done;)if(c=l.value,bt(r,c,s,i)&&bt(n,ys(e,c),s,i))return yg(t,c),!0;return !1}function bt(t,e,r,n){var s=r||{};if(s.strict?Jd(t,e):t===e)return !0;var i=ig(t),o=ig(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?Jd(t,e):t==e;var l=n.has(t),c=n.has(e),p;if(l&&c){if(n.get(t)===n.get(e))return !0}else p={};return l||n.set(t,p),c||n.set(e,p),RC(t,e,s,n)}function dg(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function xC(t,e,r,n){if(ds(t)!==ds(e))return !1;for(var s=nn(t),i=nn(e),o,l,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new gs),ms(c,o.value);else if(!vs(e,o.value)){if(r.strict||!_C(t,e,o.value))return !1;c||(c=new gs),ms(c,o.value);}if(c){for(;(l=i.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!hg(c,l.value,r.strict,n))return !1}else if(!r.strict&&!vs(t,l.value)&&!hg(c,l.value,r.strict,n))return !1;return ds(c)===0}return !0}function CC(t,e,r,n){if(fg(t)!==fg(e))return !1;for(var s=nn(t),i=nn(e),o,l,c,p,u,g;(o=s.next())&&!o.done;)if(p=o.value[0],u=o.value[1],p&&typeof p=="object")c||(c=new gs),ms(c,p);else if(g=ys(e,p),typeof g>"u"&&!Za(e,p)||!bt(u,g,r,n)){if(r.strict||!AC(t,e,p,u,r,n))return !1;c||(c=new gs),ms(c,p);}if(c){for(;(l=i.next())&&!l.done;)if(p=l.value[0],g=l.value[1],p&&typeof p=="object"){if(!pg(c,t,p,g,r,n))return !1}else if(!r.strict&&(!t.has(p)||!bt(ys(t,p),g,r,n))&&!pg(c,t,p,g,gg({},r,{strict:!1}),n))return !1;return ds(c)===0}return !0}function RC(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||cg(t)!==cg(e)||Xd(t)!==Xd(e))return !1;var o=Qd(t),l=Qd(e);if(o!==l)return !1;var c=t instanceof Error,p=e instanceof Error;if(c!==p||(c||p)&&(t.name!==e.name||t.message!==e.message))return !1;var u=tg(t),g=tg(e);if(u!==g||(u||g)&&(t.source!==e.source||Yd(t)!==Yd(e)))return !1;var y=eg(t),m=eg(e);if(y!==m||(y||m)&&ug(t)!==ug(e)||r.strict&&Qa&&Qa(t)!==Qa(e))return !1;var v=og(t),b=og(e);if(v!==b)return !1;if(v||b){if(t.length!==e.length)return !1;for(s=0;s=0;s--)if(U[s]!=H[s])return !1;for(s=U.length-1;s>=0;s--)if(i=U[s],!bt(t[i],e[i],r,n))return !1;var q=sg(t),k=sg(e);return q!==k?!1:q==="Set"||k==="Set"?xC(t,e,r,n):q==="Map"?CC(t,e,r,n):!0}vg.exports=function(e,r,n){return bt(e,r,n,EC())};});var $g={};Wo($g,{closest:()=>XC,distance:()=>Tg});var Wt,YC,JC,Tg,XC,Ig=qi(()=>{Wt=new Uint32Array(65536),YC=(t,e)=>{let r=t.length,n=e.length,s=1<{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),l=Math.ceil(n/32);for(let v=0;v>>A&1,F=s[A/32|0]>>>A&1,U=O|v,H=((O|F)&b)+b^b|O|F,q=v|~(H|b),k=b&H;q>>>31^I&&(i[A/32|0]^=1<>>31^F&&(s[A/32|0]^=1<>>v&1,x=s[v/32|0]>>>v&1,A=b|p,O=((b|x)&u)+u^u|b|x,I=p|~(O|u),F=u&O;m+=I>>>n-1&1,m-=F>>>n-1&1,I>>>31^_&&(i[v/32|0]^=1<>>31^x&&(s[v/32|0]^=1<{if(t.length{let r=1/0,n=0;for(let s=0;s{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(Ig(),zo($g)),r=[],n=[],s={get:function(i,o,l){var c=l&&t&&l.useCollator;if(c){var p=i.length,u=o.length;if(p===0)return u;if(u===0)return p;var g,y,m,v,b;for(m=0;mb&&(y=b),b=r[v+1]+1,y>b&&(y=b),r[v]=g;r[v]=y;}return y}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof Vn<"u"&&Vn!==null&&typeof il<"u"&&Vn.exports===il?Vn.exports=s:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=s:typeof window<"u"&&window!==null&&(window.Levenshtein=s);})();});var Jn=qi(()=>{});var Xe=R(ol=>{ol.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{t.call(this,...e,(s,i)=>s!=null?n(s):r(i));})},"name",{value:t.name})};ol.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);t.apply(this,e.slice(0,-1)).then(n=>r(null,n),r);},"name",{value:t.name})};});var jg=R((VD,Mg)=>{var lr=z("constants"),eR=process.cwd,_s=null,tR=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return _s||(_s=eR.call(process)),_s};try{process.cwd();}catch{}typeof process.chdir=="function"&&(al=process.chdir,process.chdir=function(t){_s=null,al.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,al));var al;Mg.exports=rR;function rR(t){lr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,g,y){y&&process.nextTick(y);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,g,y,m){m&&process.nextTick(m);},t.lchownSync=function(){}),tR==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function g(y,m,v){var b=Date.now(),_=0;u(y,m,function x(A){if(A&&(A.code==="EACCES"||A.code==="EPERM"||A.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(m,function(O,I){O&&O.code==="ENOENT"?u(y,m,x):v(A);});},_),_<100&&(_+=10);return}v&&v(A);});}return Object.setPrototypeOf&&Object.setPrototypeOf(g,u),g}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function g(y,m,v,b,_,x){var A;if(x&&typeof x=="function"){var O=0;A=function(I,F,U){if(I&&I.code==="EAGAIN"&&O<10)return O++,u.call(t,y,m,v,b,_,A);x.apply(this,arguments);};}return u.call(t,y,m,v,b,_,A)}return Object.setPrototypeOf&&Object.setPrototypeOf(g,u),g}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(g,y,m,v,b){for(var _=0;;)try{return u.call(t,g,y,m,v,b)}catch(x){if(x.code==="EAGAIN"&&_<10){_++;continue}throw x}}}(t.readSync);function e(u){u.lchmod=function(g,y,m){u.open(g,lr.O_WRONLY|lr.O_SYMLINK,y,function(v,b){if(v){m&&m(v);return}u.fchmod(b,y,function(_){u.close(b,function(x){m&&m(_||x);});});});},u.lchmodSync=function(g,y){var m=u.openSync(g,lr.O_WRONLY|lr.O_SYMLINK,y),v=!0,b;try{b=u.fchmodSync(m,y),v=!1;}finally{if(v)try{u.closeSync(m);}catch{}else u.closeSync(m);}return b};}function r(u){lr.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(g,y,m,v){u.open(g,lr.O_SYMLINK,function(b,_){if(b){v&&v(b);return}u.futimes(_,y,m,function(x){u.close(_,function(A){v&&v(x||A);});});});},u.lutimesSync=function(g,y,m){var v=u.openSync(g,lr.O_SYMLINK),b,_=!0;try{b=u.futimesSync(v,y,m),_=!1;}finally{if(_)try{u.closeSync(v);}catch{}else u.closeSync(v);}return b}):u.futimes&&(u.lutimes=function(g,y,m,v){v&&process.nextTick(v);},u.lutimesSync=function(){});}function n(u){return u&&function(g,y,m){return u.call(t,g,y,function(v){p(v)&&(v=null),m&&m.apply(this,arguments);})}}function s(u){return u&&function(g,y){try{return u.call(t,g,y)}catch(m){if(!p(m))throw m}}}function i(u){return u&&function(g,y,m,v){return u.call(t,g,y,m,function(b){p(b)&&(b=null),v&&v.apply(this,arguments);})}}function o(u){return u&&function(g,y,m){try{return u.call(t,g,y,m)}catch(v){if(!p(v))throw v}}}function l(u){return u&&function(g,y,m){typeof y=="function"&&(m=y,y=null);function v(b,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),m&&m.apply(this,arguments);}return y?u.call(t,g,y,v):u.call(t,g,v)}}function c(u){return u&&function(g,y){var m=y?u.call(t,g,y):u.call(t,g);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function p(u){if(!u||u.code==="ENOSYS")return !0;var g=!process.getuid||process.getuid()!==0;return !!(g&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ug=R((YD,Hg)=>{var Bg=z("stream").Stream;Hg.exports=nR;function nR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Bg.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),l=0,c=o.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(u,g){if(u){i.emit("error",u),i.readable=!1;return}i.fd=g,i.emit("open",g),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);Bg.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,l=i.length;o= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var zg=R((JD,Wg)=>{Wg.exports=sR;var iR=Object.getPrototypeOf||function(t){return t.__proto__};function sR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:iR(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Qe=R((XD,cl)=>{var Ae=z("fs"),oR=jg(),aR=Ug(),lR=zg(),xs=z("util"),He,Rs;typeof Symbol=="function"&&typeof Symbol.for=="function"?(He=Symbol.for("graceful-fs.queue"),Rs=Symbol.for("graceful-fs.previous")):(He="___graceful-fs.queue",Rs="___graceful-fs.previous");function uR(){}function Vg(t,e){Object.defineProperty(t,He,{get:function(){return e}});}var Pr=uR;xs.debuglog?Pr=xs.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Pr=function(){var t=xs.format.apply(xs,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t);});Ae[He]||(Gg=global[He]||[],Vg(Ae,Gg),Ae.close=function(t){function e(r,n){return t.call(Ae,r,function(s){s||Kg(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,Rs,{value:t}),e}(Ae.close),Ae.closeSync=function(t){function e(r){t.apply(Ae,arguments),Kg();}return Object.defineProperty(e,Rs,{value:t}),e}(Ae.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Pr(Ae[He]),z("assert").equal(Ae[He].length,0);}));var Gg;global[He]||Vg(global,Ae[He]);cl.exports=ll(lR(Ae));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ae.__patched&&(cl.exports=ll(Ae),Ae.__patched=!0);function ll(t){oR(t),t.gracefulify=ll,t.createReadStream=F,t.createWriteStream=U;var e=t.readFile;t.readFile=r;function r(k,j,C){return typeof j=="function"&&(C=j,j=null),V(k,j,C);function V(Y,se,T,$){return e(Y,se,function(te){te&&(te.code==="EMFILE"||te.code==="ENFILE")?ln([V,[Y,se,T],te,$||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return n(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return i(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var l=t.copyFile;l&&(t.copyFile=c);function c(k,j,C,V){return typeof C=="function"&&(V=C,C=0),Y(k,j,C,V);function Y(se,T,$,te,Q){return l(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var p=t.readdir;t.readdir=g;var u=/^v[0-5]\./;function g(k,j,C){typeof j=="function"&&(C=j,j=null);var V=u.test(process.version)?function(T,$,te,Q){return p(T,Y(T,$,te,Q))}:function(T,$,te,Q){return p(T,$,Y(T,$,te,Q))};return V(k,j,C);function Y(se,T,$,te){return function(Q,ue){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?ln([V,[se,T,$],Q,te||Date.now(),Date.now()]):(ue&&ue.sort&&ue.sort(),typeof $=="function"&&$.call(this,Q,ue));}}}if(process.version.substr(0,4)==="v0.8"){var y=aR(t);x=y.ReadStream,O=y.WriteStream;}var m=t.ReadStream;m&&(x.prototype=Object.create(m.prototype),x.prototype.open=A);var v=t.WriteStream;v&&(O.prototype=Object.create(v.prototype),O.prototype.open=I),Object.defineProperty(t,"ReadStream",{get:function(){return x},set:function(k){x=k;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(k){O=k;},enumerable:!0,configurable:!0});var b=x;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(k){b=k;},enumerable:!0,configurable:!0});var _=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return _},set:function(k){_=k;},enumerable:!0,configurable:!0});function x(k,j){return this instanceof x?(m.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function A(){var k=this;q(k.path,k.flags,k.mode,function(j,C){j?(k.autoClose&&k.destroy(),k.emit("error",j)):(k.fd=C,k.emit("open",C),k.read());});}function O(k,j){return this instanceof O?(v.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function I(){var k=this;q(k.path,k.flags,k.mode,function(j,C){j?(k.destroy(),k.emit("error",j)):(k.fd=C,k.emit("open",C));});}function F(k,j){return new t.ReadStream(k,j)}function U(k,j){return new t.WriteStream(k,j)}var H=t.open;t.open=q;function q(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return H(se,T,$,function(ue,Ge){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}return t}function ln(t){Pr("ENQUEUE",t[0].name,t[1]),Ae[He].push(t),ul();}var Cs;function Kg(){for(var t=Date.now(),e=0;e2&&(Ae[He][e][3]=t,Ae[He][e][4]=t);ul();}function ul(){if(clearTimeout(Cs),Cs=void 0,Ae[He].length!==0){var t=Ae[He].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Pr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Pr("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var l=Date.now()-i,c=Math.max(i-s,1),p=Math.min(c*1.2,100);l>=p?(Pr("RETRY",e.name,r),e.apply(null,r.concat([s]))):Ae[He].push(t);}Cs===void 0&&(Cs=setTimeout(ul,0));}}});var Tr=R(zt=>{var Yg=Xe().fromCallback,Ke=Qe(),cR=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Ke[t]=="function");Object.assign(zt,Ke);cR.forEach(t=>{zt[t]=Yg(Ke[t]);});zt.exists=function(t,e){return typeof e=="function"?Ke.exists(t,e):new Promise(r=>Ke.exists(t,r))};zt.read=function(t,e,r,n,s,i){return typeof i=="function"?Ke.read(t,e,r,n,s,i):new Promise((o,l)=>{Ke.read(t,e,r,n,s,(c,p,u)=>{if(c)return l(c);o({bytesRead:p,buffer:u});});})};zt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Ke.write(t,e,...r):new Promise((n,s)=>{Ke.write(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesWritten:o,buffer:l});});})};zt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Ke.readv(t,e,...r):new Promise((n,s)=>{Ke.readv(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesRead:o,buffers:l});});})};zt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Ke.writev(t,e,...r):new Promise((n,s)=>{Ke.writev(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesWritten:o,buffers:l});});})};typeof Ke.realpath.native=="function"?zt.realpath.native=Yg(Ke.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var Xg=R((ZD,Jg)=>{var fR=z("path");Jg.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(fR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var ty=R((eN,fl)=>{var Qg=Tr(),{checkPath:Zg}=Xg(),ey=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};fl.exports.makeDir=async(t,e)=>(Zg(t),Qg.mkdir(t,{mode:ey(e),recursive:!0}));fl.exports.makeDirSync=(t,e)=>(Zg(t),Qg.mkdirSync(t,{mode:ey(e),recursive:!0}));});var Et=R((tN,ry)=>{var hR=Xe().fromPromise,{makeDir:pR,makeDirSync:hl}=ty(),pl=hR(pR);ry.exports={mkdirs:pl,mkdirsSync:hl,mkdirp:pl,mkdirpSync:hl,ensureDir:pl,ensureDirSync:hl};});var ur=R((rN,iy)=>{var dR=Xe().fromPromise,ny=Tr();function gR(t){return ny.access(t).then(()=>!0).catch(()=>!1)}iy.exports={pathExists:dR(gR),pathExistsSync:ny.existsSync};});var dl=R((nN,sy)=>{var un=Qe();function yR(t,e,r,n){un.open(t,"r+",(s,i)=>{if(s)return n(s);un.futimes(i,e,r,o=>{un.close(i,l=>{n&&n(o||l);});});});}function mR(t,e,r){let n=un.openSync(t,"r+");return un.futimesSync(n,e,r),un.closeSync(n)}sy.exports={utimesMillis:yR,utimesMillisSync:mR};});var $r=R((iN,ly)=>{var cn=Tr(),ke=z("path"),vR=z("util");function wR(t,e,r){let n=r.dereference?s=>cn.stat(s,{bigint:!0}):s=>cn.lstat(s,{bigint:!0});return Promise.all([n(t),n(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})]).then(([s,i])=>({srcStat:s,destStat:i}))}function SR(t,e,r){let n,s=r.dereference?o=>cn.statSync(o,{bigint:!0}):o=>cn.lstatSync(o,{bigint:!0}),i=s(t);try{n=s(e);}catch(o){if(o.code==="ENOENT")return {srcStat:i,destStat:null};throw o}return {srcStat:i,destStat:n}}function bR(t,e,r,n,s){vR.callbackify(wR)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:l,destStat:c}=o;if(c){if(Xn(l,c)){let p=ke.basename(t),u=ke.basename(e);return r==="move"&&p!==u&&p.toLowerCase()===u.toLowerCase()?s(null,{srcStat:l,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(l.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!l.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return l.isDirectory()&&gl(t,e)?s(new Error(Os(t,e,r))):s(null,{srcStat:l,destStat:c})});}function ER(t,e,r,n){let{srcStat:s,destStat:i}=SR(t,e,n);if(i){if(Xn(s,i)){let o=ke.basename(t),l=ke.basename(e);if(r==="move"&&o!==l&&o.toLowerCase()===l.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&gl(t,e))throw new Error(Os(t,e,r));return {srcStat:s,destStat:i}}function oy(t,e,r,n,s){let i=ke.resolve(ke.dirname(t)),o=ke.resolve(ke.dirname(r));if(o===i||o===ke.parse(o).root)return s();cn.stat(o,{bigint:!0},(l,c)=>l?l.code==="ENOENT"?s():s(l):Xn(e,c)?s(new Error(Os(t,r,n))):oy(t,e,o,n,s));}function ay(t,e,r,n){let s=ke.resolve(ke.dirname(t)),i=ke.resolve(ke.dirname(r));if(i===s||i===ke.parse(i).root)return;let o;try{o=cn.statSync(i,{bigint:!0});}catch(l){if(l.code==="ENOENT")return;throw l}if(Xn(e,o))throw new Error(Os(t,r,n));return ay(t,e,i,n)}function Xn(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function gl(t,e){let r=ke.resolve(t).split(ke.sep).filter(s=>s),n=ke.resolve(e).split(ke.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function Os(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}ly.exports={checkPaths:bR,checkPathsSync:ER,checkParentPaths:oy,checkParentPathsSync:ay,isSrcSubdir:gl,areIdentical:Xn};});var dy=R((sN,py)=>{var Ze=Qe(),Qn=z("path"),AR=Et().mkdirs,_R=ur().pathExists,xR=dl().utimesMillis,Zn=$r();function CR(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; +var oE=Object.create;var Hn=Object.defineProperty;var aE=Object.getOwnPropertyDescriptor;var lE=Object.getOwnPropertyNames;var uE=Object.getPrototypeOf,cE=Object.prototype.hasOwnProperty;var G=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var jn=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Js=(t,e)=>{for(var r in e)Hn(t,r,{get:e[r],enumerable:!0});},Fc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of lE(e))!cE.call(t,s)&&s!==r&&Hn(t,s,{get:()=>e[s],enumerable:!(n=aE(e,s))||n.enumerable});return t};var fr=(t,e,r)=>(r=t!=null?oE(uE(t)):{},Fc(e||!t||!t.__esModule?Hn(r,"default",{value:t,enumerable:!0}):r,t)),Xs=t=>Fc(Hn({},"__esModule",{value:!0}),t);var to=T((Yk,$c)=>{var kc=Object.prototype.toString;$c.exports=function(e){var r=kc.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&kc.call(e.callee)==="[object Function]"),n};});var zc=T((Jk,Wc)=>{var jc;Object.keys||(Yr=Object.prototype.hasOwnProperty,ro=Object.prototype.toString,Lc=to(),no=Object.prototype.propertyIsEnumerable,Dc=!no.call({toString:null},"toString"),qc=no.call(function(){},"prototype"),Jr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Gn=function(t){var e=t.constructor;return e&&e.prototype===t},Bc={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Uc=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!Bc["$"+t]&&Yr.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Gn(window[t]);}catch{return !0}}catch{return !0}return !1}(),Hc=function(t){if(typeof window>"u"||!Uc)return Gn(t);try{return Gn(t)}catch{return !1}},jc=function(e){var r=e!==null&&typeof e=="object",n=ro.call(e)==="[object Function]",s=Lc(e),i=r&&ro.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var a=qc&&n;if(i&&e.length>0&&!Yr.call(e,0))for(var c=0;c0)for(var d=0;d{var pE=Array.prototype.slice,mE=to(),Gc=Object.keys,Vn=Gc?function(e){return Gc(e)}:zc(),Vc=Object.keys;Vn.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return mE(n)?Vc(pE.call(n)):Vc(n)});}else Object.keys=Vn;return Object.keys||Vn};Kc.exports=Vn;});var Zn=T((Qk,Zc)=>{Zc.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==s||o.enumerable!==!0)return !1}return !0};});var io=T((e2,Jc)=>{var Yc=typeof Symbol<"u"&&Symbol,_E=Zn();Jc.exports=function(){return typeof Yc!="function"||typeof Symbol!="function"||typeof Yc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_E()};});var ef=T((t2,Qc)=>{var Xc={foo:{}},gE=Object;Qc.exports=function(){return {__proto__:Xc}.foo===Xc.foo&&!({__proto__:null}instanceof gE)};});var rf=T((r2,tf)=>{var yE="Function.prototype.bind called on incompatible ",so=Array.prototype.slice,wE=Object.prototype.toString,bE="[object Function]";tf.exports=function(e){var r=this;if(typeof r!="function"||wE.call(r)!==bE)throw new TypeError(yE+r);for(var n=so.call(arguments,1),s,i=function(){if(this instanceof s){var u=r.apply(this,n.concat(so.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(so.call(arguments)))},o=Math.max(0,r.length-n.length),a=[],c=0;c{var vE=rf();nf.exports=Function.prototype.bind||vE;});var of=T((i2,sf)=>{var SE=Yn();sf.exports=SE.call(Function.call,Object.prototype.hasOwnProperty);});var ct=T((s2,ff)=>{var oe,mr=SyntaxError,cf=Function,pr=TypeError,oo=function(t){try{return cf('"use strict"; return ('+t+").constructor;")()}catch{}},zt=Object.getOwnPropertyDescriptor;var ao=function(){throw new pr},EE=zt?function(){try{return ao}catch{try{return zt(arguments,"callee").get}catch{return ao}}}():ao,hr=io()(),AE=ef()(),Se=Object.getPrototypeOf||(AE?function(t){return t.__proto__}:null),dr={},xE=typeof Uint8Array>"u"||!Se?oe:Se(Uint8Array),Gt={"%AggregateError%":typeof AggregateError>"u"?oe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?oe:ArrayBuffer,"%ArrayIteratorPrototype%":hr&&Se?Se([][Symbol.iterator]()):oe,"%AsyncFromSyncIteratorPrototype%":oe,"%AsyncFunction%":dr,"%AsyncGenerator%":dr,"%AsyncGeneratorFunction%":dr,"%AsyncIteratorPrototype%":dr,"%Atomics%":typeof Atomics>"u"?oe:Atomics,"%BigInt%":typeof BigInt>"u"?oe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?oe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?oe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?oe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?oe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?oe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?oe:FinalizationRegistry,"%Function%":cf,"%GeneratorFunction%":dr,"%Int8Array%":typeof Int8Array>"u"?oe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?oe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?oe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hr&&Se?Se(Se([][Symbol.iterator]())):oe,"%JSON%":typeof JSON=="object"?JSON:oe,"%Map%":typeof Map>"u"?oe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hr||!Se?oe:Se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?oe:Promise,"%Proxy%":typeof Proxy>"u"?oe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?oe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?oe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hr||!Se?oe:Se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?oe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hr&&Se?Se(""[Symbol.iterator]()):oe,"%Symbol%":hr?Symbol:oe,"%SyntaxError%":mr,"%ThrowTypeError%":EE,"%TypedArray%":xE,"%TypeError%":pr,"%Uint8Array%":typeof Uint8Array>"u"?oe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?oe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?oe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?oe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?oe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?oe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?oe:WeakSet};var CE=function t(e){var r;if(e==="%AsyncFunction%")r=oo("async function () {}");else if(e==="%GeneratorFunction%")r=oo("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=oo("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Se&&(r=Se(s.prototype));}return Gt[e]=r,r},lf={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Xr=Yn(),Jn=of(),RE=Xr.call(Function.call,Array.prototype.concat),TE=Xr.call(Function.apply,Array.prototype.splice),uf=Xr.call(Function.call,String.prototype.replace),Xn=Xr.call(Function.call,String.prototype.slice),IE=Xr.call(Function.call,RegExp.prototype.exec),PE=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,OE=/\\(\\)?/g,ME=function(e){var r=Xn(e,0,1),n=Xn(e,-1);if(r==="%"&&n!=="%")throw new mr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new mr("invalid intrinsic syntax, expected opening `%`");var s=[];return uf(e,PE,function(i,o,a,c){s[s.length]=a?uf(c,OE,"$1"):o||i;}),s},FE=function(e,r){var n=e,s;if(Jn(lf,n)&&(s=lf[n],n="%"+s[0]+"%"),Jn(Gt,n)){var i=Gt[n];if(i===dr&&(i=CE(n)),typeof i>"u"&&!r)throw new pr("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new mr("intrinsic "+e+" does not exist!")};ff.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new pr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new pr('"allowMissing" argument must be a boolean');if(IE(/^%?[^%]*%?$/,e)===null)throw new mr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ME(e),s=n.length>0?n[0]:"",i=FE("%"+s+"%",r),o=i.name,a=i.value,c=!1,d=i.alias;d&&(s=d[0],TE(n,RE([0,1],d)));for(var u=1,p=!0;u=n.length){var v=zt(a,_);p=!!v,p&&"get"in v&&!("originalValue"in v.get)?a=v.get:a=a[_];}else p=Jn(a,_),a=a[_];p&&!c&&(Gt[o]=a);}}return a};});var Qn=T((o2,hf)=>{var NE=ct(),lo=NE("%Object.defineProperty%",!0),uo=function(){if(lo)try{return lo({},"a",{value:1}),!0}catch{return !1}return !1};uo.hasArrayLengthDefineBug=function(){if(!uo())return null;try{return lo([],"length",{value:1}).length!==1}catch{return !0}};hf.exports=uo;});var co=T((a2,df)=>{var kE=ct(),ei=kE("%Object.getOwnPropertyDescriptor%",!0);if(ei)try{ei([],"length");}catch{ei=null;}df.exports=ei;});var ho=T((l2,_f)=>{var $E=Qn()(),fo=ct(),pf=$E&&fo("%Object.defineProperty%",!0),LE=fo("%SyntaxError%"),_r=fo("%TypeError%"),mf=co();_f.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new _r("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new _r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new _r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new _r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new _r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new _r("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,c=!!mf&&mf(e,r);if(pf)pf(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:i===null&&c?c.writable:!i});else if(a||!s&&!i&&!o)e[r]=n;else throw new LE("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var Rt=T((u2,bf)=>{var DE=Kn(),qE=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",BE=Object.prototype.toString,UE=Array.prototype.concat,gf=ho(),HE=function(t){return typeof t=="function"&&BE.call(t)==="[object Function]"},yf=Qn()(),jE=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!HE(n)||!n())return}yf?gf(t,e,r,!0):gf(t,e,r);},wf=function(t,e){var r=arguments.length>2?arguments[2]:{},n=DE(e);qE&&(n=UE.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s{var po=Yn(),gr=ct(),Ef=gr("%Function.prototype.apply%"),Af=gr("%Function.prototype.call%"),xf=gr("%Reflect.apply%",!0)||po.call(Af,Ef),vf=gr("%Object.getOwnPropertyDescriptor%",!0),Vt=gr("%Object.defineProperty%",!0),WE=gr("%Math.max%");if(Vt)try{Vt({},"a",{value:1});}catch{Vt=null;}ti.exports=function(e){var r=xf(po,Af,arguments);if(vf&&Vt){var n=vf(r,"length");n.configurable&&Vt(r,"length",{value:1+WE(0,e.length-(arguments.length-1))});}return r};var Sf=function(){return xf(po,Ef,arguments)};Vt?Vt(ti.exports,"apply",{value:Sf}):ti.exports.apply=Sf;});var Qe=T((f2,Tf)=>{var Cf=ct(),Rf=Kt(),zE=Rf(Cf("String.prototype.indexOf"));Tf.exports=function(e,r){var n=Cf(e,!!r);return typeof n=="function"&&zE(e,".prototype.")>-1?Rf(n):n};});var mo=T((h2,Ff)=>{var GE=Kn(),Of=Zn()(),Mf=Qe(),If=Object,VE=Mf("Array.prototype.push"),Pf=Mf("Object.prototype.propertyIsEnumerable"),KE=Of?Object.getOwnPropertySymbols:null;Ff.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=If(e);if(arguments.length===1)return n;for(var s=1;s{var _o=mo(),ZE=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var JE=Rt(),XE=go();kf.exports=function(){var e=XE();return JE(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var Bf=T((m2,qf)=>{var QE=Rt(),e0=Kt(),t0=mo(),Lf=go(),r0=$f(),n0=e0.apply(Lf()),Df=function(e,r){return n0(Object,arguments)};QE(Df,{getPolyfill:Lf,implementation:t0,shim:r0});qf.exports=Df;});var Hf=T((_2,Uf)=>{var en=function(){return typeof function(){}.name=="string"},Qr=Object.getOwnPropertyDescriptor;en.functionsHaveConfigurableNames=function(){if(!en()||!Qr)return !1;var e=Qr(function(){},"name");return !!e&&!!e.configurable};var i0=Function.prototype.bind;en.boundFunctionsHaveNames=function(){return en()&&typeof i0=="function"&&function(){}.bind().name!==""};Uf.exports=en;});var zf=T((g2,Wf)=>{var jf=ho(),s0=Qn()(),o0=Hf().functionsHaveConfigurableNames(),a0=TypeError;Wf.exports=function(e,r){if(typeof e!="function")throw new a0("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||o0)&&(s0?jf(e,"name",r,!0,!0):jf(e,"name",r)),e};});var yo=T((y2,Gf)=>{var l0=zf(),u0=Object,c0=TypeError;Gf.exports=l0(function(){if(this!=null&&this!==u0(this))throw new c0("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var wo=T((w2,Vf)=>{var f0=yo(),h0=Rt().supportsDescriptors,d0=Object.getOwnPropertyDescriptor;Vf.exports=function(){if(h0&&/a/mig.flags==="gim"){var e=d0(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return f0};});var Yf=T((b2,Zf)=>{var p0=Rt().supportsDescriptors,m0=wo(),_0=Object.getOwnPropertyDescriptor,g0=Object.defineProperty,y0=TypeError,Kf=Object.getPrototypeOf,w0=/a/;Zf.exports=function(){if(!p0||!Kf)throw new y0("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=m0(),r=Kf(w0),n=_0(r,"flags");return (!n||n.get!==e)&&g0(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var eh=T((v2,Qf)=>{var b0=Rt(),v0=Kt(),S0=yo(),Jf=wo(),E0=Yf(),Xf=v0(Jf());b0(Xf,{getPolyfill:Jf,implementation:S0,shim:E0});Qf.exports=Xf;});var nh=T((S2,rh)=>{var th=Symbol.iterator;rh.exports=function(e){if(e!=null&&typeof e[th]<"u")return e[th]()};});var sh=T((E2,ih)=>{ih.exports=G("util").inspect;});var xh=T((A2,Ah)=>{var Io=typeof Map=="function"&&Map.prototype,bo=Object.getOwnPropertyDescriptor&&Io?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ni=Io&&bo&&typeof bo.get=="function"?bo.get:null,oh=Io&&Map.prototype.forEach,Po=typeof Set=="function"&&Set.prototype,vo=Object.getOwnPropertyDescriptor&&Po?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ii=Po&&vo&&typeof vo.get=="function"?vo.get:null,ah=Po&&Set.prototype.forEach,A0=typeof WeakMap=="function"&&WeakMap.prototype,rn=A0?WeakMap.prototype.has:null,x0=typeof WeakSet=="function"&&WeakSet.prototype,nn=x0?WeakSet.prototype.has:null,C0=typeof WeakRef=="function"&&WeakRef.prototype,lh=C0?WeakRef.prototype.deref:null,R0=Boolean.prototype.valueOf,T0=Object.prototype.toString,I0=Function.prototype.toString,P0=String.prototype.match,Oo=String.prototype.slice,It=String.prototype.replace,O0=String.prototype.toUpperCase,uh=String.prototype.toLowerCase,yh=RegExp.prototype.test,ch=Array.prototype.concat,ft=Array.prototype.join,M0=Array.prototype.slice,fh=Math.floor,Ao=typeof BigInt=="function"?BigInt.prototype.valueOf:null,So=Object.getOwnPropertySymbols,xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yr||"symbol")?Symbol.toStringTag:null,wh=Object.prototype.propertyIsEnumerable,hh=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function dh(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||yh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-fh(-t):fh(t);if(n!==t){var s=String(n),i=Oo.call(e,s.length+1);return It.call(s,r,"$&_")+"."+It.call(It.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return It.call(e,r,"$&_")}var Co=sh(),ph=Co.custom,mh=vh(ph)?ph:null;Ah.exports=function t(e,r,n,s){var i=r||{};if(Tt(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Tt(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Tt(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Tt(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Tt(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=i.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Eh(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?dh(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return a?dh(e,d):d}var u=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return Ro(e)?"[Array]":"[Object]";var p=Y0(i,n);if(typeof s>"u")s=[];else if(Sh(s,e)>=0)return "[Circular]";function _(V,te,I){if(te&&(s=M0.call(s),s.push(te)),I){var O={depth:i.depth};return Tt(i,"quoteStyle")&&(O.quoteStyle=i.quoteStyle),t(V,O,n+1,s)}return t(V,i,n+1,s)}if(typeof e=="function"&&!_h(e)){var m=U0(e),y=ri(e,_);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(y.length>0?" { "+ft.call(y,", ")+" }":"")}if(vh(e)){var v=yr?It.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):xo.call(e);return typeof e=="object"&&!yr?tn(v):v}if(V0(e)){for(var E="<"+uh.call(String(e.nodeName)),A=e.attributes||[],w=0;w",E}if(Ro(e)){if(e.length===0)return "[]";var x=ri(e,_);return p&&!Z0(x)?"["+To(x,p)+"]":"[ "+ft.call(x,", ")+" ]"}if(k0(e)){var M=ri(e,_);return !("cause"in Error.prototype)&&"cause"in e&&!wh.call(e,"cause")?"{ ["+String(e)+"] "+ft.call(ch.call("[cause]: "+_(e.cause),M),", ")+" }":M.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ft.call(M,", ")+" }"}if(typeof e=="object"&&o){if(mh&&typeof e[mh]=="function"&&Co)return Co(e,{depth:u-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(H0(e)){var k=[];return oh&&oh.call(e,function(V,te){k.push(_(te,e,!0)+" => "+_(V,e));}),gh("Map",ni.call(e),k,p)}if(z0(e)){var j=[];return ah&&ah.call(e,function(V){j.push(_(V,e));}),gh("Set",ii.call(e),j,p)}if(j0(e))return Eo("WeakMap");if(G0(e))return Eo("WeakSet");if(W0(e))return Eo("WeakRef");if(L0(e))return tn(_(Number(e)));if(q0(e))return tn(_(Ao.call(e)));if(D0(e))return tn(R0.call(e));if($0(e))return tn(_(String(e)));if(!N0(e)&&!_h(e)){var U=ri(e,_),$=hh?hh(e)===Object.prototype:e instanceof Object||e.constructor===Object,F=e instanceof Object?"":"null prototype",B=!$&&Fe&&Object(e)===e&&Fe in e?Oo.call(Pt(e),8,-1):F?"Object":"",R=$||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",z=R+(B||F?"["+ft.call(ch.call([],B||[],F||[]),": ")+"] ":"");return U.length===0?z+"{}":p?z+"{"+To(U,p)+"}":z+"{ "+ft.call(U,", ")+" }"}return String(e)};function bh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function F0(t){return It.call(String(t),/"/g,""")}function Ro(t){return Pt(t)==="[object Array]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function N0(t){return Pt(t)==="[object Date]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function _h(t){return Pt(t)==="[object RegExp]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function k0(t){return Pt(t)==="[object Error]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function $0(t){return Pt(t)==="[object String]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function L0(t){return Pt(t)==="[object Number]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function D0(t){return Pt(t)==="[object Boolean]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function vh(t){if(yr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!xo)return !1;try{return xo.call(t),!0}catch{}return !1}function q0(t){if(!t||typeof t!="object"||!Ao)return !1;try{return Ao.call(t),!0}catch{}return !1}var B0=Object.prototype.hasOwnProperty||function(t){return t in this};function Tt(t,e){return B0.call(t,e)}function Pt(t){return T0.call(t)}function U0(t){if(t.name)return t.name;var e=P0.call(I0.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Sh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Eh(Oo.call(t,0,e.maxStringLength),e)+n}var s=It.call(It.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K0);return bh(s,"single",e)}function K0(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+O0.call(e.toString(16))}function tn(t){return "Object("+t+")"}function Eo(t){return t+" { ? }"}function gh(t,e,r,n){var s=n?To(r,n):ft.call(r,", ");return t+" ("+e+") {"+s+"}"}function Z0(t){for(var e=0;e=0)return !1;return !0}function Y0(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=ft.call(Array(t.indent+1)," ");else return null;return {base:r,prev:ft.call(Array(e+1),r)}}function To(t,e){if(t.length===0)return "";var r=` +`+e.prev+e.base;return r+ft.call(t,","+r)+` +`+e.prev}function ri(t,e){var r=Ro(t),n=[];if(r){n.length=t.length;for(var s=0;s{var Mo=ct(),wr=Qe(),J0=xh(),X0=Mo("%TypeError%"),si=Mo("%WeakMap%",!0),oi=Mo("%Map%",!0),Q0=wr("WeakMap.prototype.get",!0),eA=wr("WeakMap.prototype.set",!0),tA=wr("WeakMap.prototype.has",!0),rA=wr("Map.prototype.get",!0),nA=wr("Map.prototype.set",!0),iA=wr("Map.prototype.has",!0),Fo=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},sA=function(t,e){var r=Fo(t,e);return r&&r.value},oA=function(t,e,r){var n=Fo(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},aA=function(t,e){return !!Fo(t,e)};Ch.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new X0("Side channel does not contain "+J0(i))},get:function(i){if(si&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Q0(e,i)}else if(oi){if(r)return rA(r,i)}else if(n)return sA(n,i)},has:function(i){if(si&&i&&(typeof i=="object"||typeof i=="function")){if(e)return tA(e,i)}else if(oi){if(r)return iA(r,i)}else if(n)return aA(n,i);return !1},set:function(i,o){si&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new si),eA(e,i,o)):oi?(r||(r=new oi),nA(r,i,o)):(n||(n={key:{},next:null}),oA(n,i,o));}};return s};});var No=T((C2,Ih)=>{var Th=function(t){return t!==t};Ih.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Th(e)&&Th(r))};});var ko=T((R2,Ph)=>{var lA=No();Ph.exports=function(){return typeof Object.is=="function"?Object.is:lA};});var Mh=T((T2,Oh)=>{var uA=ko(),cA=Rt();Oh.exports=function(){var e=uA();return cA(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var $h=T((I2,kh)=>{var fA=Rt(),hA=Kt(),dA=No(),Fh=ko(),pA=Mh(),Nh=hA(Fh(),Object);fA(Nh,{getPolyfill:Fh,implementation:dA,shim:pA});kh.exports=Nh;});var Ot=T((P2,Lh)=>{var mA=Zn();Lh.exports=function(){return mA()&&!!Symbol.toStringTag};});var Bh=T((O2,qh)=>{var _A=Ot()(),gA=Qe(),$o=gA("Object.prototype.toString"),ai=function(e){return _A&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:$o(e)==="[object Arguments]"},Dh=function(e){return ai(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&$o(e)!=="[object Array]"&&$o(e.callee)==="[object Function]"},yA=function(){return ai(arguments)}();ai.isLegacyArguments=Dh;qh.exports=yA?ai:Dh;});var Hh=T((M2,Uh)=>{var wA={}.toString;Uh.exports=Array.isArray||function(t){return wA.call(t)=="[object Array]"};});var Gh=T((F2,zh)=>{var Wh=Function.prototype.toString,br=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Do,li;if(typeof br=="function"&&typeof Object.defineProperty=="function")try{Do=Object.defineProperty({},"length",{get:function(){throw li}}),li={},br(function(){throw 42},null,Do);}catch(t){t!==li&&(br=null);}else br=null;var bA=/^\s*class\b/,qo=function(e){try{var r=Wh.call(e);return bA.test(r)}catch{return !1}},Lo=function(e){try{return qo(e)?!1:(Wh.call(e),!0)}catch{return !1}},ui=Object.prototype.toString,vA="[object Object]",SA="[object Function]",EA="[object GeneratorFunction]",AA="[object HTMLAllCollection]",xA="[object HTML document.all class]",CA="[object HTMLCollection]",RA=typeof Symbol=="function"&&!!Symbol.toStringTag,TA=!(0 in[,]),Bo=function(){return !1};typeof document=="object"&&(jh=document.all,ui.call(jh)===ui.call(document.all)&&(Bo=function(e){if((TA||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ui.call(e);return (r===AA||r===xA||r===CA||r===vA)&&e("")==null}catch{}return !1}));var jh;zh.exports=br?function(e){if(Bo(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{br(e,null,Do);}catch(r){if(r!==li)return !1}return !qo(e)&&Lo(e)}:function(e){if(Bo(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(RA)return Lo(e);if(qo(e))return !1;var r=ui.call(e);return r!==SA&&r!==EA&&!/^\[object HTML/.test(r)?!1:Lo(e)};});var Zh=T((N2,Kh)=>{var IA=Gh(),PA=Object.prototype.toString,Vh=Object.prototype.hasOwnProperty,OA=function(e,r,n){for(var s=0,i=e.length;s=3&&(s=n),PA.call(e)==="[object Array]"?OA(e,r,s):typeof e=="string"?MA(e,r,s):FA(e,r,s);};Kh.exports=NA;});var Jh=T((k2,Yh)=>{var Uo=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],kA=typeof globalThis>"u"?global:globalThis;Yh.exports=function(){for(var e=[],r=0;r{var fi=Zh(),$A=Jh(),Xh=Kt(),Wo=Qe(),ci=co(),LA=Wo("Object.prototype.toString"),ed=Ot()(),Qh=typeof globalThis>"u"?global:globalThis,jo=$A(),zo=Wo("String.prototype.slice"),Ho=Object.getPrototypeOf,DA=Wo("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:BA(e)}return ci?qA(e):null};});var nd=T((L2,rd)=>{var UA=Go();rd.exports=function(e){return !!UA(e)};});var Vo=T((D2,ud)=>{var HA=Kt(),jA=Qe(),ld=ct(),WA=nd(),id=ld("ArrayBuffer",!0),sd=ld("Float32Array",!0),di=jA("ArrayBuffer.prototype.byteLength",!0),od=id&&!di&&new id().slice,ad=od&&HA(od);ud.exports=di||ad?function(e){if(!e||typeof e!="object")return !1;try{return di?di(e):ad(e,0),!0}catch{return !1}}:sd?function(e){try{return new sd(e).buffer===e&&!WA(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var fd=T((q2,cd)=>{var zA=Date.prototype.getDay,GA=function(e){try{return zA.call(e),!0}catch{return !1}},VA=Object.prototype.toString,KA="[object Date]",ZA=Ot()();cd.exports=function(e){return typeof e!="object"||e===null?!1:ZA?GA(e):VA.call(e)===KA};});var _d=T((B2,md)=>{var Ko=Qe(),hd=Ot()(),dd,pd,Zo,Yo;hd&&(dd=Ko("Object.prototype.hasOwnProperty"),pd=Ko("RegExp.prototype.exec"),Zo={},pi=function(){throw Zo},Yo={toString:pi,valueOf:pi},typeof Symbol.toPrimitive=="symbol"&&(Yo[Symbol.toPrimitive]=pi));var pi,YA=Ko("Object.prototype.toString"),JA=Object.getOwnPropertyDescriptor,XA="[object RegExp]";md.exports=hd?function(e){if(!e||typeof e!="object")return !1;var r=JA(e,"lastIndex"),n=r&&dd(r,"value");if(!n)return !1;try{pd(e,Yo);}catch(s){return s===Zo}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:YA(e)===XA};});var wd=T((U2,yd)=>{var QA=Qe(),gd=QA("SharedArrayBuffer.prototype.byteLength",!0);yd.exports=gd?function(e){if(!e||typeof e!="object")return !1;try{return gd(e),!0}catch{return !1}}:function(e){return !1};});var vd=T((H2,bd)=>{var ex=String.prototype.valueOf,tx=function(e){try{return ex.call(e),!0}catch{return !1}},rx=Object.prototype.toString,nx="[object String]",ix=Ot()();bd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:ix?tx(e):rx.call(e)===nx};});var Ed=T((j2,Sd)=>{var sx=Number.prototype.toString,ox=function(e){try{return sx.call(e),!0}catch{return !1}},ax=Object.prototype.toString,lx="[object Number]",ux=Ot()();Sd.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:ux?ox(e):ax.call(e)===lx};});var Cd=T((W2,xd)=>{var Ad=Qe(),cx=Ad("Boolean.prototype.toString"),fx=Ad("Object.prototype.toString"),hx=function(e){try{return cx(e),!0}catch{return !1}},dx="[object Boolean]",px=Ot()();xd.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:px&&Symbol.toStringTag in e?hx(e):fx(e)===dx};});var Pd=T((z2,Jo)=>{var mx=Object.prototype.toString,_x=io()();_x?(Rd=Symbol.prototype.toString,Td=/^Symbol\(.*\)$/,Id=function(e){return typeof e.valueOf()!="symbol"?!1:Td.test(Rd.call(e))},Jo.exports=function(e){if(typeof e=="symbol")return !0;if(mx.call(e)!=="[object Symbol]")return !1;try{return Id(e)}catch{return !1}}):Jo.exports=function(e){return !1};var Rd,Td,Id;});var Fd=T((G2,Md)=>{var Od=typeof BigInt<"u"&&BigInt;Md.exports=function(){return typeof Od=="function"&&typeof BigInt=="function"&&typeof Od(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var $d=T((V2,Xo)=>{var gx=Fd()();gx?(Nd=BigInt.prototype.valueOf,kd=function(e){try{return Nd.call(e),!0}catch{}return !1},Xo.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:kd(e)}):Xo.exports=function(e){return !1};var Nd,kd;});var Dd=T((K2,Ld)=>{var yx=vd(),wx=Ed(),bx=Cd(),vx=Pd(),Sx=$d();Ld.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(yx(e))return "String";if(wx(e))return "Number";if(bx(e))return "Boolean";if(vx(e))return "Symbol";if(Sx(e))return "BigInt"};});var Hd=T((Z2,Ud)=>{var Qo=typeof Map=="function"&&Map.prototype?Map:null,Ex=typeof Set=="function"&&Set.prototype?Set:null,mi;Qo||(mi=function(e){return !1});var Bd=Qo?Map.prototype.has:null,qd=Ex?Set.prototype.has:null;!mi&&!Bd&&(mi=function(e){return !1});Ud.exports=mi||function(e){if(!e||typeof e!="object")return !1;try{if(Bd.call(e),qd)try{qd.call(e);}catch{return !0}return e instanceof Qo}catch{}return !1};});var Gd=T((Y2,zd)=>{var Ax=typeof Map=="function"&&Map.prototype?Map:null,ea=typeof Set=="function"&&Set.prototype?Set:null,_i;ea||(_i=function(e){return !1});var jd=Ax?Map.prototype.has:null,Wd=ea?Set.prototype.has:null;!_i&&!Wd&&(_i=function(e){return !1});zd.exports=_i||function(e){if(!e||typeof e!="object")return !1;try{if(Wd.call(e),jd)try{jd.call(e);}catch{return !0}return e instanceof ea}catch{}return !1};});var Zd=T((J2,Kd)=>{var gi=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Vd=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,yi;gi||(yi=function(e){return !1});var ra=gi?gi.prototype.has:null,ta=Vd?Vd.prototype.has:null;!yi&&!ra&&(yi=function(e){return !1});Kd.exports=yi||function(e){if(!e||typeof e!="object")return !1;try{if(ra.call(e,ra),ta)try{ta.call(e,ta);}catch{return !0}return e instanceof gi}catch{}return !1};});var Jd=T((X2,ia)=>{var xx=ct(),Yd=Qe(),Cx=xx("%WeakSet%",!0),na=Yd("WeakSet.prototype.has",!0);na?(wi=Yd("WeakMap.prototype.has",!0),ia.exports=function(e){if(!e||typeof e!="object")return !1;try{if(na(e,na),wi)try{wi(e,wi);}catch{return !0}return e instanceof Cx}catch{}return !1}):ia.exports=function(e){return !1};var wi;});var Qd=T((Q2,Xd)=>{var Rx=Hd(),Tx=Gd(),Ix=Zd(),Px=Jd();Xd.exports=function(e){if(e&&typeof e=="object"){if(Rx(e))return "Map";if(Tx(e))return "Set";if(Ix(e))return "WeakMap";if(Px(e))return "WeakSet"}return !1};});var rp=T((e$,tp)=>{var Ox=Qe(),ep=Ox("ArrayBuffer.prototype.byteLength",!0),Mx=Vo();tp.exports=function(e){return Mx(e)?ep?ep(e):e.byteLength:NaN};});var xi=T((t$,Cp)=>{var Ep=Bf(),ht=Qe(),np=eh(),Fx=ct(),vr=nh(),Nx=Rh(),ip=$h(),sp=Bh(),op=Hh(),ap=Vo(),lp=fd(),up=_d(),cp=wd(),fp=Kn(),hp=Dd(),dp=Qd(),pp=Go(),mp=rp(),_p=ht("SharedArrayBuffer.prototype.byteLength",!0),gp=ht("Date.prototype.getTime"),sa=Object.getPrototypeOf,yp=ht("Object.prototype.toString"),vi=Fx("%Set%",!0),oa=ht("Map.prototype.has",!0),Si=ht("Map.prototype.get",!0),wp=ht("Map.prototype.size",!0),Ei=ht("Set.prototype.add",!0),Ap=ht("Set.prototype.delete",!0),Ai=ht("Set.prototype.has",!0),bi=ht("Set.prototype.size",!0);function bp(t,e,r,n){for(var s=vr(t),i;(i=s.next())&&!i.done;)if(it(e,i.value,r,n))return Ap(t,i.value),!0;return !1}function xp(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function kx(t,e,r,n,s,i){var o=xp(r);if(o!=null)return o;var a=Si(e,o),c=Ep({},s,{strict:!1});return typeof a>"u"&&!oa(e,o)||!it(n,a,c,i)?!1:!oa(t,o)&&it(n,a,c,i)}function $x(t,e,r){var n=xp(r);return n??(Ai(e,n)&&!Ai(t,n))}function vp(t,e,r,n,s,i){for(var o=vr(t),a,c;(a=o.next())&&!a.done;)if(c=a.value,it(r,c,s,i)&&it(n,Si(e,c),s,i))return Ap(t,c),!0;return !1}function it(t,e,r,n){var s=r||{};if(s.strict?ip(t,e):t===e)return !0;var i=hp(t),o=hp(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?ip(t,e):t==e;var a=n.has(t),c=n.has(e),d;if(a&&c){if(n.get(t)===n.get(e))return !0}else d={};return a||n.set(t,d),c||n.set(e,d),qx(t,e,s,n)}function Sp(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function Lx(t,e,r,n){if(bi(t)!==bi(e))return !1;for(var s=vr(t),i=vr(e),o,a,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new vi),Ei(c,o.value);else if(!Ai(e,o.value)){if(r.strict||!$x(t,e,o.value))return !1;c||(c=new vi),Ei(c,o.value);}if(c){for(;(a=i.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!bp(c,a.value,r.strict,n))return !1}else if(!r.strict&&!Ai(t,a.value)&&!bp(c,a.value,r.strict,n))return !1;return bi(c)===0}return !0}function Dx(t,e,r,n){if(wp(t)!==wp(e))return !1;for(var s=vr(t),i=vr(e),o,a,c,d,u,p;(o=s.next())&&!o.done;)if(d=o.value[0],u=o.value[1],d&&typeof d=="object")c||(c=new vi),Ei(c,d);else if(p=Si(e,d),typeof p>"u"&&!oa(e,d)||!it(u,p,r,n)){if(r.strict||!kx(t,e,d,u,r,n))return !1;c||(c=new vi),Ei(c,d);}if(c){for(;(a=i.next())&&!a.done;)if(d=a.value[0],p=a.value[1],d&&typeof d=="object"){if(!vp(c,t,d,p,r,n))return !1}else if(!r.strict&&(!t.has(d)||!it(Si(t,d),p,r,n))&&!vp(c,t,d,p,Ep({},r,{strict:!1}),n))return !1;return bi(c)===0}return !0}function qx(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||yp(t)!==yp(e)||sp(t)!==sp(e))return !1;var o=op(t),a=op(e);if(o!==a)return !1;var c=t instanceof Error,d=e instanceof Error;if(c!==d||(c||d)&&(t.name!==e.name||t.message!==e.message))return !1;var u=up(t),p=up(e);if(u!==p||(u||p)&&(t.source!==e.source||np(t)!==np(e)))return !1;var _=lp(t),m=lp(e);if(_!==m||(_||m)&&gp(t)!==gp(e)||r.strict&&sa&&sa(t)!==sa(e))return !1;var y=pp(t),v=pp(e);if(y!==v)return !1;if(y||v){if(t.length!==e.length)return !1;for(s=0;s=0;s--)if(j[s]!=U[s])return !1;for(s=j.length-1;s>=0;s--)if(i=j[s],!it(t[i],e[i],r,n))return !1;var $=dp(t),F=dp(e);return $!==F?!1:$==="Set"||F==="Set"?Lx(t,e,r,n):$==="Map"?Dx(t,e,r,n):!0}Cp.exports=function(e,r,n){return it(e,r,n,Nx())};});var $p={};Js($p,{closest:()=>uC,distance:()=>kp});var yt,aC,lC,kp,uC,Lp=jn(()=>{yt=new Uint32Array(65536),aC=(t,e)=>{let r=t.length,n=e.length,s=1<{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),a=Math.ceil(n/32);for(let y=0;y>>w&1,k=s[w/32|0]>>>w&1,j=x|y,U=((x|k)&v)+v^v|x|k,$=y|~(U|v),F=v&U;$>>>31^M&&(i[w/32|0]^=1<>>31^k&&(s[w/32|0]^=1<>>y&1,A=s[y/32|0]>>>y&1,w=v|d,x=((v|A)&u)+u^u|v|A,M=d|~(x|u),k=u&x;m+=M>>>n-1&1,m-=k>>>n-1&1,M>>>31^E&&(i[y/32|0]^=1<>>31^A&&(s[y/32|0]^=1<{if(t.length{let r=1/0,n=0;for(let s=0;s{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(Lp(),Xs($p)),r=[],n=[],s={get:function(i,o,a){var c=a&&t&&a.useCollator;if(c){var d=i.length,u=o.length;if(d===0)return u;if(u===0)return d;var p,_,m,y,v;for(m=0;mv&&(_=v),v=r[y+1]+1,_>v&&(_=v),r[y]=p;r[y]=_;}return _}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof on<"u"&&on!==null&&typeof fa<"u"&&on.exports===fa?on.exports=s:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=s:typeof window<"u"&&window!==null&&(window.Levenshtein=s);})();});var Ft=jn(()=>{});var qe=T(pa=>{pa.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{t.call(this,...e,(s,i)=>s!=null?n(s):r(i));})},"name",{value:t.name})};pa.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);t.apply(this,e.slice(0,-1)).then(n=>r(null,n),r);},"name",{value:t.name})};});var zp=T((c$,Wp)=>{var Nt=G("constants"),hC=process.cwd,Mi=null,dC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Mi||(Mi=hC.call(process)),Mi};try{process.cwd();}catch{}typeof process.chdir=="function"&&(ma=process.chdir,process.chdir=function(t){Mi=null,ma.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ma));var ma;Wp.exports=pC;function pC(t){Nt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,p,_){_&&process.nextTick(_);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,p,_,m){m&&process.nextTick(m);},t.lchownSync=function(){}),dC==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function p(_,m,y){var v=Date.now(),E=0;u(_,m,function A(w){if(w&&(w.code==="EACCES"||w.code==="EPERM"||w.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){t.stat(m,function(x,M){x&&x.code==="ENOENT"?u(_,m,A):y(w);});},E),E<100&&(E+=10);return}y&&y(w);});}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function p(_,m,y,v,E,A){var w;if(A&&typeof A=="function"){var x=0;w=function(M,k,j){if(M&&M.code==="EAGAIN"&&x<10)return x++,u.call(t,_,m,y,v,E,w);A.apply(this,arguments);};}return u.call(t,_,m,y,v,E,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(p,_,m,y,v){for(var E=0;;)try{return u.call(t,p,_,m,y,v)}catch(A){if(A.code==="EAGAIN"&&E<10){E++;continue}throw A}}}(t.readSync);function e(u){u.lchmod=function(p,_,m){u.open(p,Nt.O_WRONLY|Nt.O_SYMLINK,_,function(y,v){if(y){m&&m(y);return}u.fchmod(v,_,function(E){u.close(v,function(A){m&&m(E||A);});});});},u.lchmodSync=function(p,_){var m=u.openSync(p,Nt.O_WRONLY|Nt.O_SYMLINK,_),y=!0,v;try{v=u.fchmodSync(m,_),y=!1;}finally{if(y)try{u.closeSync(m);}catch{}else u.closeSync(m);}return v};}function r(u){Nt.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(p,_,m,y){u.open(p,Nt.O_SYMLINK,function(v,E){if(v){y&&y(v);return}u.futimes(E,_,m,function(A){u.close(E,function(w){y&&y(A||w);});});});},u.lutimesSync=function(p,_,m){var y=u.openSync(p,Nt.O_SYMLINK),v,E=!0;try{v=u.futimesSync(y,_,m),E=!1;}finally{if(E)try{u.closeSync(y);}catch{}else u.closeSync(y);}return v}):u.futimes&&(u.lutimes=function(p,_,m,y){y&&process.nextTick(y);},u.lutimesSync=function(){});}function n(u){return u&&function(p,_,m){return u.call(t,p,_,function(y){d(y)&&(y=null),m&&m.apply(this,arguments);})}}function s(u){return u&&function(p,_){try{return u.call(t,p,_)}catch(m){if(!d(m))throw m}}}function i(u){return u&&function(p,_,m,y){return u.call(t,p,_,m,function(v){d(v)&&(v=null),y&&y.apply(this,arguments);})}}function o(u){return u&&function(p,_,m){try{return u.call(t,p,_,m)}catch(y){if(!d(y))throw y}}}function a(u){return u&&function(p,_,m){typeof _=="function"&&(m=_,_=null);function y(v,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),m&&m.apply(this,arguments);}return _?u.call(t,p,_,y):u.call(t,p,y)}}function c(u){return u&&function(p,_){var m=_?u.call(t,p,_):u.call(t,p);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function d(u){if(!u||u.code==="ENOSYS")return !0;var p=!process.getuid||process.getuid()!==0;return !!(p&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Kp=T((f$,Vp)=>{var Gp=G("stream").Stream;Vp.exports=mC;function mC(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Gp.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),a=0,c=o.length;athis.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(u,p){if(u){i.emit("error",u),i.readable=!1;return}i.fd=p,i.emit("open",p),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);Gp.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,a=i.length;o= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var Yp=T((h$,Zp)=>{Zp.exports=gC;var _C=Object.getPrototypeOf||function(t){return t.__proto__};function gC(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:_C(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Be=T((d$,ya)=>{var me=G("fs"),yC=zp(),wC=Kp(),bC=Yp(),Fi=G("util"),Me,ki;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Me=Symbol.for("graceful-fs.queue"),ki=Symbol.for("graceful-fs.previous")):(Me="___graceful-fs.queue",ki="___graceful-fs.previous");function vC(){}function Qp(t,e){Object.defineProperty(t,Me,{get:function(){return e}});}var Jt=vC;Fi.debuglog?Jt=Fi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Jt=function(){var t=Fi.format.apply(Fi,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t);});me[Me]||(Jp=global[Me]||[],Qp(me,Jp),me.close=function(t){function e(r,n){return t.call(me,r,function(s){s||Xp(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,ki,{value:t}),e}(me.close),me.closeSync=function(t){function e(r){t.apply(me,arguments),Xp();}return Object.defineProperty(e,ki,{value:t}),e}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Jt(me[Me]),G("assert").equal(me[Me].length,0);}));var Jp;global[Me]||Qp(global,me[Me]);ya.exports=_a(bC(me));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(ya.exports=_a(me),me.__patched=!0);function _a(t){yC(t),t.gracefulify=_a,t.createReadStream=k,t.createWriteStream=j;var e=t.readFile;t.readFile=r;function r(F,B,R){return typeof B=="function"&&(R=B,B=null),z(F,B,R);function z(V,te,I,O){return e(V,te,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Ar([z,[V,te,I],X,O||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(F,B,R,z){return typeof R=="function"&&(z=R,R=null),V(F,B,R,z);function V(te,I,O,X,Q){return n(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(F,B,R,z){return typeof R=="function"&&(z=R,R=null),V(F,B,R,z);function V(te,I,O,X,Q){return i(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(F,B,R,z){return typeof R=="function"&&(z=R,R=0),V(F,B,R,z);function V(te,I,O,X,Q){return a(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var d=t.readdir;t.readdir=p;var u=/^v[0-5]\./;function p(F,B,R){typeof B=="function"&&(R=B,B=null);var z=u.test(process.version)?function(I,O,X,Q){return d(I,V(I,O,X,Q))}:function(I,O,X,Q){return d(I,O,V(I,O,X,Q))};return z(F,B,R);function V(te,I,O,X){return function(Q,ie){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Ar([z,[te,I,O],Q,X||Date.now(),Date.now()]):(ie&&ie.sort&&ie.sort(),typeof O=="function"&&O.call(this,Q,ie));}}}if(process.version.substr(0,4)==="v0.8"){var _=wC(t);A=_.ReadStream,x=_.WriteStream;}var m=t.ReadStream;m&&(A.prototype=Object.create(m.prototype),A.prototype.open=w);var y=t.WriteStream;y&&(x.prototype=Object.create(y.prototype),x.prototype.open=M),Object.defineProperty(t,"ReadStream",{get:function(){return A},set:function(F){A=F;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return x},set:function(F){x=F;},enumerable:!0,configurable:!0});var v=A;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(F){v=F;},enumerable:!0,configurable:!0});var E=x;Object.defineProperty(t,"FileWriteStream",{get:function(){return E},set:function(F){E=F;},enumerable:!0,configurable:!0});function A(F,B){return this instanceof A?(m.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function w(){var F=this;$(F.path,F.flags,F.mode,function(B,R){B?(F.autoClose&&F.destroy(),F.emit("error",B)):(F.fd=R,F.emit("open",R),F.read());});}function x(F,B){return this instanceof x?(y.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function M(){var F=this;$(F.path,F.flags,F.mode,function(B,R){B?(F.destroy(),F.emit("error",B)):(F.fd=R,F.emit("open",R));});}function k(F,B){return new t.ReadStream(F,B)}function j(F,B){return new t.WriteStream(F,B)}var U=t.open;t.open=$;function $(F,B,R,z){return typeof R=="function"&&(z=R,R=null),V(F,B,R,z);function V(te,I,O,X,Q){return U(te,I,O,function(ie,Ne){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ar([V,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}return t}function Ar(t){Jt("ENQUEUE",t[0].name,t[1]),me[Me].push(t),ga();}var Ni;function Xp(){for(var t=Date.now(),e=0;e2&&(me[Me][e][3]=t,me[Me][e][4]=t);ga();}function ga(){if(clearTimeout(Ni),Ni=void 0,me[Me].length!==0){var t=me[Me].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Jt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Jt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var a=Date.now()-i,c=Math.max(i-s,1),d=Math.min(c*1.2,100);a>=d?(Jt("RETRY",e.name,r),e.apply(null,r.concat([s]))):me[Me].push(t);}Ni===void 0&&(Ni=setTimeout(ga,0));}}});var Xt=T(wt=>{var em=qe().fromCallback,ke=Be(),SC=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof ke[t]=="function");Object.assign(wt,ke);SC.forEach(t=>{wt[t]=em(ke[t]);});wt.exists=function(t,e){return typeof e=="function"?ke.exists(t,e):new Promise(r=>ke.exists(t,r))};wt.read=function(t,e,r,n,s,i){return typeof i=="function"?ke.read(t,e,r,n,s,i):new Promise((o,a)=>{ke.read(t,e,r,n,s,(c,d,u)=>{if(c)return a(c);o({bytesRead:d,buffer:u});});})};wt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?ke.write(t,e,...r):new Promise((n,s)=>{ke.write(t,e,...r,(i,o,a)=>{if(i)return s(i);n({bytesWritten:o,buffer:a});});})};wt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?ke.readv(t,e,...r):new Promise((n,s)=>{ke.readv(t,e,...r,(i,o,a)=>{if(i)return s(i);n({bytesRead:o,buffers:a});});})};wt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?ke.writev(t,e,...r):new Promise((n,s)=>{ke.writev(t,e,...r,(i,o,a)=>{if(i)return s(i);n({bytesWritten:o,buffers:a});});})};typeof ke.realpath.native=="function"?wt.realpath.native=em(ke.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var rm=T((m$,tm)=>{var EC=G("path");tm.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(EC.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var om=T((_$,wa)=>{var nm=Xt(),{checkPath:im}=rm(),sm=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};wa.exports.makeDir=async(t,e)=>(im(t),nm.mkdir(t,{mode:sm(e),recursive:!0}));wa.exports.makeDirSync=(t,e)=>(im(t),nm.mkdirSync(t,{mode:sm(e),recursive:!0}));});var st=T((g$,am)=>{var AC=qe().fromPromise,{makeDir:xC,makeDirSync:ba}=om(),va=AC(xC);am.exports={mkdirs:va,mkdirsSync:ba,mkdirp:va,mkdirpSync:ba,ensureDir:va,ensureDirSync:ba};});var kt=T((y$,um)=>{var CC=qe().fromPromise,lm=Xt();function RC(t){return lm.access(t).then(()=>!0).catch(()=>!1)}um.exports={pathExists:CC(RC),pathExistsSync:lm.existsSync};});var Sa=T((w$,cm)=>{var xr=Be();function TC(t,e,r,n){xr.open(t,"r+",(s,i)=>{if(s)return n(s);xr.futimes(i,e,r,o=>{xr.close(i,a=>{n&&n(o||a);});});});}function IC(t,e,r){let n=xr.openSync(t,"r+");return xr.futimesSync(n,e,r),xr.closeSync(n)}cm.exports={utimesMillis:TC,utimesMillisSync:IC};});var Qt=T((b$,dm)=>{var Cr=Xt(),Ee=G("path"),PC=G("util");function OC(t,e,r){let n=r.dereference?s=>Cr.stat(s,{bigint:!0}):s=>Cr.lstat(s,{bigint:!0});return Promise.all([n(t),n(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})]).then(([s,i])=>({srcStat:s,destStat:i}))}function MC(t,e,r){let n,s=r.dereference?o=>Cr.statSync(o,{bigint:!0}):o=>Cr.lstatSync(o,{bigint:!0}),i=s(t);try{n=s(e);}catch(o){if(o.code==="ENOENT")return {srcStat:i,destStat:null};throw o}return {srcStat:i,destStat:n}}function FC(t,e,r,n,s){PC.callbackify(OC)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:a,destStat:c}=o;if(c){if(un(a,c)){let d=Ee.basename(t),u=Ee.basename(e);return r==="move"&&d!==u&&d.toLowerCase()===u.toLowerCase()?s(null,{srcStat:a,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(a.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!a.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return a.isDirectory()&&Ea(t,e)?s(new Error($i(t,e,r))):s(null,{srcStat:a,destStat:c})});}function NC(t,e,r,n){let{srcStat:s,destStat:i}=MC(t,e,n);if(i){if(un(s,i)){let o=Ee.basename(t),a=Ee.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&Ea(t,e))throw new Error($i(t,e,r));return {srcStat:s,destStat:i}}function fm(t,e,r,n,s){let i=Ee.resolve(Ee.dirname(t)),o=Ee.resolve(Ee.dirname(r));if(o===i||o===Ee.parse(o).root)return s();Cr.stat(o,{bigint:!0},(a,c)=>a?a.code==="ENOENT"?s():s(a):un(e,c)?s(new Error($i(t,r,n))):fm(t,e,o,n,s));}function hm(t,e,r,n){let s=Ee.resolve(Ee.dirname(t)),i=Ee.resolve(Ee.dirname(r));if(i===s||i===Ee.parse(i).root)return;let o;try{o=Cr.statSync(i,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(un(e,o))throw new Error($i(t,r,n));return hm(t,e,i,n)}function un(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Ea(t,e){let r=Ee.resolve(t).split(Ee.sep).filter(s=>s),n=Ee.resolve(e).split(Ee.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function $i(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}dm.exports={checkPaths:FC,checkPathsSync:NC,checkParentPaths:fm,checkParentPathsSync:hm,isSrcSubdir:Ea,areIdentical:un};});var wm=T((v$,ym)=>{var Ue=Be(),cn=G("path"),kC=st().mkdirs,$C=kt().pathExists,LC=Sa().utimesMillis,fn=Qt();function DC(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),Zn.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:l}=i;Zn.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);cy(t,e,r,(p,u)=>{if(p)return n(p);if(!u)return n();RR(l,t,e,r,n);});});});}function RR(t,e,r,n,s){let i=Qn.dirname(r);_R(i,(o,l)=>{if(o)return s(o);if(l)return yl(t,e,r,n,s);AR(i,c=>c?s(c):yl(t,e,r,n,s));});}function cy(t,e,r,n){if(!r.filter)return n(null,!0);Promise.resolve(r.filter(t,e)).then(s=>n(null,s),s=>n(s));}function yl(t,e,r,n,s){(n.dereference?Ze.stat:Ze.lstat)(e,(o,l)=>o?s(o):l.isDirectory()?LR(l,t,e,r,n,s):l.isFile()||l.isCharacterDevice()||l.isBlockDevice()?OR(l,t,e,r,n,s):l.isSymbolicLink()?DR(t,e,r,n,s):l.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):l.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function OR(t,e,r,n,s,i){return e?PR(t,r,n,s,i):fy(t,r,n,s,i)}function PR(t,e,r,n,s){if(n.overwrite)Ze.unlink(r,i=>i?s(i):fy(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function fy(t,e,r,n,s){Ze.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?TR(t.mode,e,r,s):Ps(r,t.mode,s));}function TR(t,e,r,n){return $R(t)?IR(r,t,s=>s?n(s):uy(t,e,r,n)):uy(t,e,r,n)}function $R(t){return (t&128)===0}function IR(t,e,r){return Ps(t,e|128,r)}function uy(t,e,r,n){kR(e,r,s=>s?n(s):Ps(r,t,n));}function Ps(t,e,r){return Ze.chmod(t,e,r)}function kR(t,e,r){Ze.stat(t,(n,s)=>n?r(n):xR(e,s.atime,s.mtime,r));}function LR(t,e,r,n,s,i){return e?hy(r,n,s,i):FR(t.mode,r,n,s,i)}function FR(t,e,r,n,s){Ze.mkdir(r,i=>{if(i)return s(i);hy(e,r,n,o=>o?s(o):Ps(r,t,s));});}function hy(t,e,r,n){Ze.readdir(t,(s,i)=>s?n(s):ml(i,t,e,r,n));}function ml(t,e,r,n,s){let i=t.pop();return i?qR(t,i,e,r,n,s):s()}function qR(t,e,r,n,s,i){let o=Qn.join(r,e),l=Qn.join(n,e);cy(o,l,s,(c,p)=>{if(c)return i(c);if(!p)return ml(t,r,n,s,i);Zn.checkPaths(o,l,"copy",s,(u,g)=>{if(u)return i(u);let{destStat:y}=g;yl(y,o,l,s,m=>m?i(m):ml(t,r,n,s,i));});});}function DR(t,e,r,n,s){Ze.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=Qn.resolve(process.cwd(),o)),t)Ze.readlink(r,(l,c)=>l?l.code==="EINVAL"||l.code==="UNKNOWN"?Ze.symlink(o,r,s):s(l):(n.dereference&&(c=Qn.resolve(process.cwd(),c)),Zn.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):Zn.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):NR(o,r,s)));else return Ze.symlink(o,r,s)});}function NR(t,e,r){Ze.unlink(e,n=>n?r(n):Ze.symlink(t,e,r));}py.exports=CR;});var wy=R((oN,vy)=>{var Ve=Qe(),ei=z("path"),MR=Et().mkdirsSync,jR=dl().utimesMillisSync,ti=$r();function BR(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),fn.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:a}=i;fn.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);mm(t,e,r,(d,u)=>{if(d)return n(d);if(!u)return n();qC(a,t,e,r,n);});});});}function qC(t,e,r,n,s){let i=cn.dirname(r);$C(i,(o,a)=>{if(o)return s(o);if(a)return Aa(t,e,r,n,s);kC(i,c=>c?s(c):Aa(t,e,r,n,s));});}function mm(t,e,r,n){if(!r.filter)return n(null,!0);Promise.resolve(r.filter(t,e)).then(s=>n(null,s),s=>n(s));}function Aa(t,e,r,n,s){(n.dereference?Ue.stat:Ue.lstat)(e,(o,a)=>o?s(o):a.isDirectory()?GC(a,t,e,r,n,s):a.isFile()||a.isCharacterDevice()||a.isBlockDevice()?BC(a,t,e,r,n,s):a.isSymbolicLink()?ZC(t,e,r,n,s):a.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):a.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function BC(t,e,r,n,s,i){return e?UC(t,r,n,s,i):_m(t,r,n,s,i)}function UC(t,e,r,n,s){if(n.overwrite)Ue.unlink(r,i=>i?s(i):_m(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function _m(t,e,r,n,s){Ue.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?HC(t.mode,e,r,s):Li(r,t.mode,s));}function HC(t,e,r,n){return jC(t)?WC(r,t,s=>s?n(s):pm(t,e,r,n)):pm(t,e,r,n)}function jC(t){return (t&128)===0}function WC(t,e,r){return Li(t,e|128,r)}function pm(t,e,r,n){zC(e,r,s=>s?n(s):Li(r,t,n));}function Li(t,e,r){return Ue.chmod(t,e,r)}function zC(t,e,r){Ue.stat(t,(n,s)=>n?r(n):LC(e,s.atime,s.mtime,r));}function GC(t,e,r,n,s,i){return e?gm(r,n,s,i):VC(t.mode,r,n,s,i)}function VC(t,e,r,n,s){Ue.mkdir(r,i=>{if(i)return s(i);gm(e,r,n,o=>o?s(o):Li(r,t,s));});}function gm(t,e,r,n){Ue.readdir(t,(s,i)=>s?n(s):xa(i,t,e,r,n));}function xa(t,e,r,n,s){let i=t.pop();return i?KC(t,i,e,r,n,s):s()}function KC(t,e,r,n,s,i){let o=cn.join(r,e),a=cn.join(n,e);mm(o,a,s,(c,d)=>{if(c)return i(c);if(!d)return xa(t,r,n,s,i);fn.checkPaths(o,a,"copy",s,(u,p)=>{if(u)return i(u);let{destStat:_}=p;Aa(_,o,a,s,m=>m?i(m):xa(t,r,n,s,i));});});}function ZC(t,e,r,n,s){Ue.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=cn.resolve(process.cwd(),o)),t)Ue.readlink(r,(a,c)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Ue.symlink(o,r,s):s(a):(n.dereference&&(c=cn.resolve(process.cwd(),c)),fn.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):fn.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):YC(o,r,s)));else return Ue.symlink(o,r,s)});}function YC(t,e,r){Ue.unlink(e,n=>n?r(n):Ue.symlink(t,e,r));}ym.exports=DC;});var Am=T((S$,Em)=>{var $e=Be(),hn=G("path"),JC=st().mkdirsSync,XC=Sa().utimesMillisSync,dn=Qt();function QC(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:s}=ti.checkPathsSync(t,e,"copy",r);if(ti.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=ei.dirname(e);return Ve.existsSync(i)||MR(i),gy(s,t,e,r)}function gy(t,e,r,n){let i=(n.dereference?Ve.statSync:Ve.lstatSync)(e);if(i.isDirectory())return VR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return HR(i,t,e,r,n);if(i.isSymbolicLink())return XR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function HR(t,e,r,n,s){return e?UR(t,r,n,s):yy(t,r,n,s)}function UR(t,e,r,n){if(n.overwrite)return Ve.unlinkSync(r),yy(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function yy(t,e,r,n){return Ve.copyFileSync(e,r),n.preserveTimestamps&&WR(t.mode,e,r),vl(r,t.mode)}function WR(t,e,r){return zR(t)&&GR(r,t),KR(e,r)}function zR(t){return (t&128)===0}function GR(t,e){return vl(t,e|128)}function vl(t,e){return Ve.chmodSync(t,e)}function KR(t,e){let r=Ve.statSync(t);return jR(e,r.atime,r.mtime)}function VR(t,e,r,n,s){return e?my(r,n,s):YR(t.mode,r,n,s)}function YR(t,e,r,n){return Ve.mkdirSync(r),my(e,r,n),vl(r,t)}function my(t,e,r){Ve.readdirSync(t).forEach(n=>JR(n,t,e,r));}function JR(t,e,r,n){let s=ei.join(e,t),i=ei.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=ti.checkPathsSync(s,i,"copy",n);return gy(o,s,i,n)}function XR(t,e,r,n){let s=Ve.readlinkSync(e);if(n.dereference&&(s=ei.resolve(process.cwd(),s)),t){let i;try{i=Ve.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Ve.symlinkSync(s,r);throw o}if(n.dereference&&(i=ei.resolve(process.cwd(),i)),ti.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(ti.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return QR(s,r)}else return Ve.symlinkSync(s,r)}function QR(t,e){return Ve.unlinkSync(e),Ve.symlinkSync(t,e)}vy.exports=BR;});var Ts=R((aN,Sy)=>{var ZR=Xe().fromCallback;Sy.exports={copy:ZR(dy()),copySync:wy()};});var ri=R((lN,Ey)=>{var by=Qe(),eO=Xe().fromCallback;function tO(t,e){by.rm(t,{recursive:!0,force:!0},e);}function rO(t){by.rmSync(t,{recursive:!0,force:!0});}Ey.exports={remove:eO(tO),removeSync:rO};});var Ty=R((uN,Py)=>{var nO=Xe().fromPromise,xy=Tr(),Cy=z("path"),Ry=Et(),Oy=ri(),Ay=nO(async function(e){let r;try{r=await xy.readdir(e);}catch{return Ry.mkdirs(e)}return Promise.all(r.map(n=>Oy.remove(Cy.join(e,n))))});function _y(t){let e;try{e=xy.readdirSync(t);}catch{return Ry.mkdirsSync(t)}e.forEach(r=>{r=Cy.join(t,r),Oy.removeSync(r);});}Py.exports={emptyDirSync:_y,emptydirSync:_y,emptyDir:Ay,emptydir:Ay};});var Ly=R((cN,ky)=>{var iO=Xe().fromCallback,$y=z("path"),cr=Qe(),Iy=Et();function sO(t,e){function r(){cr.writeFile(t,"",n=>{if(n)return e(n);e();});}cr.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=$y.dirname(t);cr.stat(i,(o,l)=>{if(o)return o.code==="ENOENT"?Iy.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);l.isDirectory()?r():cr.readdir(i,c=>{if(c)return e(c)});});});}function oO(t){let e;try{e=cr.statSync(t);}catch{}if(e&&e.isFile())return;let r=$y.dirname(t);try{cr.statSync(r).isDirectory()||cr.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")Iy.mkdirsSync(r);else throw n}cr.writeFileSync(t,"");}ky.exports={createFile:iO(sO),createFileSync:oO};});var My=R((fN,Ny)=>{var aO=Xe().fromCallback,Fy=z("path"),fr=Qe(),qy=Et(),lO=ur().pathExists,{areIdentical:Dy}=$r();function uO(t,e,r){function n(s,i){fr.link(s,i,o=>{if(o)return r(o);r(null);});}fr.lstat(e,(s,i)=>{fr.lstat(t,(o,l)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&Dy(l,i))return r(null);let c=Fy.dirname(e);lO(c,(p,u)=>{if(p)return r(p);if(u)return n(t,e);qy.mkdirs(c,g=>{if(g)return r(g);n(t,e);});});});});}function cO(t,e){let r;try{r=fr.lstatSync(e);}catch{}try{let i=fr.lstatSync(t);if(r&&Dy(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Fy.dirname(e);return fr.existsSync(n)||qy.mkdirsSync(n),fr.linkSync(t,e)}Ny.exports={createLink:aO(uO),createLinkSync:cO};});var By=R((hN,jy)=>{var hr=z("path"),ni=Qe(),fO=ur().pathExists;function hO(t,e,r){if(hr.isAbsolute(t))return ni.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=hr.dirname(e),s=hr.join(n,t);return fO(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):ni.lstat(t,l=>l?(l.message=l.message.replace("lstat","ensureSymlink"),r(l)):r(null,{toCwd:t,toDst:hr.relative(n,t)})))}}function pO(t,e){let r;if(hr.isAbsolute(t)){if(r=ni.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=hr.dirname(e),s=hr.join(n,t);if(r=ni.existsSync(s),r)return {toCwd:s,toDst:t};if(r=ni.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:hr.relative(n,t)}}}jy.exports={symlinkPaths:hO,symlinkPathsSync:pO};});var Wy=R((pN,Uy)=>{var Hy=Qe();function dO(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);Hy.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function gO(t,e){let r;if(e)return e;try{r=Hy.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Uy.exports={symlinkType:dO,symlinkTypeSync:gO};});var Qy=R((dN,Xy)=>{var yO=Xe().fromCallback,Gy=z("path"),At=Tr(),Ky=Et(),mO=Ky.mkdirs,vO=Ky.mkdirsSync,Vy=By(),wO=Vy.symlinkPaths,SO=Vy.symlinkPathsSync,Yy=Wy(),bO=Yy.symlinkType,EO=Yy.symlinkTypeSync,AO=ur().pathExists,{areIdentical:Jy}=$r();function _O(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,At.lstat(e,(s,i)=>{!s&&i.isSymbolicLink()?Promise.all([At.stat(t),At.stat(e)]).then(([o,l])=>{if(Jy(o,l))return n(null);zy(t,e,r,n);}):zy(t,e,r,n);});}function zy(t,e,r,n){wO(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,bO(i.toCwd,r,(o,l)=>{if(o)return n(o);let c=Gy.dirname(e);AO(c,(p,u)=>{if(p)return n(p);if(u)return At.symlink(t,e,l,n);mO(c,g=>{if(g)return n(g);At.symlink(t,e,l,n);});});});});}function xO(t,e,r){let n;try{n=At.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let l=At.statSync(t),c=At.statSync(e);if(Jy(l,c))return}let s=SO(t,e);t=s.toDst,r=EO(s.toCwd,r);let i=Gy.dirname(e);return At.existsSync(i)||vO(i),At.symlinkSync(t,e,r)}Xy.exports={createSymlink:yO(_O),createSymlinkSync:xO};});var om=R((gN,sm)=>{var{createFile:Zy,createFileSync:em}=Ly(),{createLink:tm,createLinkSync:rm}=My(),{createSymlink:nm,createSymlinkSync:im}=Qy();sm.exports={createFile:Zy,createFileSync:em,ensureFile:Zy,ensureFileSync:em,createLink:tm,createLinkSync:rm,ensureLink:tm,ensureLinkSync:rm,createSymlink:nm,createSymlinkSync:im,ensureSymlink:nm,ensureSymlinkSync:im};});var $s=R((yN,am)=>{function CO(t,{EOL:e=` -`,finalEOL:r=!0,replacer:n=null,spaces:s}={}){let i=r?e:"";return JSON.stringify(t,n,s).replace(/\n/g,e)+i}function RO(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}am.exports={stringify:CO,stripBom:RO};});var fm=R((mN,cm)=>{var fn;try{fn=Qe();}catch{fn=z("fs");}var Is=Xe(),{stringify:lm,stripBom:um}=$s();async function OO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||fn,n="throws"in e?e.throws:!0,s=await Is.fromCallback(r.readFile)(t,e);s=um(s);let i;try{i=JSON.parse(s,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return i}var PO=Is.fromPromise(OO);function TO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||fn,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=um(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function $O(t,e,r={}){let n=r.fs||fn,s=lm(e,r);await Is.fromCallback(n.writeFile)(t,s,r);}var IO=Is.fromPromise($O);function kO(t,e,r={}){let n=r.fs||fn,s=lm(e,r);return n.writeFileSync(t,s,r)}var LO={readFile:PO,readFileSync:TO,writeFile:IO,writeFileSync:kO};cm.exports=LO;});var pm=R((vN,hm)=>{var ks=fm();hm.exports={readJson:ks.readFile,readJsonSync:ks.readFileSync,writeJson:ks.writeFile,writeJsonSync:ks.writeFileSync};});var Ls=R((wN,ym)=>{var FO=Xe().fromCallback,ii=Qe(),dm=z("path"),gm=Et(),qO=ur().pathExists;function DO(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=dm.dirname(t);qO(s,(i,o)=>{if(i)return n(i);if(o)return ii.writeFile(t,e,r,n);gm.mkdirs(s,l=>{if(l)return n(l);ii.writeFile(t,e,r,n);});});}function NO(t,...e){let r=dm.dirname(t);if(ii.existsSync(r))return ii.writeFileSync(t,...e);gm.mkdirsSync(r),ii.writeFileSync(t,...e);}ym.exports={outputFile:FO(DO),outputFileSync:NO};});var vm=R((SN,mm)=>{var{stringify:MO}=$s(),{outputFile:jO}=Ls();async function BO(t,e,r={}){let n=MO(e,r);await jO(t,n,r);}mm.exports=BO;});var Sm=R((bN,wm)=>{var{stringify:HO}=$s(),{outputFileSync:UO}=Ls();function WO(t,e,r){let n=HO(e,r);UO(t,n,r);}wm.exports=WO;});var Em=R((EN,bm)=>{var zO=Xe().fromPromise,Ye=pm();Ye.outputJson=zO(vm());Ye.outputJsonSync=Sm();Ye.outputJSON=Ye.outputJson;Ye.outputJSONSync=Ye.outputJsonSync;Ye.writeJSON=Ye.writeJson;Ye.writeJSONSync=Ye.writeJsonSync;Ye.readJSON=Ye.readJson;Ye.readJSONSync=Ye.readJsonSync;bm.exports=Ye;});var Rm=R((AN,Cm)=>{var GO=Qe(),Sl=z("path"),KO=Ts().copy,xm=ri().remove,VO=Et().mkdirp,YO=ur().pathExists,Am=$r();function JO(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;Am.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:l,isChangingCase:c=!1}=o;Am.checkParentPaths(t,l,e,"move",p=>{if(p)return n(p);if(XO(e))return _m(t,e,s,c,n);VO(Sl.dirname(e),u=>u?n(u):_m(t,e,s,c,n));});});}function XO(t){let e=Sl.dirname(t);return Sl.parse(e).root===e}function _m(t,e,r,n,s){if(n)return wl(t,e,r,s);if(r)return xm(e,i=>i?s(i):wl(t,e,r,s));YO(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):wl(t,e,r,s));}function wl(t,e,r,n){GO.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):QO(t,e,r,n):n());}function QO(t,e,r,n){KO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):xm(t,n));}Cm.exports=JO;});var Im=R((_N,$m)=>{var Pm=Qe(),El=z("path"),ZO=Ts().copySync,Tm=ri().removeSync,eP=Et().mkdirpSync,Om=$r();function tP(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=Om.checkPathsSync(t,e,"move",r);return Om.checkParentPathsSync(t,s,e,"move"),rP(e)||eP(El.dirname(e)),nP(t,e,n,i)}function rP(t){let e=El.dirname(t);return El.parse(e).root===e}function nP(t,e,r,n){if(n)return bl(t,e,r);if(r)return Tm(e),bl(t,e,r);if(Pm.existsSync(e))throw new Error("dest already exists.");return bl(t,e,r)}function bl(t,e,r){try{Pm.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return iP(t,e,r)}}function iP(t,e,r){return ZO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Tm(t)}$m.exports=tP;});var Lm=R((xN,km)=>{var sP=Xe().fromCallback;km.exports={move:sP(Rm()),moveSync:Im()};});var Al=R((CN,Fm)=>{Fm.exports={...Tr(),...Ts(),...Ty(),...om(),...Em(),...Et(),...Lm(),...Ls(),...ur(),...ri()};});var xl=R((PN,Nm)=>{var si=t=>t&&typeof t.message=="string",_l=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return si(r)?r:void 0}else return si(e)?e:void 0},qm=(t,e)=>{if(!si(t))return "";let r=t.stack||"";if(e.has(t))return r+` -causes have become circular...`;let n=_l(t);return n?(e.add(t),r+` -caused by: `+qm(n,e)):r},oP=t=>qm(t,new Set),Dm=(t,e,r)=>{if(!si(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=_l(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Dm(s,e,i)}else return n},aP=t=>Dm(t,new Set);Nm.exports={isErrorLike:si,getErrorCause:_l,stackWithCauses:oP,messageWithCauses:aP};});var Cl=R((TN,jm)=>{var lP=Symbol("circular-ref-tag"),qs=Symbol("pino-raw-err-ref"),Mm=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[qs]},set:function(t){this[qs]=t;}}});Object.defineProperty(Mm,qs,{writable:!0,value:{}});jm.exports={pinoErrProto:Mm,pinoErrorSymbols:{seen:lP,rawSymbol:qs}};});var Um=R(($N,Hm)=>{Hm.exports=Ol;var{messageWithCauses:uP,stackWithCauses:cP,isErrorLike:Bm}=xl(),{pinoErrProto:fP,pinoErrorSymbols:hP}=Cl(),{seen:Rl}=hP,{toString:pP}=Object.prototype;function Ol(t){if(!Bm(t))return t;t[Rl]=void 0;let e=Object.create(fP);e.type=pP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=uP(t),e.stack=cP(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Ol(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Bm(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Rl)&&(e[r]=Ol(n)):e[r]=n;}return delete t[Rl],e.raw=t,e}});var zm=R((IN,Wm)=>{Wm.exports=Ns;var{isErrorLike:Pl}=xl(),{pinoErrProto:dP,pinoErrorSymbols:gP}=Cl(),{seen:Ds}=gP,{toString:yP}=Object.prototype;function Ns(t){if(!Pl(t))return t;t[Ds]=void 0;let e=Object.create(dP);e.type=yP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Ns(r))),Pl(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Ds)&&(e.cause=Ns(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Pl(n)?Object.prototype.hasOwnProperty.call(n,Ds)||(e[r]=Ns(n)):e[r]=n;}return delete t[Ds],e.raw=t,e}});var Ym=R((kN,Vm)=>{Vm.exports={mapHttpRequest:mP,reqSerializer:Km};var Tl=Symbol("pino-raw-req-ref"),Gm=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Tl]},set:function(t){this[Tl]=t;}}});Object.defineProperty(Gm,Tl,{writable:!0,value:{}});function Km(t){let e=t.info||t.socket,r=Object.create(Gm);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function mP(t){return {req:Km(t)}}});var Zm=R((LN,Qm)=>{Qm.exports={mapHttpResponse:vP,resSerializer:Xm};var $l=Symbol("pino-raw-res-ref"),Jm=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$l]},set:function(t){this[$l]=t;}}});Object.defineProperty(Jm,$l,{writable:!0,value:{}});function Xm(t){let e=Object.create(Jm);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function vP(t){return {res:Xm(t)}}});var kl=R((FN,ev)=>{var Il=Um(),wP=zm(),Ms=Ym(),js=Zm();ev.exports={err:Il,errWithCause:wP,mapHttpRequest:Ms.mapHttpRequest,mapHttpResponse:js.mapHttpResponse,req:Ms.reqSerializer,res:js.resSerializer,wrapErrorSerializer:function(e){return e===Il?e:function(n){return e(Il(n))}},wrapRequestSerializer:function(e){return e===Ms.reqSerializer?e:function(n){return e(Ms.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===js.resSerializer?e:function(n){return e(js.resSerializer(n))}}};});var Ll=R((qN,tv)=>{function SP(t,e){return e}tv.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=SP;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s};});var nv=R((DN,rv)=>{rv.exports=bP;function bP(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:s}){s.forEach(i=>{if(typeof i!="string")throw Error(e());try{if(/〇/.test(i))throw Error();let o=(i[0]==="["?"":".")+i.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(` + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:s}=dn.checkPathsSync(t,e,"copy",r);if(dn.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=hn.dirname(e);return $e.existsSync(i)||JC(i),bm(s,t,e,r)}function bm(t,e,r,n){let i=(n.dereference?$e.statSync:$e.lstatSync)(e);if(i.isDirectory())return oR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return eR(i,t,e,r,n);if(i.isSymbolicLink())return uR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function eR(t,e,r,n,s){return e?tR(t,r,n,s):vm(t,r,n,s)}function tR(t,e,r,n){if(n.overwrite)return $e.unlinkSync(r),vm(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function vm(t,e,r,n){return $e.copyFileSync(e,r),n.preserveTimestamps&&rR(t.mode,e,r),Ca(r,t.mode)}function rR(t,e,r){return nR(t)&&iR(r,t),sR(e,r)}function nR(t){return (t&128)===0}function iR(t,e){return Ca(t,e|128)}function Ca(t,e){return $e.chmodSync(t,e)}function sR(t,e){let r=$e.statSync(t);return XC(e,r.atime,r.mtime)}function oR(t,e,r,n,s){return e?Sm(r,n,s):aR(t.mode,r,n,s)}function aR(t,e,r,n){return $e.mkdirSync(r),Sm(e,r,n),Ca(r,t)}function Sm(t,e,r){$e.readdirSync(t).forEach(n=>lR(n,t,e,r));}function lR(t,e,r,n){let s=hn.join(e,t),i=hn.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=dn.checkPathsSync(s,i,"copy",n);return bm(o,s,i,n)}function uR(t,e,r,n){let s=$e.readlinkSync(e);if(n.dereference&&(s=hn.resolve(process.cwd(),s)),t){let i;try{i=$e.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return $e.symlinkSync(s,r);throw o}if(n.dereference&&(i=hn.resolve(process.cwd(),i)),dn.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(dn.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return cR(s,r)}else return $e.symlinkSync(s,r)}function cR(t,e){return $e.unlinkSync(e),$e.symlinkSync(t,e)}Em.exports=QC;});var Di=T((E$,xm)=>{var fR=qe().fromCallback;xm.exports={copy:fR(wm()),copySync:Am()};});var pn=T((A$,Rm)=>{var Cm=Be(),hR=qe().fromCallback;function dR(t,e){Cm.rm(t,{recursive:!0,force:!0},e);}function pR(t){Cm.rmSync(t,{recursive:!0,force:!0});}Rm.exports={remove:hR(dR),removeSync:pR};});var km=T((x$,Nm)=>{var mR=qe().fromPromise,Pm=Xt(),Om=G("path"),Mm=st(),Fm=pn(),Tm=mR(async function(e){let r;try{r=await Pm.readdir(e);}catch{return Mm.mkdirs(e)}return Promise.all(r.map(n=>Fm.remove(Om.join(e,n))))});function Im(t){let e;try{e=Pm.readdirSync(t);}catch{return Mm.mkdirsSync(t)}e.forEach(r=>{r=Om.join(t,r),Fm.removeSync(r);});}Nm.exports={emptyDirSync:Im,emptydirSync:Im,emptyDir:Tm,emptydir:Tm};});var qm=T((C$,Dm)=>{var _R=qe().fromCallback,$m=G("path"),$t=Be(),Lm=st();function gR(t,e){function r(){$t.writeFile(t,"",n=>{if(n)return e(n);e();});}$t.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=$m.dirname(t);$t.stat(i,(o,a)=>{if(o)return o.code==="ENOENT"?Lm.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);a.isDirectory()?r():$t.readdir(i,c=>{if(c)return e(c)});});});}function yR(t){let e;try{e=$t.statSync(t);}catch{}if(e&&e.isFile())return;let r=$m.dirname(t);try{$t.statSync(r).isDirectory()||$t.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")Lm.mkdirsSync(r);else throw n}$t.writeFileSync(t,"");}Dm.exports={createFile:_R(gR),createFileSync:yR};});var Wm=T((R$,jm)=>{var wR=qe().fromCallback,Bm=G("path"),Lt=Be(),Um=st(),bR=kt().pathExists,{areIdentical:Hm}=Qt();function vR(t,e,r){function n(s,i){Lt.link(s,i,o=>{if(o)return r(o);r(null);});}Lt.lstat(e,(s,i)=>{Lt.lstat(t,(o,a)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&Hm(a,i))return r(null);let c=Bm.dirname(e);bR(c,(d,u)=>{if(d)return r(d);if(u)return n(t,e);Um.mkdirs(c,p=>{if(p)return r(p);n(t,e);});});});});}function SR(t,e){let r;try{r=Lt.lstatSync(e);}catch{}try{let i=Lt.lstatSync(t);if(r&&Hm(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Bm.dirname(e);return Lt.existsSync(n)||Um.mkdirsSync(n),Lt.linkSync(t,e)}jm.exports={createLink:wR(vR),createLinkSync:SR};});var Gm=T((T$,zm)=>{var Dt=G("path"),mn=Be(),ER=kt().pathExists;function AR(t,e,r){if(Dt.isAbsolute(t))return mn.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=Dt.dirname(e),s=Dt.join(n,t);return ER(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):mn.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:Dt.relative(n,t)})))}}function xR(t,e){let r;if(Dt.isAbsolute(t)){if(r=mn.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=Dt.dirname(e),s=Dt.join(n,t);if(r=mn.existsSync(s),r)return {toCwd:s,toDst:t};if(r=mn.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:Dt.relative(n,t)}}}zm.exports={symlinkPaths:AR,symlinkPathsSync:xR};});var Zm=T((I$,Km)=>{var Vm=Be();function CR(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);Vm.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function RR(t,e){let r;if(e)return e;try{r=Vm.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Km.exports={symlinkType:CR,symlinkTypeSync:RR};});var n_=T((P$,r_)=>{var TR=qe().fromCallback,Jm=G("path"),ot=Xt(),Xm=st(),IR=Xm.mkdirs,PR=Xm.mkdirsSync,Qm=Gm(),OR=Qm.symlinkPaths,MR=Qm.symlinkPathsSync,e_=Zm(),FR=e_.symlinkType,NR=e_.symlinkTypeSync,kR=kt().pathExists,{areIdentical:t_}=Qt();function $R(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,ot.lstat(e,(s,i)=>{!s&&i.isSymbolicLink()?Promise.all([ot.stat(t),ot.stat(e)]).then(([o,a])=>{if(t_(o,a))return n(null);Ym(t,e,r,n);}):Ym(t,e,r,n);});}function Ym(t,e,r,n){OR(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,FR(i.toCwd,r,(o,a)=>{if(o)return n(o);let c=Jm.dirname(e);kR(c,(d,u)=>{if(d)return n(d);if(u)return ot.symlink(t,e,a,n);IR(c,p=>{if(p)return n(p);ot.symlink(t,e,a,n);});});});});}function LR(t,e,r){let n;try{n=ot.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let a=ot.statSync(t),c=ot.statSync(e);if(t_(a,c))return}let s=MR(t,e);t=s.toDst,r=NR(s.toCwd,r);let i=Jm.dirname(e);return ot.existsSync(i)||PR(i),ot.symlinkSync(t,e,r)}r_.exports={createSymlink:TR($R),createSymlinkSync:LR};});var f_=T((O$,c_)=>{var{createFile:i_,createFileSync:s_}=qm(),{createLink:o_,createLinkSync:a_}=Wm(),{createSymlink:l_,createSymlinkSync:u_}=n_();c_.exports={createFile:i_,createFileSync:s_,ensureFile:i_,ensureFileSync:s_,createLink:o_,createLinkSync:a_,ensureLink:o_,ensureLinkSync:a_,createSymlink:l_,createSymlinkSync:u_,ensureSymlink:l_,ensureSymlinkSync:u_};});var qi=T((M$,h_)=>{function DR(t,{EOL:e=` +`,finalEOL:r=!0,replacer:n=null,spaces:s}={}){let i=r?e:"";return JSON.stringify(t,n,s).replace(/\n/g,e)+i}function qR(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}h_.exports={stringify:DR,stripBom:qR};});var __=T((F$,m_)=>{var Rr;try{Rr=Be();}catch{Rr=G("fs");}var Bi=qe(),{stringify:d_,stripBom:p_}=qi();async function BR(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Rr,n="throws"in e?e.throws:!0,s=await Bi.fromCallback(r.readFile)(t,e);s=p_(s);let i;try{i=JSON.parse(s,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return i}var UR=Bi.fromPromise(BR);function HR(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Rr,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=p_(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function jR(t,e,r={}){let n=r.fs||Rr,s=d_(e,r);await Bi.fromCallback(n.writeFile)(t,s,r);}var WR=Bi.fromPromise(jR);function zR(t,e,r={}){let n=r.fs||Rr,s=d_(e,r);return n.writeFileSync(t,s,r)}var GR={readFile:UR,readFileSync:HR,writeFile:WR,writeFileSync:zR};m_.exports=GR;});var y_=T((N$,g_)=>{var Ui=__();g_.exports={readJson:Ui.readFile,readJsonSync:Ui.readFileSync,writeJson:Ui.writeFile,writeJsonSync:Ui.writeFileSync};});var Hi=T((k$,v_)=>{var VR=qe().fromCallback,_n=Be(),w_=G("path"),b_=st(),KR=kt().pathExists;function ZR(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=w_.dirname(t);KR(s,(i,o)=>{if(i)return n(i);if(o)return _n.writeFile(t,e,r,n);b_.mkdirs(s,a=>{if(a)return n(a);_n.writeFile(t,e,r,n);});});}function YR(t,...e){let r=w_.dirname(t);if(_n.existsSync(r))return _n.writeFileSync(t,...e);b_.mkdirsSync(r),_n.writeFileSync(t,...e);}v_.exports={outputFile:VR(ZR),outputFileSync:YR};});var E_=T(($$,S_)=>{var{stringify:JR}=qi(),{outputFile:XR}=Hi();async function QR(t,e,r={}){let n=JR(e,r);await XR(t,n,r);}S_.exports=QR;});var x_=T((L$,A_)=>{var{stringify:eT}=qi(),{outputFileSync:tT}=Hi();function rT(t,e,r){let n=eT(e,r);tT(t,n,r);}A_.exports=rT;});var R_=T((D$,C_)=>{var nT=qe().fromPromise,Le=y_();Le.outputJson=nT(E_());Le.outputJsonSync=x_();Le.outputJSON=Le.outputJson;Le.outputJSONSync=Le.outputJsonSync;Le.writeJSON=Le.writeJson;Le.writeJSONSync=Le.writeJsonSync;Le.readJSON=Le.readJson;Le.readJSONSync=Le.readJsonSync;C_.exports=Le;});var M_=T((q$,O_)=>{var iT=Be(),Ta=G("path"),sT=Di().copy,P_=pn().remove,oT=st().mkdirp,aT=kt().pathExists,T_=Qt();function lT(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;T_.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:a,isChangingCase:c=!1}=o;T_.checkParentPaths(t,a,e,"move",d=>{if(d)return n(d);if(uT(e))return I_(t,e,s,c,n);oT(Ta.dirname(e),u=>u?n(u):I_(t,e,s,c,n));});});}function uT(t){let e=Ta.dirname(t);return Ta.parse(e).root===e}function I_(t,e,r,n,s){if(n)return Ra(t,e,r,s);if(r)return P_(e,i=>i?s(i):Ra(t,e,r,s));aT(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):Ra(t,e,r,s));}function Ra(t,e,r,n){iT.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):cT(t,e,r,n):n());}function cT(t,e,r,n){sT(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):P_(t,n));}O_.exports=lT;});var L_=T((B$,$_)=>{var N_=Be(),Pa=G("path"),fT=Di().copySync,k_=pn().removeSync,hT=st().mkdirpSync,F_=Qt();function dT(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=F_.checkPathsSync(t,e,"move",r);return F_.checkParentPathsSync(t,s,e,"move"),pT(e)||hT(Pa.dirname(e)),mT(t,e,n,i)}function pT(t){let e=Pa.dirname(t);return Pa.parse(e).root===e}function mT(t,e,r,n){if(n)return Ia(t,e,r);if(r)return k_(e),Ia(t,e,r);if(N_.existsSync(e))throw new Error("dest already exists.");return Ia(t,e,r)}function Ia(t,e,r){try{N_.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return _T(t,e,r)}}function _T(t,e,r){return fT(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),k_(t)}$_.exports=dT;});var q_=T((U$,D_)=>{var gT=qe().fromCallback;D_.exports={move:gT(M_()),moveSync:L_()};});var Oa=T((H$,B_)=>{B_.exports={...Xt(),...Di(),...km(),...f_(),...R_(),...st(),...q_(),...Hi(),...kt(),...pn()};});var gn=T((j$,z_)=>{var yT=G("path"),dt="\\\\/",U_=`[^${dt}]`,bt="\\.",wT="\\+",bT="\\?",ji="\\/",vT="(?=.)",H_="[^/]",Ma=`(?:${ji}|$)`,j_=`(?:^|${ji})`,Fa=`${bt}{1,2}${Ma}`,ST=`(?!${bt})`,ET=`(?!${j_}${Fa})`,AT=`(?!${bt}{0,1}${Ma})`,xT=`(?!${Fa})`,CT=`[^.${ji}]`,RT=`${H_}*?`,W_={DOT_LITERAL:bt,PLUS_LITERAL:wT,QMARK_LITERAL:bT,SLASH_LITERAL:ji,ONE_CHAR:vT,QMARK:H_,END_ANCHOR:Ma,DOTS_SLASH:Fa,NO_DOT:ST,NO_DOTS:ET,NO_DOT_SLASH:AT,NO_DOTS_SLASH:xT,QMARK_NO_DOT:CT,STAR:RT,START_ANCHOR:j_},TT={...W_,SLASH_LITERAL:`[${dt}]`,QMARK:U_,STAR:`${U_}*?`,DOTS_SLASH:`${bt}{1,2}(?:[${dt}]|$)`,NO_DOT:`(?!${bt})`,NO_DOTS:`(?!(?:^|[${dt}])${bt}{1,2}(?:[${dt}]|$))`,NO_DOT_SLASH:`(?!${bt}{0,1}(?:[${dt}]|$))`,NO_DOTS_SLASH:`(?!${bt}{1,2}(?:[${dt}]|$))`,QMARK_NO_DOT:`[^.${dt}]`,START_ANCHOR:`(?:^|[${dt}])`,END_ANCHOR:`(?:[${dt}]|$)`},IT={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};z_.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:IT,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:yT.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?TT:W_}};});var Wi=T(He=>{var PT=G("path"),OT=process.platform==="win32",{REGEX_BACKSLASH:MT,REGEX_REMOVE_BACKSLASH:FT,REGEX_SPECIAL_CHARS:NT,REGEX_SPECIAL_CHARS_GLOBAL:kT}=gn();He.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);He.hasRegexChars=t=>NT.test(t);He.isRegexChar=t=>t.length===1&&He.hasRegexChars(t);He.escapeRegex=t=>t.replace(kT,"\\$1");He.toPosixSlashes=t=>t.replace(MT,"/");He.removeBackslashes=t=>t.replace(FT,e=>e==="\\"?"":e);He.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};He.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:OT===!0||PT.sep==="\\";He.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?He.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};He.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};He.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var Q_=T((z$,X_)=>{var G_=Wi(),{CHAR_ASTERISK:Na,CHAR_AT:$T,CHAR_BACKWARD_SLASH:yn,CHAR_COMMA:LT,CHAR_DOT:ka,CHAR_EXCLAMATION_MARK:$a,CHAR_FORWARD_SLASH:J_,CHAR_LEFT_CURLY_BRACE:La,CHAR_LEFT_PARENTHESES:Da,CHAR_LEFT_SQUARE_BRACKET:DT,CHAR_PLUS:qT,CHAR_QUESTION_MARK:V_,CHAR_RIGHT_CURLY_BRACE:BT,CHAR_RIGHT_PARENTHESES:K_,CHAR_RIGHT_SQUARE_BRACKET:UT}=gn(),Z_=t=>t===J_||t===yn,Y_=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},HT=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],a=[],c=t,d=-1,u=0,p=0,_=!1,m=!1,y=!1,v=!1,E=!1,A=!1,w=!1,x=!1,M=!1,k=!1,j=0,U,$,F={value:"",depth:0,isGlob:!1},B=()=>d>=n,R=()=>c.charCodeAt(d+1),z=()=>(U=$,c.charCodeAt(++d));for(;d0&&(te=c.slice(0,u),c=c.slice(u),p-=u),V&&y===!0&&p>0?(V=c.slice(0,p),I=c.slice(p)):y===!0?(V="",I=c):V=c,V&&V!==""&&V!=="/"&&V!==c&&Z_(V.charCodeAt(V.length-1))&&(V=V.slice(0,-1)),r.unescape===!0&&(I&&(I=G_.removeBackslashes(I)),V&&w===!0&&(V=G_.removeBackslashes(V)));let O={prefix:te,input:t,start:u,base:V,glob:I,isBrace:_,isBracket:m,isGlob:y,isExtglob:v,isGlobstar:E,negated:x,negatedExtglob:M};if(r.tokens===!0&&(O.maxDepth=0,Z_($)||o.push(F),O.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let Q=0;Q{var zi=gn(),Ke=Wi(),{MAX_LENGTH:Gi,POSIX_REGEX_SOURCE:jT,REGEX_NON_SPECIAL_CHARS:WT,REGEX_SPECIAL_CHARS_BACKREF:zT,REPLACEMENTS:eg}=zi,GT=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},Tr=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,qa=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=eg[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Gi,r.maxLength):Gi,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],a=r.capture?"":"?:",c=Ke.isWindows(e),d=zi.globChars(c),u=zi.extglobChars(d),{DOT_LITERAL:p,PLUS_LITERAL:_,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:v,NO_DOT:E,NO_DOT_SLASH:A,NO_DOTS_SLASH:w,QMARK:x,QMARK_NO_DOT:M,STAR:k,START_ANCHOR:j}=d,U=Z=>`(${a}(?:(?!${j}${Z.dot?v:p}).)*?)`,$=r.dot?"":E,F=r.dot?x:M,B=r.bash===!0?U(r):k;r.capture&&(B=`(${B})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let R={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Ke.removePrefix(t,R),s=t.length;let z=[],V=[],te=[],I=i,O,X=()=>R.index===s-1,Q=R.peek=(Z=1)=>t[R.index+Z],ie=R.advance=()=>t[++R.index]||"",Ne=()=>t.slice(R.index+1),ve=(Z="",he=0)=>{R.consumed+=Z,R.index+=he;},Et=Z=>{R.output+=Z.output!=null?Z.output:Z.value,ve(Z.value);},Hr=()=>{let Z=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),R.start++,Z++;return Z%2===0?!1:(R.negated=!0,R.start++,!0)},At=Z=>{R[Z]++,te.push(Z);},nt=Z=>{R[Z]--,te.pop();},se=Z=>{if(I.type==="globstar"){let he=R.braces>0&&(Z.type==="comma"||Z.type==="brace"),W=Z.extglob===!0||z.length&&(Z.type==="pipe"||Z.type==="paren");Z.type!=="slash"&&Z.type!=="paren"&&!he&&!W&&(R.output=R.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=B,R.output+=I.output);}if(z.length&&Z.type!=="paren"&&(z[z.length-1].inner+=Z.value),(Z.value||Z.output)&&Et(Z),I&&I.type==="text"&&Z.type==="text"){I.value+=Z.value,I.output=(I.output||"")+Z.value;return}Z.prev=I,o.push(Z),I=Z;},lr=(Z,he)=>{let W={...u[he],conditions:1,inner:""};W.prev=I,W.parens=R.parens,W.output=R.output;let ne=(r.capture?"(":"")+W.open;At("parens"),se({type:Z,value:he,output:R.output?"":y}),se({type:"paren",extglob:!0,value:ie(),output:ne}),z.push(W);},Hs=Z=>{let he=Z.close+(r.capture?")":""),W;if(Z.type==="negate"){let ne=B;if(Z.inner&&Z.inner.length>1&&Z.inner.includes("/")&&(ne=U(r)),(ne!==B||X()||/^\)+$/.test(Ne()))&&(he=Z.close=`)$))${ne}`),Z.inner.includes("*")&&(W=Ne())&&/^\.[^\\/.]+$/.test(W)){let de=qa(W,{...e,fastpaths:!1}).output;he=Z.close=`)${de})${ne})`;}Z.prev.type==="bos"&&(R.negatedExtglob=!0);}se({type:"paren",extglob:!0,value:O,output:he}),nt("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let Z=!1,he=t.replace(zT,(W,ne,de,Re,ge,Wt)=>Re==="\\"?(Z=!0,W):Re==="?"?ne?ne+Re+(ge?x.repeat(ge.length):""):Wt===0?F+(ge?x.repeat(ge.length):""):x.repeat(de.length):Re==="."?p.repeat(de.length):Re==="*"?ne?ne+Re+(ge?B:""):B:ne?W:`\\${W}`);return Z===!0&&(r.unescape===!0?he=he.replace(/\\/g,""):he=he.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),he===t&&r.contains===!0?(R.output=t,R):(R.output=Ke.wrapOutput(he,R,e),R)}for(;!X();){if(O=ie(),O==="\0")continue;if(O==="\\"){let W=Q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){O+="\\",se({type:"text",value:O});continue}let ne=/^\\+/.exec(Ne()),de=0;if(ne&&ne[0].length>2&&(de=ne[0].length,R.index+=de,de%2!==0&&(O+="\\")),r.unescape===!0?O=ie():O+=ie(),R.brackets===0){se({type:"text",value:O});continue}}if(R.brackets>0&&(O!=="]"||I.value==="["||I.value==="[^")){if(r.posix!==!1&&O===":"){let W=I.value.slice(1);if(W.includes("[")&&(I.posix=!0,W.includes(":"))){let ne=I.value.lastIndexOf("["),de=I.value.slice(0,ne),Re=I.value.slice(ne+2),ge=jT[Re];if(ge){I.value=de+ge,R.backtrack=!0,ie(),!i.output&&o.indexOf(I)===1&&(i.output=y);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(I.value==="["||I.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&I.value==="["&&(O="^"),I.value+=O,Et({value:O});continue}if(R.quotes===1&&O!=='"'){O=Ke.escapeRegex(O),I.value+=O,Et({value:O});continue}if(O==='"'){R.quotes=R.quotes===1?0:1,r.keepQuotes===!0&&se({type:"text",value:O});continue}if(O==="("){At("parens"),se({type:"paren",value:O});continue}if(O===")"){if(R.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Tr("opening","("));let W=z[z.length-1];if(W&&R.parens===W.parens+1){Hs(z.pop());continue}se({type:"paren",value:O,output:R.parens?")":"\\)"}),nt("parens");continue}if(O==="["){if(r.nobracket===!0||!Ne().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Tr("closing","]"));O=`\\${O}`;}else At("brackets");se({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||I&&I.type==="bracket"&&I.value.length===1){se({type:"text",value:O,output:`\\${O}`});continue}if(R.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Tr("opening","["));se({type:"text",value:O,output:`\\${O}`});continue}nt("brackets");let W=I.value.slice(1);if(I.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(O=`/${O}`),I.value+=O,Et({value:O}),r.literalBrackets===!1||Ke.hasRegexChars(W))continue;let ne=Ke.escapeRegex(I.value);if(R.output=R.output.slice(0,-I.value.length),r.literalBrackets===!0){R.output+=ne,I.value=ne;continue}I.value=`(${a}${ne}|${I.value})`,R.output+=I.value;continue}if(O==="{"&&r.nobrace!==!0){At("braces");let W={type:"brace",value:O,output:"(",outputIndex:R.output.length,tokensIndex:R.tokens.length};V.push(W),se(W);continue}if(O==="}"){let W=V[V.length-1];if(r.nobrace===!0||!W){se({type:"text",value:O,output:O});continue}let ne=")";if(W.dots===!0){let de=o.slice(),Re=[];for(let ge=de.length-1;ge>=0&&(o.pop(),de[ge].type!=="brace");ge--)de[ge].type!=="dots"&&Re.unshift(de[ge].value);ne=GT(Re,r),R.backtrack=!0;}if(W.comma!==!0&&W.dots!==!0){let de=R.output.slice(0,W.outputIndex),Re=R.tokens.slice(W.tokensIndex);W.value=W.output="\\{",O=ne="\\}",R.output=de;for(let ge of Re)R.output+=ge.output||ge.value;}se({type:"brace",value:O,output:ne}),nt("braces"),V.pop();continue}if(O==="|"){z.length>0&&z[z.length-1].conditions++,se({type:"text",value:O});continue}if(O===","){let W=O,ne=V[V.length-1];ne&&te[te.length-1]==="braces"&&(ne.comma=!0,W="|"),se({type:"comma",value:O,output:W});continue}if(O==="/"){if(I.type==="dot"&&R.index===R.start+1){R.start=R.index+1,R.consumed="",R.output="",o.pop(),I=i;continue}se({type:"slash",value:O,output:m});continue}if(O==="."){if(R.braces>0&&I.type==="dot"){I.value==="."&&(I.output=p);let W=V[V.length-1];I.type="dots",I.output+=O,I.value+=O,W.dots=!0;continue}if(R.braces+R.parens===0&&I.type!=="bos"&&I.type!=="slash"){se({type:"text",value:O,output:p});continue}se({type:"dot",value:O,output:p});continue}if(O==="?"){if(!(I&&I.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){lr("qmark",O);continue}if(I&&I.type==="paren"){let ne=Q(),de=O;if(ne==="<"&&!Ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(I.value==="("&&!/[!=<:]/.test(ne)||ne==="<"&&!/<([!=]|\w+>)/.test(Ne()))&&(de=`\\${O}`),se({type:"text",value:O,output:de});continue}if(r.dot!==!0&&(I.type==="slash"||I.type==="bos")){se({type:"qmark",value:O,output:M});continue}se({type:"qmark",value:O,output:x});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){lr("negate",O);continue}if(r.nonegate!==!0&&R.index===0){Hr();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){lr("plus",O);continue}if(I&&I.value==="("||r.regex===!1){se({type:"plus",value:O,output:_});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||R.parens>0){se({type:"plus",value:O});continue}se({type:"plus",value:_});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){se({type:"at",extglob:!0,value:O,output:""});continue}se({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let W=WT.exec(Ne());W&&(O+=W[0],R.index+=W[0].length),se({type:"text",value:O});continue}if(I&&(I.type==="globstar"||I.star===!0)){I.type="star",I.star=!0,I.value+=O,I.output=B,R.backtrack=!0,R.globstar=!0,ve(O);continue}let Z=Ne();if(r.noextglob!==!0&&/^\([^?]/.test(Z)){lr("star",O);continue}if(I.type==="star"){if(r.noglobstar===!0){ve(O);continue}let W=I.prev,ne=W.prev,de=W.type==="slash"||W.type==="bos",Re=ne&&(ne.type==="star"||ne.type==="globstar");if(r.bash===!0&&(!de||Z[0]&&Z[0]!=="/")){se({type:"star",value:O,output:""});continue}let ge=R.braces>0&&(W.type==="comma"||W.type==="brace"),Wt=z.length&&(W.type==="pipe"||W.type==="paren");if(!de&&W.type!=="paren"&&!ge&&!Wt){se({type:"star",value:O,output:""});continue}for(;Z.slice(0,3)==="/**";){let xt=t[R.index+4];if(xt&&xt!=="/")break;Z=Z.slice(3),ve("/**",3);}if(W.type==="bos"&&X()){I.type="globstar",I.value+=O,I.output=U(r),R.output=I.output,R.globstar=!0,ve(O);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!Re&&X()){R.output=R.output.slice(0,-(W.output+I.output).length),W.output=`(?:${W.output}`,I.type="globstar",I.output=U(r)+(r.strictSlashes?")":"|$)"),I.value+=O,R.globstar=!0,R.output+=W.output+I.output,ve(O);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&Z[0]==="/"){let xt=Z[1]!==void 0?"|$":"";R.output=R.output.slice(0,-(W.output+I.output).length),W.output=`(?:${W.output}`,I.type="globstar",I.output=`${U(r)}${m}|${m}${xt})`,I.value+=O,R.output+=W.output+I.output,R.globstar=!0,ve(O+ie()),se({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&Z[0]==="/"){I.type="globstar",I.value+=O,I.output=`(?:^|${m}|${U(r)}${m})`,R.output=I.output,R.globstar=!0,ve(O+ie()),se({type:"slash",value:"/",output:""});continue}R.output=R.output.slice(0,-I.output.length),I.type="globstar",I.output=U(r),I.value+=O,R.output+=I.output,R.globstar=!0,ve(O);continue}let he={type:"star",value:O,output:B};if(r.bash===!0){he.output=".*?",(I.type==="bos"||I.type==="slash")&&(he.output=$+he.output),se(he);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&r.regex===!0){he.output=O,se(he);continue}(R.index===R.start||I.type==="slash"||I.type==="dot")&&(I.type==="dot"?(R.output+=A,I.output+=A):r.dot===!0?(R.output+=w,I.output+=w):(R.output+=$,I.output+=$),Q()!=="*"&&(R.output+=y,I.output+=y)),se(he);}for(;R.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Tr("closing","]"));R.output=Ke.escapeLast(R.output,"["),nt("brackets");}for(;R.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Tr("closing",")"));R.output=Ke.escapeLast(R.output,"("),nt("parens");}for(;R.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Tr("closing","}"));R.output=Ke.escapeLast(R.output,"{"),nt("braces");}if(r.strictSlashes!==!0&&(I.type==="star"||I.type==="bracket")&&se({type:"maybe_slash",value:"",output:`${m}?`}),R.backtrack===!0){R.output="";for(let Z of R.tokens)R.output+=Z.output!=null?Z.output:Z.value,Z.suffix&&(R.output+=Z.suffix);}return R};qa.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Gi,r.maxLength):Gi,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=eg[t]||t;let i=Ke.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:d,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:_,STAR:m,START_ANCHOR:y}=zi.globChars(i),v=r.dot?p:u,E=r.dot?_:u,A=r.capture?"":"?:",w={negated:!1,prefix:""},x=r.bash===!0?".*?":m;r.capture&&(x=`(${x})`);let M=$=>$.noglobstar===!0?x:`(${A}(?:(?!${y}${$.dot?d:o}).)*?)`,k=$=>{switch($){case"*":return `${v}${c}${x}`;case".*":return `${o}${c}${x}`;case"*.*":return `${v}${x}${o}${c}${x}`;case"*/*":return `${v}${x}${a}${c}${E}${x}`;case"**":return v+M(r);case"**/*":return `(?:${v}${M(r)}${a})?${E}${c}${x}`;case"**/*.*":return `(?:${v}${M(r)}${a})?${E}${x}${o}${c}${x}`;case"**/.*":return `(?:${v}${M(r)}${a})?${o}${c}${x}`;default:{let F=/^(.*?)\.(\w+)$/.exec($);if(!F)return;let B=k(F[1]);return B?B+o+F[2]:void 0}}},j=Ke.removePrefix(t,w),U=k(j);return U&&r.strictSlashes!==!0&&(U+=`${a}?`),U};tg.exports=qa;});var ig=T((V$,ng)=>{var VT=G("path"),KT=Q_(),Ba=rg(),Ua=Wi(),ZT=gn(),YT=t=>t&&typeof t=="object"&&!Array.isArray(t),we=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(_=>we(_,e,r));return _=>{for(let m of u){let y=m(_);if(y)return y}return !1}}let n=YT(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Ua.isWindows(e),o=n?we.compileRe(t,e):we.makeRe(t,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(s.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=we(s.ignore,u,r);}let d=(u,p=!1)=>{let{isMatch:_,match:m,output:y}=we.test(u,o,e,{glob:t,posix:i}),v={glob:t,state:a,regex:o,posix:i,input:u,output:y,match:m,isMatch:_};return typeof s.onResult=="function"&&s.onResult(v),_===!1?(v.isMatch=!1,p?v:!1):c(u)?(typeof s.onIgnore=="function"&&s.onIgnore(v),v.isMatch=!1,p?v:!1):(typeof s.onMatch=="function"&&s.onMatch(v),p?v:!0)};return r&&(d.state=a),d};we.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let i=r||{},o=i.format||(s?Ua.toPosixSlashes:null),a=t===n,c=a&&o?o(t):t;return a===!1&&(c=o?o(t):t,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=we.matchBase(t,e,r,s):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};we.matchBase=(t,e,r,n=Ua.isWindows(r))=>(e instanceof RegExp?e:we.makeRe(e,r)).test(VT.basename(t));we.isMatch=(t,e,r)=>we(e,r)(t);we.parse=(t,e)=>Array.isArray(t)?t.map(r=>we.parse(r,e)):Ba(t,{...e,fastpaths:!1});we.scan=(t,e)=>KT(t,e);we.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=we.toRegex(a,e);return n===!0&&(c.state=t),c};we.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=Ba.fastpaths(t,e)),s.output||(s=Ba(t,e)),we.compileRe(s,e,r,n)};we.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};we.constants=ZT;ng.exports=we;});var Ha=T((K$,sg)=>{sg.exports=ig();});var dg=T((Z$,hg)=>{var bn=G("fs"),{Readable:JT}=G("stream"),wn=G("path"),{promisify:Yi}=G("util"),ja=Ha(),XT=Yi(bn.readdir),QT=Yi(bn.stat),og=Yi(bn.lstat),e1=Yi(bn.realpath),t1="!",cg="READDIRP_RECURSIVE_ERROR",r1=new Set(["ENOENT","EPERM","EACCES","ELOOP",cg]),Wa="files",fg="directories",Ki="files_directories",Vi="all",ag=[Wa,fg,Ki,Vi],n1=t=>r1.has(t.code),[lg,i1]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),s1=process.platform==="win32"&&(lg>10||lg===10&&i1>=5),ug=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=ja(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===t1?r.push(ja(s.slice(1))):e.push(ja(s));}return r.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!r.some(s=>s(n.basename)):n=>!r.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},Zi=class t extends JT{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Wa,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:s}=r;this._fileFilter=ug(r.fileFilter),this._directoryFilter=ug(r.directoryFilter);let i=r.lstat?og:QT;s1?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[fg,Ki,Vi].includes(s),this._wantsFile=[Wa,Ki,Vi].includes(s),this._wantsEverything=s===Vi,this._root=wn.resolve(n),this._isDirent="Dirent"in bn&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(i)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await XT(e,this._rdOptions);}catch(s){this._onError(s);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let s=this._isDirent?e.name:e,i=wn.resolve(wn.join(r,s));n={path:wn.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i);}catch(s){this._onError(s);}return n}_onError(e){n1(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let s=await e1(n),i=await og(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===wn.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return a.code=cg,this._onError(a)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},Ir=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=Ki),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!ag.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${ag.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Zi(e)},o1=(t,e={})=>new Promise((r,n)=>{let s=[];Ir(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});Ir.promise=o1;Ir.ReaddirpStream=Zi;Ir.default=Ir;hg.exports=Ir;});var za=T((Y$,pg)=>{pg.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")};});var bg=T((yg,wg)=>{Object.defineProperty(yg,"__esModule",{value:!0});var gg=Ha(),a1=za(),mg="!",l1={returnIndex:!1},u1=t=>Array.isArray(t)?t:[t],c1=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=gg(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},_g=(t,e,r,n)=>{let s=Array.isArray(r),i=s?r[0]:r;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=a1(i,!1);for(let c=0;c{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=u1(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===mg).map(c=>c.slice(1)).map(c=>gg(c,n)),a=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==mg).map(c=>c1(c,n));return e==null?(c,d=!1)=>_g(a,o,c,typeof d=="boolean"?d:!1):_g(a,o,e,s)};Ga.default=Ga;wg.exports=Ga;});var Sg=T((J$,vg)=>{vg.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var Va=T((X$,Ag)=>{var f1=Sg(),Eg={"{":"}","(":")","[":"]"},h1=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;ee&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(o=t.indexOf("\\",r),o===-1||o>i))))return !0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=Eg[a];if(c){var d=t.indexOf(c,e);d!==-1&&(e=d+1);}if(t[e]==="!")return !0}else e++;}return !1},d1=function(t){if(t[0]==="!")return !0;for(var e=0;e{var p1=Va(),m1=G("path").posix.dirname,_1=G("os").platform()==="win32",Ka="/",g1=/\\/g,y1=/[\{\[].*[\}\]]$/,w1=/(^|[^\\])([\{\[]|\([^\)]+$)/,b1=/\\([\!\*\?\|\[\]\(\)\{\}])/g;xg.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&_1&&e.indexOf(Ka)<0&&(e=e.replace(g1,Ka)),y1.test(e)&&(e+=Ka),e+="a";do e=m1(e);while(p1(e)||w1.test(e));return e.replace(b1,"$1")};});var Ji=T(et=>{et.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;et.find=(t,e)=>t.nodes.find(r=>r.type===e);et.exceedsLimit=(t,e,r=1,n)=>n===!1||!et.isInteger(t)||!et.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;et.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};et.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);et.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;et.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;et.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);et.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s{var Rg=Ji();Tg.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&Rg.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return (i||o)&&Rg.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(t)};});var Pg=T((rL,Ig)=>{Ig.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var qg=T((nL,Dg)=>{var Og=Pg(),er=(t,e,r)=>{if(Og(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Og(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=t+":"+e+"="+s+i+o+a;if(er.cache.hasOwnProperty(c))return er.cache[c].result;let d=Math.min(t,e),u=Math.max(t,e);if(Math.abs(d-u)===1){let v=t+"|"+e;return n.capture?`(${v})`:n.wrap===!1?v:`(?:${v})`}let p=Lg(t)||Lg(e),_={min:t,max:e,a:d,b:u},m=[],y=[];if(p&&(_.isPadded=p,_.maxLen=String(_.max).length),d<0){let v=u<0?Math.abs(u):1;y=Mg(v,Math.abs(d),_,n),d=_.a=0;}return u>=0&&(m=Mg(d,u,_,n)),_.negatives=y,_.positives=m,_.result=v1(y,m),n.capture===!0?_.result=`(${_.result})`:n.wrap!==!1&&m.length+y.length>1&&(_.result=`(?:${_.result})`),er.cache[c]=_,_.result};function v1(t,e,r){let n=Za(t,e,"-",!1)||[],s=Za(e,t,"",!1)||[],i=Za(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function S1(t,e){let r=1,n=1,s=Ng(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=Ng(t,r);for(s=kg(e+1,n)-1;t1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+$g(a.count),o=d+1;continue}r.isPadded&&(p=R1(d,r,n)),u.string=p+u.pattern+$g(u.count),i.push(u),o=d+1,a=u;}return i}function Za(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!Fg(e,"string",a)&&i.push(r+a),n&&Fg(e,"string",a)&&i.push(r+a);}return i}function A1(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function Fg(t,e,r){return t.some(n=>n[e]===r)}function Ng(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function kg(t,e){return t-t%Math.pow(10,e)}function $g(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function C1(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function Lg(t){return /^-?(0+)\d/.test(t)}function R1(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}er.cache={};er.clearCache=()=>er.cache={};Dg.exports=er;});var Xa=T((iL,Vg)=>{var T1=G("util"),Hg=qg(),Bg=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),I1=t=>e=>t===!0?Number(e):String(e),Ya=t=>typeof t=="number"||typeof t=="string"&&t!=="",vn=t=>Number.isInteger(+t),Ja=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},P1=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,O1=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},Ug=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((o,a)=>oa?1:0),t.positives.sort((o,a)=>oa?1:0);let r=e.capture?"":"?:",n="",s="",i;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(s=`-(${r}${t.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,e.wrap?`(${r}${i})`:i},jg=(t,e,r,n)=>{if(r)return Hg(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},Wg=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return Hg(t,e,r)},zg=(...t)=>new RangeError("Invalid range arguments: "+T1.inspect(...t)),Gg=(t,e,r)=>{if(r.strictRanges===!0)throw zg([t,e]);return []},F1=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},N1=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw zg([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(t),c=String(e),d=String(r);r=Math.max(Math.abs(r),1);let u=Ja(a)||Ja(c)||Ja(d),p=u?Math.max(a.length,c.length,d.length):0,_=u===!1&&P1(t,e,n)===!1,m=n.transform||I1(_);if(n.toRegex&&r===1)return jg(Ug(t,p),Ug(e,p),!0,n);let y={negatives:[],positives:[]},v=w=>y[w<0?"negatives":"positives"].push(Math.abs(w)),E=[],A=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?v(s):E.push(O1(m(s,A),p,_)),s=o?s-r:s+r,A++;return n.toRegex===!0?r>1?M1(y,n):Wg(E,null,{wrap:!1,...n}):E},k1=(t,e,r=1,n={})=>{if(!vn(t)&&t.length>1||!vn(e)&&e.length>1)return Gg(t,e,n);let s=n.transform||(_=>String.fromCharCode(_)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,c=Math.min(i,o),d=Math.max(i,o);if(n.toRegex&&r===1)return jg(c,d,!1,n);let u=[],p=0;for(;a?i>=o:i<=o;)u.push(s(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?Wg(u,null,{wrap:!1,options:n}):u},Qi=(t,e,r,n={})=>{if(e==null&&Ya(t))return [t];if(!Ya(t)||!Ya(e))return Gg(t,e,n);if(typeof r=="function")return Qi(t,e,1,{transform:r});if(Bg(r))return Qi(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,vn(r)?vn(t)&&vn(e)?N1(t,e,r,s):k1(t,e,Math.max(Math.abs(r),1),s):r!=null&&!Bg(r)?F1(r,s):Qi(t,e,1,r)};Vg.exports=Qi;});var Yg=T((sL,Zg)=>{var $1=Xa(),Kg=Ji(),L1=(t,e={})=>{let r=(n,s={})=>{let i=Kg.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",d="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=Kg.reduce(n.nodes),p=$1(...u,{...e,wrap:!1,toRegex:!0});if(p.length!==0)return u.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let u of n.nodes)d+=r(u,n);return d};return r(t)};Zg.exports=L1;});var Qg=T((oL,Xg)=>{var D1=Xa(),Jg=Xi(),Pr=Ji(),tr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Pr.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(tr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?tr(s,i,r):s+i);return Pr.flatten(n)},q1=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(tr(a.pop(),Jg(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(tr(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let p=Pr.reduce(s.nodes);if(Pr.exceedsLimit(...p,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let _=D1(...p,e);_.length===0&&(_=Jg(s,e)),a.push(tr(a.pop(),_)),s.nodes=[];return}let c=Pr.encloseBrace(s),d=s.queue,u=s;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,d=u.queue;for(let p=0;p{ey.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` +`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var oy=T((lL,sy)=>{var B1=Xi(),{MAX_LENGTH:ry,CHAR_BACKSLASH:Qa,CHAR_BACKTICK:U1,CHAR_COMMA:H1,CHAR_DOT:j1,CHAR_LEFT_PARENTHESES:W1,CHAR_RIGHT_PARENTHESES:z1,CHAR_LEFT_CURLY_BRACE:G1,CHAR_RIGHT_CURLY_BRACE:V1,CHAR_LEFT_SQUARE_BRACKET:ny,CHAR_RIGHT_SQUARE_BRACKET:iy,CHAR_DOUBLE_QUOTE:K1,CHAR_SINGLE_QUOTE:Z1,CHAR_NO_BREAK_SPACE:Y1,CHAR_ZERO_WIDTH_NOBREAK_SPACE:J1}=ty(),X1=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(ry,r.maxLength):ry;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,a=s,c=0,d=t.length,u=0,p=0,_,y=()=>t[u++],v=E=>{if(E.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&E.type==="text"){a.value+=E.value;return}return o.nodes.push(E),E.parent=o,E.prev=a,a=E,E};for(v({type:"bos"});u0){if(o.ranges>0){o.ranges=0;let E=o.nodes.shift();o.nodes=[E,{type:"text",value:B1(o)}];}v({type:"comma",value:_}),o.commas++;continue}if(_===j1&&p>0&&o.commas===0){let E=o.nodes;if(p===0||E.length===0){v({type:"text",value:_});continue}if(a.type==="dot"){if(o.range=[],a.value+=_,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){E.pop();let A=E[E.length-1];A.value+=a.value+_,a=A,o.ranges--;continue}v({type:"dot",value:_});continue}v({type:"text",value:_});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0);});let E=i[i.length-1],A=E.nodes.indexOf(o);E.nodes.splice(A,1,...o.nodes);}while(i.length>0);return v({type:"eos"}),s};sy.exports=X1;});var uy=T((uL,ly)=>{var ay=Xi(),Q1=Yg(),eI=Qg(),tI=oy(),Ze=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=Ze.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(Ze.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ze.parse=(t,e={})=>tI(t,e);Ze.stringify=(t,e={})=>ay(typeof t=="string"?Ze.parse(t,e):t,e);Ze.compile=(t,e={})=>(typeof t=="string"&&(t=Ze.parse(t,e)),Q1(t,e));Ze.expand=(t,e={})=>{typeof t=="string"&&(t=Ze.parse(t,e));let r=eI(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ze.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ze.compile(t,e):Ze.expand(t,e);ly.exports=Ze;});var cy=T((cL,rI)=>{rI.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var hy=T((fL,fy)=>{fy.exports=cy();});var py=T((hL,dy)=>{var nI=G("path"),iI=hy(),sI=new Set(iI);dy.exports=t=>sI.has(nI.extname(t).slice(1).toLowerCase());});var es=T(ee=>{var{sep:oI}=G("path"),{platform:el}=process,aI=G("os");ee.EV_ALL="all";ee.EV_READY="ready";ee.EV_ADD="add";ee.EV_CHANGE="change";ee.EV_ADD_DIR="addDir";ee.EV_UNLINK="unlink";ee.EV_UNLINK_DIR="unlinkDir";ee.EV_RAW="raw";ee.EV_ERROR="error";ee.STR_DATA="data";ee.STR_END="end";ee.STR_CLOSE="close";ee.FSEVENT_CREATED="created";ee.FSEVENT_MODIFIED="modified";ee.FSEVENT_DELETED="deleted";ee.FSEVENT_MOVED="moved";ee.FSEVENT_CLONED="cloned";ee.FSEVENT_UNKNOWN="unknown";ee.FSEVENT_TYPE_FILE="file";ee.FSEVENT_TYPE_DIRECTORY="directory";ee.FSEVENT_TYPE_SYMLINK="symlink";ee.KEY_LISTENERS="listeners";ee.KEY_ERR="errHandlers";ee.KEY_RAW="rawEmitters";ee.HANDLER_KEYS=[ee.KEY_LISTENERS,ee.KEY_ERR,ee.KEY_RAW];ee.DOT_SLASH=`.${oI}`;ee.BACK_SLASH_RE=/\\/g;ee.DOUBLE_SLASH_RE=/\/\//;ee.SLASH_OR_BACK_SLASH_RE=/[/\\]/;ee.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;ee.REPLACER_RE=/^\.[/\\]/;ee.SLASH="/";ee.SLASH_SLASH="//";ee.BRACE_START="{";ee.BANG="!";ee.ONE_DOT=".";ee.TWO_DOTS="..";ee.STAR="*";ee.GLOBSTAR="**";ee.ROOT_GLOBSTAR="/**/*";ee.SLASH_GLOBSTAR="/**";ee.DIR_SUFFIX="Dir";ee.ANYMATCH_OPTS={dot:!0};ee.STRING_TYPE="string";ee.FUNCTION_TYPE="function";ee.EMPTY_STR="";ee.EMPTY_FN=()=>{};ee.IDENTITY_FN=t=>t;ee.isWindows=el==="win32";ee.isMacos=el==="darwin";ee.isLinux=el==="linux";ee.isIBMi=aI.type()==="OS400";});var by=T((pL,wy)=>{var vt=G("fs"),Ae=G("path"),{promisify:xn}=G("util"),lI=py(),{isWindows:uI,isLinux:cI,EMPTY_FN:fI,EMPTY_STR:hI,KEY_LISTENERS:Or,KEY_ERR:tl,KEY_RAW:Sn,HANDLER_KEYS:dI,EV_CHANGE:rs,EV_ADD:ts,EV_ADD_DIR:pI,EV_ERROR:_y,STR_DATA:mI,STR_END:_I,BRACE_START:gI,STAR:yI}=es(),wI="watch",bI=xn(vt.open),gy=xn(vt.stat),vI=xn(vt.lstat),SI=xn(vt.close),rl=xn(vt.realpath),EI={lstat:vI,stat:gy},il=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},En=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},AI=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},An=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},yy=t=>t instanceof Set?t.size===0:!t,ns=new Map;function my(t,e,r,n,s){let i=(o,a)=>{r(t),s(o,a,{watchedPath:t}),a&&t!==a&&is(Ae.resolve(t,a),Or,Ae.join(t,a));};try{return vt.watch(t,e,i)}catch(o){n(o);}}var is=(t,e,r,n,s)=>{let i=ns.get(t);i&&il(i[e],o=>{o(r,n,s);});},xI=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,a=ns.get(e),c;if(!r.persistent)return c=my(t,r,s,i,o),c.close.bind(c);if(a)En(a,Or,s),En(a,tl,i),En(a,Sn,o);else {if(c=my(t,r,is.bind(null,e,Or),i,is.bind(null,e,Sn)),!c)return;c.on(_y,async d=>{let u=is.bind(null,e,tl);if(a.watcherUnusable=!0,uI&&d.code==="EPERM")try{let p=await bI(t,"r");await SI(p),u(d);}catch{}else u(d);}),a={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},ns.set(e,a);}return ()=>{An(a,Or,s),An(a,tl,i),An(a,Sn,o),yy(a.listeners)&&(a.watcher.close(),ns.delete(e),dI.forEach(AI(a)),a.watcher=void 0,Object.freeze(a));}},nl=new Map,CI=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=nl.get(e),d=o&&o.options;return d&&(d.persistentr.interval)&&(vt.unwatchFile(e),o=void 0),o?(En(o,Or,s),En(o,Sn,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:vt.watchFile(e,r,(u,p)=>{il(o.rawEmitters,m=>{m(rs,e,{curr:u,prev:p});});let _=u.mtimeMs;(u.size!==p.size||_>p.mtimeMs||_===0)&&il(o.listeners,m=>m(t,u));})},nl.set(e,o)),()=>{An(o,Or,s),An(o,Sn,i),yy(o.listeners)&&(nl.delete(e),vt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},sl=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Ae.dirname(e),i=Ae.basename(e);this.fsw._getWatchedDir(s).add(i);let a=Ae.resolve(e),c={persistent:n.persistent};r||(r=fI);let d;return n.usePolling?(c.interval=n.enableBinaryInterval&&lI(i)?n.binaryInterval:n.interval,d=CI(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})):d=xI(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),d}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Ae.dirname(e),i=Ae.basename(e),o=this.fsw._getWatchedDir(s),a=r;if(o.has(i))return;let c=async(u,p)=>{if(this.fsw._throttle(wI,e,5)){if(!p||p.mtimeMs===0)try{let _=await gy(e);if(this.fsw.closed)return;let m=_.atimeMs,y=_.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(rs,e,_),cI&&a.ino!==_.ino?(this.fsw._closeFile(u),a=_,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=_;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let _=p.atimeMs,m=p.mtimeMs;(!_||_<=m||m!==a.mtimeMs)&&this.fsw._emit(rs,e,p),a=p;}}},d=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ts,e,0))return;this.fsw._emit(ts,e,r);}return d}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await rl(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==a&&(this.fsw._symlinkPaths.set(i,a),this.fsw._emit(rs,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,a),this.fsw._emit(ts,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return !0;this.fsw._symlinkPaths.set(i,!0);}_handleRead(e,r,n,s,i,o,a){if(e=Ae.join(e,hI),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),d=new Set,u=this.fsw._readdirp(e,{fileFilter:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p),depth:0}).on(mI,async p=>{if(this.fsw.closed){u=void 0;return}let _=p.path,m=Ae.join(e,_);if(d.add(_),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,m,_))){if(this.fsw.closed){u=void 0;return}(_===s||!s&&!c.has(_))&&(this.fsw._incrReadyCount(),m=Ae.join(i,Ae.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(_y,this._boundHandleError);return new Promise(p=>u.once(_I,()=>{if(this.fsw.closed){u=void 0;return}let _=a?a.clear():!1;p(),c.getChildren().filter(m=>m!==e&&!d.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Ae.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),u=void 0,_&&this._handleRead(e,!1,n,s,i,o,a);}))}async _handleDir(e,r,n,s,i,o,a){let c=this.fsw._getWatchedDir(Ae.dirname(e)),d=c.has(Ae.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!d&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(pI,e,r),c.add(Ae.basename(e)),this.fsw._getWatchedDir(e);let u,p,_=this.fsw.options.depth;if((_==null||s<=_)&&!this.fsw._symlinkPaths.has(a)){if(!i&&(await this._handleRead(e,n,o,i,e,s,u),this.fsw.closed))return;p=this._watchWithNodeFs(e,(m,y)=>{y&&y.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,u);});}return p}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,s);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await EI[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let d=this.fsw.options.followSymlinks&&!e.includes(yI)&&!e.includes(gI),u;if(c.isDirectory()){let p=Ae.resolve(e),_=d?await rl(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,r,s,i,a,_),this.fsw.closed))return;p!==_&&_!==void 0&&this.fsw._symlinkPaths.set(p,_);}else if(c.isSymbolicLink()){let p=d?await rl(e):e;if(this.fsw.closed)return;let _=Ae.dirname(a.watchPath);if(this.fsw._getWatchedDir(_).add(a.watchPath),this.fsw._emit(ts,a.watchPath,c),u=await this._handleDir(_,c,r,s,e,a,p),this.fsw.closed)return;p!==void 0&&this.fsw._symlinkPaths.set(Ae.resolve(e),p);}else u=this._handleFile(a.watchPath,c,r);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};wy.exports=sl;});var Ry=T((mL,dl)=>{var fl=G("fs"),xe=G("path"),{promisify:hl}=G("util"),Mr;try{Mr=G("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Mr){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Mr=void 0);}}var{EV_ADD:ol,EV_CHANGE:RI,EV_ADD_DIR:vy,EV_UNLINK:ss,EV_ERROR:TI,STR_DATA:II,STR_END:PI,FSEVENT_CREATED:OI,FSEVENT_MODIFIED:MI,FSEVENT_DELETED:FI,FSEVENT_MOVED:NI,FSEVENT_UNKNOWN:kI,FSEVENT_TYPE_FILE:$I,FSEVENT_TYPE_DIRECTORY:Cn,FSEVENT_TYPE_SYMLINK:Cy,ROOT_GLOBSTAR:Sy,DIR_SUFFIX:LI,DOT_SLASH:Ey,FUNCTION_TYPE:al,EMPTY_FN:DI,IDENTITY_FN:qI}=es(),BI=t=>isNaN(t)?{}:{depth:t},ul=hl(fl.stat),UI=hl(fl.lstat),Ay=hl(fl.realpath),HI={stat:ul,lstat:UI},rr=new Map,jI=10,WI=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),zI=(t,e)=>({stop:Mr.watch(t,e)});function GI(t,e,r,n){let s=xe.extname(e)?xe.dirname(e):e,i=xe.dirname(s),o=rr.get(s);VI(i)&&(s=i);let a=xe.resolve(t),c=a!==e,d=(p,_,m)=>{c&&(p=p.replace(e,a)),(p===a||!p.indexOf(a+xe.sep))&&r(p,_,m);},u=!1;for(let p of rr.keys())if(e.indexOf(xe.resolve(p)+xe.sep)===0){s=p,o=rr.get(s),u=!0;break}return o||u?o.listeners.add(d):(o={listeners:new Set([d]),rawEmitter:n,watcher:zI(s,(p,_)=>{if(!o.listeners.size)return;let m=Mr.getInfo(p,_);o.listeners.forEach(y=>{y(p,_,m);}),o.rawEmitter(m.event,p,m);})},rr.set(s,o)),()=>{let p=o.listeners;if(p.delete(d),!p.size&&(rr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var VI=t=>{let e=0;for(let r of rr.keys())if(r.indexOf(t)===0&&(e++,e>=jI))return !0;return !1},KI=()=>Mr&&rr.size<128,ll=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=xe.dirname(t))!==e;)r++;return r},xy=(t,e)=>t.type===Cn&&e.isDirectory()||t.type===Cy&&e.isSymbolicLink()||t.type===$I&&e.isFile(),cl=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+Sy),!0;n.delete(e),n.delete(e+Sy);}addOrChange(e,r,n,s,i,o,a,c){let d=i.has(o)?RI:ol;this.handleEvent(d,e,r,n,s,i,o,a,c);}async checkExists(e,r,n,s,i,o,a,c){try{let d=await ul(e);if(this.fsw.closed)return;xy(a,d)?this.addOrChange(e,r,n,s,i,o,a,c):this.handleEvent(ss,e,r,n,s,i,o,a,c);}catch(d){d.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,a,c):this.handleEvent(ss,e,r,n,s,i,o,a,c);}}handleEvent(e,r,n,s,i,o,a,c,d){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===ss){let u=c.type===Cn;(u||o.has(a))&&this.fsw._remove(i,a,u);}else {if(e===ol){if(c.type===Cn&&this.fsw._getWatchedDir(r),c.type===Cy&&d.followSymlinks){let p=d.depth===void 0?void 0:ll(n,s)+1;return this._addToFsEvents(r,!1,!0,p)}this.fsw._getWatchedDir(i).add(a);}let u=c.type===Cn?e+LI:e;this.fsw._emit(u,r),u===vy&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,a=GI(e,r,async(c,d,u)=>{if(this.fsw.closed||i.depth!==void 0&&ll(c,r)>i.depth)return;let p=n(xe.join(e,xe.relative(e,c)));if(s&&!s(p))return;let _=xe.dirname(p),m=xe.basename(p),y=this.fsw._getWatchedDir(u.type===Cn?p:_);if(WI.has(d)||u.event===kI)if(typeof i.ignored===al){let v;try{v=await ul(p);}catch{}if(this.fsw.closed||this.checkIgnored(p,v))return;xy(u,v)?this.addOrChange(p,c,r,_,y,m,u,i):this.handleEvent(ss,p,c,r,_,y,m,u,i);}else this.checkExists(p,c,r,_,y,m,u,i);else switch(u.event){case OI:case MI:return this.addOrChange(p,c,r,_,y,m,u,i);case FI:case NI:return this.checkExists(p,c,r,_,y,m,u,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,r,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let i=await Ay(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let a=e;return i&&i!==Ey?a=o.replace(i,e):o!==Ey&&(a=xe.join(e,o)),n(a)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),a=r.isDirectory(),c=this.fsw._getWatchedDir(xe.dirname(o)),d=xe.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(d)&&(c.add(d),(!s.ignoreInitial||i===!0)&&this.fsw._emit(a?vy:ol,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,xe.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(r,i);}async _addToFsEvents(e,r,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof r===al?r:qI,a=this.fsw._getWatchHelpers(e);try{let c=await HI[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:d=>a.filterPath(d),directoryFilter:d=>a.filterDir(d),...BI(i.depth-(s||0))}).on(II,d=>{if(this.fsw.closed||d.stats.isDirectory()&&!a.filterPath(d))return;let u=xe.join(a.watchPath,d.path),{fullPath:p}=d;if(a.followSymlinks&&d.stats.isSymbolicLink()){let _=i.depth===void 0?void 0:ll(u,xe.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,p,o,_);}else this.emitAdd(u,d.stats,o,i,n);}).on(TI,DI).on(PI,()=>{this.fsw._emitReady();});}else this.emitAdd(a.watchPath,c,o,i,n),this.fsw._emitReady();}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(i.persistent&&n!==!0)if(typeof r===al)this.initWatch(void 0,e,a,o);else {let c;try{c=await Ay(a.watchPath);}catch{}this.initWatch(c,e,a,o);}}};dl.exports=cl;dl.exports.canUse=KI;});var Il=T(Tl=>{var{EventEmitter:ZI}=G("events"),Cl=G("fs"),fe=G("path"),{promisify:Ny}=G("util"),YI=dg(),wl=bg().default,JI=Cg(),pl=Va(),XI=uy(),QI=za(),eP=by(),Ty=Ry(),{EV_ALL:ml,EV_READY:tP,EV_ADD:os,EV_CHANGE:Rn,EV_UNLINK:Iy,EV_ADD_DIR:rP,EV_UNLINK_DIR:nP,EV_RAW:iP,EV_ERROR:_l,STR_CLOSE:sP,STR_END:oP,BACK_SLASH_RE:aP,DOUBLE_SLASH_RE:Py,SLASH_OR_BACK_SLASH_RE:lP,DOT_RE:uP,REPLACER_RE:cP,SLASH:gl,SLASH_SLASH:fP,BRACE_START:hP,BANG:bl,ONE_DOT:ky,TWO_DOTS:dP,GLOBSTAR:pP,SLASH_GLOBSTAR:yl,ANYMATCH_OPTS:vl,STRING_TYPE:Rl,FUNCTION_TYPE:mP,EMPTY_STR:Sl,EMPTY_FN:_P,isWindows:gP,isMacos:yP,isIBMi:wP}=es(),bP=Ny(Cl.stat),vP=Ny(Cl.readdir),El=(t=[])=>Array.isArray(t)?t:[t],$y=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?$y(r,e):e.push(r);}),e),Oy=t=>{let e=$y(El(t));if(!e.every(r=>typeof r===Rl))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Ly)},My=t=>{let e=t.replace(aP,gl),r=!1;for(e.startsWith(fP)&&(r=!0);e.match(Py);)e=e.replace(Py,gl);return r&&(e=gl+e),e},Ly=t=>My(fe.normalize(My(t))),Fy=(t=Sl)=>e=>typeof e!==Rl?e:Ly(fe.isAbsolute(e)?e:fe.join(t,e)),SP=(t,e)=>fe.isAbsolute(t)?t:t.startsWith(bl)?bl+fe.join(e,t.slice(1)):fe.join(e,t),at=(t,e)=>t[e]===void 0,Al=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==ky&&e!==dP&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await vP(n);}catch{this._removeWatcher&&this._removeWatcher(fe.dirname(n),fe.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},EP="stat",AP="lstat",xl=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(cP,Sl),this.watchPath=r,this.fullWatchPath=fe.resolve(r),this.hasGlob=r!==e,e===Sl&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?wl(e,void 0,vl):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?EP:AP;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return fe.join(this.watchPath,fe.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===mP?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(hP)?XI.expand(e):[e]).forEach(s=>{r.push(fe.relative(this.watchPath,s).split(lP));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===pP&&(n=!0),n||!r[0][o]||wl(i,r[0][o],vl))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},as=class extends ZI{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,at(r,"persistent")&&(r.persistent=!0),at(r,"ignoreInitial")&&(r.ignoreInitial=!1),at(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),at(r,"interval")&&(r.interval=100),at(r,"binaryInterval")&&(r.binaryInterval=300),at(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,at(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Ty.canUse()||(r.useFsEvents=!1),at(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=yP),wP&&(r.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c;}let i=process.env.CHOKIDAR_INTERVAL;i&&(r.interval=Number.parseInt(i,10)),at(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),at(r,"followSymlinks")&&(r.followSymlinks=!0),at(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=El(r.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=_P,this._readyEmitted=!0,process.nextTick(()=>this.emit(tP)));},this._emitRaw=(...c)=>this.emit(iP,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Ty(this):this._nodeFsHandler=new eP(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=Oy(e);return s&&(o=o.map(a=>{let c=SP(a,s);return i||!pl(a)?c:QI(c)})),o=o.filter(a=>a.startsWith(bl)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+yl),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,r);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(fe.dirname(c),fe.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=Oy(e),{cwd:n}=this.options;return r.forEach(s=>{!fe.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=fe.join(n,s)),s=fe.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+yl),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let s=n();s instanceof Promise&&e.push(s);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=this.options.cwd?fe.relative(this.options.cwd,n):n;e[s||ky]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==_l&&this.emit(ml,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;gP&&(r=fe.normalize(r)),o.cwd&&(r=fe.relative(o.cwd,r));let a=[e,r];i!==void 0?a.push(n,s,i):s!==void 0?a.push(n,s):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,d;if(c&&(d=this._pendingWrites.get(r)))return d.lastChange=new Date,this;if(o.atomic){if(e===Iy)return this._pendingUnlinks.set(r,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,p)=>{this.emit(...u),this.emit(ml,...u),this._pendingUnlinks.delete(p);});},typeof o.atomic=="number"?o.atomic:100),this;e===os&&this._pendingUnlinks.has(r)&&(e=a[0]=Rn,this._pendingUnlinks.delete(r));}if(c&&(e===os||e===Rn)&&this._readyEmitted){let u=(p,_)=>{p?(e=a[0]=_l,a[1]=p,this.emitWithAll(e,a)):_&&(a.length>2?a[2]=_:a.push(_),this.emitWithAll(e,a));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,u),this}if(e===Rn&&!this._throttle(Rn,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===os||e===rP||e===Rn)){let u=o.cwd?fe.join(o.cwd,r):r,p;try{p=await bP(u);}catch{}if(!p||this.closed)return;a.push(p);}return this.emitWithAll(e,a),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(_l,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(r);if(i)return i.count++,!1;let o,a=()=>{let d=s.get(r),u=d?d.count:0;return s.delete(r),clearTimeout(o),d&&clearTimeout(d.timeoutObject),u};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!fe.isAbsolute(e)&&(o=fe.join(this.options.cwd,e));let a=new Date,c=d=>{Cl.stat(o,(u,p)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&s(u);return}let _=Number(new Date);d&&p.size!==d.size&&(this._pendingWrites.get(e).lastChange=_);let m=this._pendingWrites.get(e);_-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,p)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,p);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(c,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&uP.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(Fy(n)),o=El(i).filter(c=>typeof c===Rl&&!pl(c)).map(c=>c+yl),a=this._getGlobIgnored().map(Fy(n)).concat(i,o);this._userIgnored=wl(a,void 0,vl);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!pl(e)?e:JI(e),s=this.options.followSymlinks;return new xl(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=fe.resolve(e);return this._watched.has(r)||this._watched.set(r,new Al(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let s=fe.join(e,r),i=fe.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(s).getChildren().forEach(_=>this._remove(s,_));let c=this._getWatchedDir(e),d=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=s;if(this.options.cwd&&(u=fe.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===os)return;this._watched.delete(s),this._watched.delete(i);let p=n?nP:Iy;d&&!this._isIgnored(s)&&this._emit(p,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=fe.dirname(e);this._getWatchedDir(r).remove(fe.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:ml,alwaysStat:!0,lstat:!0,...r},s=YI(e,n);return this._streams.add(s),s.once(sP,()=>{s=void 0;}),s.once(oP,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};Tl.FSWatcher=as;var xP=(t,e)=>{let r=new as(e);return r.add(t),r};Tl.watch=xP;});var Ol=T((wL,By)=>{var Tn=t=>t&&typeof t.message=="string",Pl=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return Tn(r)?r:void 0}else return Tn(e)?e:void 0},Dy=(t,e)=>{if(!Tn(t))return "";let r=t.stack||"";if(e.has(t))return r+` +causes have become circular...`;let n=Pl(t);return n?(e.add(t),r+` +caused by: `+Dy(n,e)):r},CP=t=>Dy(t,new Set),qy=(t,e,r)=>{if(!Tn(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Pl(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+qy(s,e,i)}else return n},RP=t=>qy(t,new Set);By.exports={isErrorLike:Tn,getErrorCause:Pl,stackWithCauses:CP,messageWithCauses:RP};});var Ml=T((bL,Hy)=>{var TP=Symbol("circular-ref-tag"),ls=Symbol("pino-raw-err-ref"),Uy=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[ls]},set:function(t){this[ls]=t;}}});Object.defineProperty(Uy,ls,{writable:!0,value:{}});Hy.exports={pinoErrProto:Uy,pinoErrorSymbols:{seen:TP,rawSymbol:ls}};});var zy=T((vL,Wy)=>{Wy.exports=Nl;var{messageWithCauses:IP,stackWithCauses:PP,isErrorLike:jy}=Ol(),{pinoErrProto:OP,pinoErrorSymbols:MP}=Ml(),{seen:Fl}=MP,{toString:FP}=Object.prototype;function Nl(t){if(!jy(t))return t;t[Fl]=void 0;let e=Object.create(OP);e.type=FP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=IP(t),e.stack=PP(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Nl(r)));for(let r in t)if(e[r]===void 0){let n=t[r];jy(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Fl)&&(e[r]=Nl(n)):e[r]=n;}return delete t[Fl],e.raw=t,e}});var Vy=T((SL,Gy)=>{Gy.exports=cs;var{isErrorLike:kl}=Ol(),{pinoErrProto:NP,pinoErrorSymbols:kP}=Ml(),{seen:us}=kP,{toString:$P}=Object.prototype;function cs(t){if(!kl(t))return t;t[us]=void 0;let e=Object.create(NP);e.type=$P.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>cs(r))),kl(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,us)&&(e.cause=cs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];kl(n)?Object.prototype.hasOwnProperty.call(n,us)||(e[r]=cs(n)):e[r]=n;}return delete t[us],e.raw=t,e}});var Jy=T((EL,Yy)=>{Yy.exports={mapHttpRequest:LP,reqSerializer:Zy};var $l=Symbol("pino-raw-req-ref"),Ky=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$l]},set:function(t){this[$l]=t;}}});Object.defineProperty(Ky,$l,{writable:!0,value:{}});function Zy(t){let e=t.info||t.socket,r=Object.create(Ky);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function LP(t){return {req:Zy(t)}}});var tw=T((AL,ew)=>{ew.exports={mapHttpResponse:DP,resSerializer:Qy};var Ll=Symbol("pino-raw-res-ref"),Xy=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Ll]},set:function(t){this[Ll]=t;}}});Object.defineProperty(Xy,Ll,{writable:!0,value:{}});function Qy(t){let e=Object.create(Xy);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function DP(t){return {res:Qy(t)}}});var ql=T((xL,rw)=>{var Dl=zy(),qP=Vy(),hs=Jy(),ds=tw();rw.exports={err:Dl,errWithCause:qP,mapHttpRequest:hs.mapHttpRequest,mapHttpResponse:ds.mapHttpResponse,req:hs.reqSerializer,res:ds.resSerializer,wrapErrorSerializer:function(e){return e===Dl?e:function(n){return e(Dl(n))}},wrapRequestSerializer:function(e){return e===hs.reqSerializer?e:function(n){return e(hs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===ds.resSerializer?e:function(n){return e(ds.resSerializer(n))}}};});var Bl=T((CL,nw)=>{function BP(t,e){return e}nw.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=BP;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s};});var sw=T((RL,iw)=>{iw.exports=UP;function UP(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:s}){s.forEach(i=>{if(typeof i!="string")throw Error(e());try{if(/〇/.test(i))throw Error();let o=(i[0]==="["?"":".")+i.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(` 'use strict' const o = new Proxy({}, { get: () => o, set: () => { throw Error() } }); const \u3007 = null; o${o} - if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(i))}});}}});var Bs=R((NN,iv)=>{iv.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var ov=R((MN,sv)=>{var EP=Bs();sv.exports=AP;function AP({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var l=i.match(EP).map(u=>u.replace(/'|"|`/g,""));let c=i[0]==="[";l=l.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let p=l.indexOf("*");if(p>-1){let u=l.slice(0,p),g=u.join("."),y=l.slice(p+1,l.length),m=y.length>0;r++,e.push({before:u,beforeStr:g,after:y,nested:m});}else s[i]={path:l,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var lv=R((jN,av)=>{var _P=Bs();av.exports=xP;function xP({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let l=Function("o",` + if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(i))}});}}});var ps=T((TL,ow)=>{ow.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var lw=T((IL,aw)=>{var HP=ps();aw.exports=jP;function jP({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var a=i.match(HP).map(u=>u.replace(/'|"|`/g,""));let c=i[0]==="[";a=a.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let d=a.indexOf("*");if(d>-1){let u=a.slice(0,d),p=u.join("."),_=a.slice(d+1,a.length),m=_.length>0;r++,e.push({before:u,beforeStr:p,after:_,nested:m});}else s[i]={path:a,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var cw=T((PL,uw)=>{var WP=ps();uw.exports=zP;function zP({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let a=Function("o",` if (typeof o !== 'object' || o == null) { - ${PP(n,e)} + ${ZP(n,e)} } const { censor, secret } = this - ${CP(t,s,i)} + ${GP(t,s,i)} this.compileRestore() - ${RP(r>0,s,i)} - ${OP(e)} - `).bind(o);return e===!1&&(l.restore=c=>o.restore(c)),l}function CP(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],l=i?1:0,c=i?"":".",p=[];for(var u;(u=_P.exec(n))!==null;){let[,v]=u,{index:b,input:_}=u;b>l&&p.push(_.substring(0,b-(v?0:1)));}var g=p.map(v=>`o${c}${v}`).join(" && ");g.length===0?g+=`o${c}${n} != null`:g+=` && o${c}${n} != null`;let y=` + ${VP(r>0,s,i)} + ${KP(e)} + `).bind(o);return e===!1&&(a.restore=c=>o.restore(c)),a}function GP(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],a=i?1:0,c=i?"":".",d=[];for(var u;(u=WP.exec(n))!==null;){let[,y]=u,{index:v,input:E}=u;v>a&&d.push(E.substring(0,v-(y?0:1)));}var p=d.map(y=>`o${c}${y}`).join(" && ");p.length===0?p+=`o${c}${n} != null`:p+=` && o${c}${n} != null`;let _=` switch (true) { - ${p.reverse().map(v=>` - case o${c}${v} === censor: - secret[${s}].circle = ${JSON.stringify(v)} + ${d.reverse().map(y=>` + case o${c}${y} === censor: + secret[${s}].circle = ${JSON.stringify(y)} break `).join(` `)} } `,m=r?`val, ${JSON.stringify(o)}`:"val";return ` - if (${g}) { + if (${p}) { const val = o${c}${n} if (val === censor) { secret[${s}].precensored = true } else { secret[${s}].val = val o${c}${n} = ${e?`censor(${m})`:"censor"} - ${y} + ${_} } } `}).join(` -`)}function RP(t,e,r){return t===!0?` +`)}function VP(t,e,r){return t===!0?` { const { wildcards, wcLen, groupRedact, nestedRedact } = this for (var i = 0; i < wcLen; i++) { @@ -72,16 +73,16 @@ caused by: `+qm(n,e)):r},oP=t=>qm(t,new Set),Dm=(t,e,r)=>{if(!si(t))return "";le } else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r}) } } - `:""}function OP(t){return t===!1?"return o":` + `:""}function KP(t){return t===!1?"return o":` var s = this.serialize(o) this.restore(o) return s - `}function PP(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var ql=R((BN,fv)=>{fv.exports={groupRedact:$P,groupRestore:TP,nestedRedact:kP,nestedRestore:IP};function TP({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var s=0;s0;o--)i=i[n[o]];i[n[0]]=s;}}function kP(t,e,r,n,s,i,o){let l=uv(e,r);if(l==null)return;let c=Object.keys(l),p=c.length;for(var u=0;u{var{groupRestore:qP,nestedRestore:DP}=ql();hv.exports=NP;function NP({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=MP(t,n),i=e>0,o=i?{secret:t,groupRestore:qP,nestedRestore:DP}:{secret:t};this.restore=Function("o",jP(s,n,i)).bind(o);}}function MP(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],l=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return ` + `}function ZP(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Hl=T((OL,dw)=>{dw.exports={groupRedact:JP,groupRestore:YP,nestedRedact:QP,nestedRestore:XP};function YP({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var s=0;s0;o--)i=i[n[o]];i[n[0]]=s;}}function QP(t,e,r,n,s,i,o){let a=fw(e,r);if(a==null)return;let c=Object.keys(a),d=c.length;for(var u=0;u{var{groupRestore:rO,nestedRestore:nO}=Hl();pw.exports=iO;function iO({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=sO(t,n),i=e>0,o=i?{secret:t,groupRestore:rO,nestedRestore:nO}:{secret:t};this.restore=Function("o",oO(s,n,i)).bind(o);}}function sO(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],a=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return ` if (secret[${s}].val !== undefined) { - try { ${l} } catch (e) {} + try { ${a} } catch (e) {} ${c} } - `}).join("")}function jP(t,e,r){return ` + `}).join("")}function oO(t,e,r){return ` const secret = this.secret ${r===!0?` const keys = Object.keys(secret) @@ -96,108 +97,87 @@ caused by: `+qm(n,e)):r},oP=t=>qm(t,new Set),Dm=(t,e,r)=>{if(!si(t))return "";le `:""} ${t} return o - `}});var gv=R((UN,dv)=>{dv.exports=BP;function BP(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:l,wcLen:c}=t,p=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&p.push({serialize:s}),c>0&&p.push({groupRedact:i,nestedRedact:o,wildcards:l,wcLen:c}),Object.assign(...p)}});var vv=R((WN,mv)=>{var yv=nv(),HP=ov(),UP=lv(),WP=pv(),{groupRedact:zP,nestedRedact:GP}=ql(),KP=gv(),VP=Bs(),YP=yv(),Dl=t=>t;Dl.restore=Dl;var JP="[REDACTED]";Nl.rx=VP;Nl.validator=yv;mv.exports=Nl;function Nl(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let s=n===!0?void 0:"censor"in t?t.censor:JP,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Dl;YP({paths:e,serialize:r,censor:s});let{wildcards:l,wcLen:c,secret:p}=HP({paths:e,censor:s}),u=WP({secret:p,wcLen:c}),g="strict"in t?t.strict:!0;return UP({secret:p,wcLen:c,serialize:r,strict:g,isCensorFct:i,censorFctTakesPath:o},KP({secret:p,censor:s,compileRestore:u,serialize:r,groupRedact:zP,nestedRedact:GP,wildcards:l,wcLen:c}))}});var hn=R((zN,wv)=>{var XP=Symbol("pino.setLevel"),QP=Symbol("pino.getLevel"),ZP=Symbol("pino.levelVal"),e1=Symbol("pino.useLevelLabels"),t1=Symbol("pino.useOnlyCustomLevels"),r1=Symbol("pino.mixin"),n1=Symbol("pino.lsCache"),i1=Symbol("pino.chindings"),s1=Symbol("pino.asJson"),o1=Symbol("pino.write"),a1=Symbol("pino.redactFmt"),l1=Symbol("pino.time"),u1=Symbol("pino.timeSliceIndex"),c1=Symbol("pino.stream"),f1=Symbol("pino.stringify"),h1=Symbol("pino.stringifySafe"),p1=Symbol("pino.stringifiers"),d1=Symbol("pino.end"),g1=Symbol("pino.formatOpts"),y1=Symbol("pino.messageKey"),m1=Symbol("pino.errorKey"),v1=Symbol("pino.nestedKey"),w1=Symbol("pino.nestedKeyStr"),S1=Symbol("pino.mixinMergeStrategy"),b1=Symbol("pino.msgPrefix"),E1=Symbol("pino.wildcardFirst"),A1=Symbol.for("pino.serializers"),_1=Symbol.for("pino.formatters"),x1=Symbol.for("pino.hooks"),C1=Symbol.for("pino.metadata");wv.exports={setLevelSym:XP,getLevelSym:QP,levelValSym:ZP,useLevelLabelsSym:e1,mixinSym:r1,lsCacheSym:n1,chindingsSym:i1,asJsonSym:s1,writeSym:o1,serializersSym:A1,redactFmtSym:a1,timeSym:l1,timeSliceIndexSym:u1,streamSym:c1,stringifySym:f1,stringifySafeSym:h1,stringifiersSym:p1,endSym:d1,formatOptsSym:g1,messageKeySym:y1,errorKeySym:m1,nestedKeySym:v1,wildcardFirstSym:E1,needsMetadataGsym:C1,useOnlyCustomLevelsSym:t1,formattersSym:_1,hooksSym:x1,nestedKeyStrSym:w1,mixinMergeStrategySym:S1,msgPrefixSym:b1};});var Bl=R((GN,Av)=>{var jl=vv(),{redactFmtSym:R1,wildcardFirstSym:Hs}=hn(),{rx:Ml,validator:O1}=jl,Sv=O1({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),bv="[Redacted]",Ev=!1;function P1(t,e){let{paths:r,censor:n}=T1(t),s=r.reduce((l,c)=>{Ml.lastIndex=0;let p=Ml.exec(c),u=Ml.exec(c),g=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(g==="*"&&(g=Hs),u===null)return l[g]=null,l;if(l[g]===null)return l;let{index:y}=u,m=`${c.substr(y,c.length-1)}`;return l[g]=l[g]||[],g!==Hs&&l[g].length===0&&l[g].push(...l[Hs]||[]),g===Hs&&Object.keys(l).forEach(function(v){l[v]&&l[v].push(m);}),l[g].push(m),l},{}),i={[R1]:jl({paths:r,censor:n,serialize:e,strict:Ev})},o=(...l)=>e(typeof n=="function"?n(...l):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((l,c)=>{if(s[c]===null)l[c]=p=>o(p,[c]);else {let p=typeof n=="function"?(u,g)=>n(u,[c,...g]):n;l[c]=jl({paths:s[c],censor:p,serialize:e,strict:Ev});}return l},i)}function T1(t){if(Array.isArray(t))return t={paths:t,censor:bv},Sv(t),t;let{paths:e,censor:r=bv,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),Sv({paths:e,censor:r}),{paths:e,censor:r}}Av.exports=P1;});var xv=R((KN,_v)=>{var $1=()=>"",I1=()=>`,"time":${Date.now()}`,k1=()=>`,"time":${Math.round(Date.now()/1e3)}`,L1=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;_v.exports={nullTime:$1,epochTime:I1,unixTime:k1,isoTime:L1};});var Rv=R((VN,Cv)=>{function F1(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Cv.exports=q1;function q1(t,e,r){var n=r&&r.stringify||F1,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var l=1;l-1?g:0,t.charCodeAt(m+1)){case 100:case 102:if(u>=c||e[u]==null)break;g=c||e[u]==null)break;g=c||e[u]===void 0)break;g",g=m+2,m++;break}p+=n(e[u]),g=m+2,m++;break;case 115:if(u>=c)break;g{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));Hl.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};Hl.exports=t;}});var Iv=R((JN,$v)=>{var et=z("fs"),D1=z("events"),N1=z("util").inherits,Ov=z("path"),Pv=Ul(),Wl=100,M1=16*1024;function Tv(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i);}):e.emit("error",i);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&pn(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&et.mkdirSync(Ov.dirname(t),{recursive:!0});let i=et.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?et.mkdir(Ov.dirname(t),{recursive:!0},i=>{if(i)return r(i);et.open(t,n,s,r);}):et.open(t,n,s,r);}function tt(t){if(!(this instanceof tt))return new tt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:l=!0,mode:c,mkdir:p,retryEAGAIN:u,fsync:g}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||M1,this.sync=o||!1,this._fsync=g||!1,this.append=l||!1,this.mode=c,this.retryEAGAIN=u||(()=>!0),this.mkdir=p||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Tv(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Pv(Wl),this.release(void 0,0);}catch(b){this.release(b);}else setTimeout(()=>{et.write(this.fd,this._writingBuf,"utf8",this.release);},Wl);else this._writing=!1,this.emit("error",y);return}if(this.emit("write",m),this._len-=m,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(m),this._writingBuf.length){if(!this.sync){et.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let b=et.writeSync(this.fd,this._writingBuf,"utf8");this._len-=b,this._writingBuf=this._writingBuf.slice(b);}while(this._writingBuf)}catch(b){this.release(b);return}}this._fsync&&et.fsyncSync(this.fd);let v=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):v>this.minLength?pn(this):this._ending?v>0?pn(this):(this._writing=!1,Us(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(j1,this)):this.emit("drain"));},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1);});}function j1(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}N1(tt,D1);tt.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&pn(this),this._len{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&et.close(e,r=>{if(r)return this.emit("error",r)});}),Tv(t||this.file,this);};tt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?pn(this):Us(this)));};tt.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=et.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Pv(Wl);}}};tt.prototype.destroy=function(){this.destroyed||Us(this);};function pn(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=et.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else et.write(t.fd,t._writingBuf,"utf8",e);}function Us(t){if(t.fd===-1){t.once("ready",Us.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?et.close(t.fd,e):setImmediate(e);function e(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}tt.SonicBoom=tt;tt.default=tt;$v.exports=tt;});var zl=R((XN,Nv)=>{var dr={exit:[],beforeExit:[]},kv={exit:H1,beforeExit:U1},Lv=new FinalizationRegistry(W1);function B1(t){dr[t].length>0||process.on(t,kv[t]);}function Fv(t){dr[t].length>0||process.removeListener(t,kv[t]);}function H1(){qv("exit");}function U1(){qv("beforeExit");}function qv(t){for(let e of dr[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function W1(t){for(let e of ["exit","beforeExit"]){let r=dr[e].indexOf(t);dr[e].splice(r,r+1),Fv(e);}}function Dv(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");B1(t);let n=new WeakRef(e);n.fn=r,Lv.register(e,n),dr[t].push(n);}function z1(t,e){Dv("exit",t,e);}function G1(t,e){Dv("beforeExit",t,e);}function K1(t){Lv.unregister(t);for(let e of ["exit","beforeExit"])dr[e]=dr[e].filter(r=>{let n=r.deref();return n&&n!==t}),Fv(e);}Nv.exports={register:z1,registerBeforeExit:G1,unregister:K1};});var Mv=R((QN,V1)=>{V1.exports={name:"thread-stream",version:"2.4.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var Bv=R((ZN,jv)=>{function Y1(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let l=o,c=p=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{l=o,o=Atomics.load(t,e),o===l?c(p>=1e3?1e3:p*2):o===r?s(null,"ok"):s(null,"not-equal");},p);};c(1);}function J1(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let l=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):l(c>=1e3?1e3:c*2);},c);};l(1);}jv.exports={wait:Y1,waitDiff:J1};});var Uv=R((eM,Hv)=>{Hv.exports={WRITE_INDEX:4,READ_INDEX:8};});var Vv=R((rM,Kv)=>{var{version:X1}=Mv(),{EventEmitter:Q1}=z("events"),{Worker:Z1}=z("worker_threads"),{join:eT}=z("path"),{pathToFileURL:tT}=z("url"),{wait:rT}=Bv(),{WRITE_INDEX:rt,READ_INDEX:qt}=Uv(),nT=z("buffer"),iT=z("assert"),D=Symbol("kImpl"),sT=nT.constants.MAX_STRING_LENGTH,zs=class{constructor(e){this._value=e;}deref(){return this._value}},oT=global.FinalizationRegistry||class{register(){}unregister(){}},aT=global.WeakRef||zs,Wv=new oT(t=>{t.exited||t.terminate();});function lT(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||eT(__dirname,"lib","worker.js"),o=new Z1(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:tT(r).href,dataBuf:t[D].dataBuf,stateBuf:t[D].stateBuf,workerData:{$context:{threadStreamVersion:X1},...n}}});return o.stream=new zs(t),o.on("message",uT),o.on("exit",Gv),Wv.register(t,o),o}function zv(t){iT(!t[D].sync),t[D].needDrain&&(t[D].needDrain=!1,t.emit("drain"));}function Ws(t){let e=Atomics.load(t[D].state,rt),r=t[D].data.length-e;if(r>0){if(t[D].buf.length===0){t[D].flushing=!1,t[D].ending?Jl(t):t[D].needDrain&&process.nextTick(zv,t);return}let n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[D].buf=t[D].buf.slice(r),Gs(t,n,Ws.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);s>t[D].data.length;)r=r/2,n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);t[D].buf=t[D].buf.slice(r),Gs(t,n,Ws.bind(null,t));}});}else if(r===0){if(e===0&&t[D].buf.length===0)return;t.flush(()=>{Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0),Ws(t);});}else Dt(t,new Error("overwritten"));}function uT(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new aT(e),e.flush(()=>{e[D].ready=!0,e.emit("ready");});break;case"ERROR":Dt(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:Dt(e,new Error("this should not happen: "+t.code));}}function Gv(t){let e=this.stream.deref();e!==void 0&&(Wv.unregister(e),e.worker.exited=!0,e.worker.off("exit",Gv),Dt(e,t!==0?new Error("the worker thread exited"):null));}var Kl=class extends Q1{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[D]={},this[D].stateBuf=new SharedArrayBuffer(128),this[D].state=new Int32Array(this[D].stateBuf),this[D].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[D].data=Buffer.from(this[D].dataBuf),this[D].sync=e.sync||!1,this[D].ending=!1,this[D].ended=!1,this[D].needDrain=!1,this[D].destroyed=!1,this[D].flushing=!1,this[D].ready=!1,this[D].finished=!1,this[D].errored=null,this[D].closed=!1,this[D].buf="",this.worker=lT(this,e);}write(e){if(this[D].destroyed)return Vl(this,new Error("the worker has exited")),!1;if(this[D].ending)return Vl(this,new Error("the worker is ending")),!1;if(this[D].flushing&&this[D].buf.length+e.length>=sT)try{Gl(this),this[D].flushing=!0;}catch(r){return Dt(this,r),!1}if(this[D].buf+=e,this[D].sync)try{return Gl(this),!0}catch(r){return Dt(this,r),!1}return this[D].flushing||(this[D].flushing=!0,setImmediate(Ws,this)),this[D].needDrain=this[D].data.length-this[D].buf.length-Atomics.load(this[D].state,rt)<=0,!this[D].needDrain}end(){this[D].destroyed||(this[D].ending=!0,Jl(this));}flush(e){if(this[D].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[D].state,rt);rT(this[D].state,qt,r,1/0,(n,s)=>{if(n){Dt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[D].destroyed||(Gl(this),Yl(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[D].ready}get destroyed(){return this[D].destroyed}get closed(){return this[D].closed}get writable(){return !this[D].destroyed&&!this[D].ending}get writableEnded(){return this[D].ending}get writableFinished(){return this[D].finished}get writableNeedDrain(){return this[D].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[D].errored}};function Vl(t,e){setImmediate(()=>{t.emit("error",e);});}function Dt(t,e){t[D].destroyed||(t[D].destroyed=!0,e&&(t[D].errored=e,Vl(t,e)),t.worker.exited?setImmediate(()=>{t[D].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[D].closed=!0,t.emit("close");}));}function Gs(t,e,r){let n=Atomics.load(t[D].state,rt),s=Buffer.byteLength(e);return t[D].data.write(e,n),Atomics.store(t[D].state,rt,n+s),Atomics.notify(t[D].state,rt),r(),!0}function Jl(t){if(!(t[D].ended||!t[D].ending||t[D].flushing)){t[D].ended=!0;try{t.flushSync();let e=Atomics.load(t[D].state,qt);Atomics.store(t[D].state,rt,-1),Atomics.notify(t[D].state,rt);let r=0;for(;e!==-1;){if(Atomics.wait(t[D].state,qt,e,1e3),e=Atomics.load(t[D].state,qt),e===-2){Dt(t,new Error("end() failed"));return}if(++r===10){Dt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[D].finished=!0,t.emit("finish");});}catch(e){Dt(t,e);}}}function Gl(t){let e=()=>{t[D].ending?Jl(t):t[D].needDrain&&process.nextTick(zv,t);};for(t[D].flushing=!1;t[D].buf.length!==0;){let r=Atomics.load(t[D].state,rt),n=t[D].data.length-r;if(n===0){Yl(t),Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);continue}else if(n<0)throw new Error("overwritten");let s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[D].buf=t[D].buf.slice(n),Gs(t,s,e);else {for(Yl(t),Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);i>t[D].buf.length;)n=n/2,s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);t[D].buf=t[D].buf.slice(n),Gs(t,s,e);}}}function Yl(t){if(t[D].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[D].state,rt),r=0;for(;;){let n=Atomics.load(t[D].state,qt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[D].state,qt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Kv.exports=Kl;});var Zl=R((nM,Yv)=>{var{createRequire:cT}=z("module"),fT=Ll(),{join:Xl,isAbsolute:hT,sep:pT}=z("path"),dT=Ul(),Ql=zl(),gT=Vv();function yT(t){Ql.register(t,vT),Ql.registerBeforeExit(t,wT),t.on("close",function(){Ql.unregister(t);});}function mT(t,e,r){let n=new gT({filename:t,workerData:e,workerOpts:r});n.on("ready",s),n.on("close",function(){process.removeListener("exit",i);}),process.on("exit",i);function s(){process.removeListener("exit",i),n.unref(),r.autoEnd!==!1&&yT(n);}function i(){n.closed||(n.flushSync(),dT(100),n.end());}return n}function vT(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function wT(t){t.flushSync();}function ST(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:l=fT()}=t,c=typeof l=="string"?[l]:l,p="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=t.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=p["pino-worker"]||Xl(__dirname,"worker.js"),i.targets=r.map(y=>({...y,target:g(y.target)}))):e&&(u=p["pino-pipeline-worker"]||Xl(__dirname,"worker-pipeline.js"),i.targets=e.map(y=>({...y,target:g(y.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),mT(g(u),i,o);function g(y){if(y=p[y]||y,hT(y)||y.indexOf("file://")===0)return y;if(y==="pino/file")return Xl(__dirname,"..","file.js");let m;for(let v of c)try{let b=v==="node:repl"?process.cwd()+pT:v;m=cT(b).resolve(y);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${y}"`);return m}}Yv.exports=ST;});var Ys=R((iM,ow)=>{var Jv=Rv(),{mapHttpRequest:bT,mapHttpResponse:ET}=kl(),tu=Iv(),Xv=zl(),{lsCacheSym:AT,chindingsSym:ew,writeSym:Qv,serializersSym:tw,formatOptsSym:Zv,endSym:_T,stringifiersSym:rw,stringifySym:nw,stringifySafeSym:ru,wildcardFirstSym:iw,nestedKeySym:xT,formattersSym:sw,messageKeySym:CT,errorKeySym:RT,nestedKeyStrSym:OT,msgPrefixSym:Ks}=hn(),{isMainThread:PT}=z("worker_threads"),TT=Zl();function dn(){}function $T(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t);};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=bT(n):typeof n.setHeader=="function"&&(n=ET(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[Ks]=="string"&&i!==void 0&&i!==null&&(i=this[Ks]+i),this[Qv](n,Jv(i,o,this[Zv]),t);}else {let i=n===void 0?s.shift():n;typeof this[Ks]=="string"&&i!==void 0&&i!==null&&(i=this[Ks]+i),this[Qv](null,Jv(i,s,this[Zv]),t);}}}function eu(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function IT(t,e,r,n){let s=this[nw],i=this[ru],o=this[rw],l=this[_T],c=this[ew],p=this[tw],u=this[sw],g=this[CT],y=this[RT],m=this[AT][r]+n;m=m+c;let v;u.log&&(t=u.log(t));let b=o[iw],_="";for(let A in t)if(v=t[A],Object.prototype.hasOwnProperty.call(t,A)&&v!==void 0){p[A]?v=p[A](v):A===y&&p.err&&(v=p.err(v));let O=o[A]||b;switch(typeof v){case"undefined":case"function":continue;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":O&&(v=O(v));break;case"string":v=(O||eu)(v);break;default:v=(O||s)(v,i);}if(v===void 0)continue;let I=eu(A);_+=","+I+":"+v;}let x="";if(e!==void 0){v=p[g]?p[g](e):e;let A=o[g]||b;switch(typeof v){case"function":break;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":A&&(v=A(v)),x=',"'+g+'":'+v;break;case"string":v=(A||eu)(v),x=',"'+g+'":'+v;break;default:v=(A||s)(v,i),x=',"'+g+'":'+v;}}return this[xT]&&_?m+this[OT]+_.slice(1)+"}"+x+l:m+_+x+l}function kT(t,e){let r,n=t[ew],s=t[nw],i=t[ru],o=t[rw],l=o[iw],c=t[tw],p=t[sw].bindings;e=p(e);for(let u in e)if(r=e[u],(u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels"&&e.hasOwnProperty(u)&&r!==void 0)===!0){if(r=c[u]?c[u](r):r,r=(o[u]||l||s)(r,i),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function LT(t){return t.write!==t.constructor.prototype.write}function Vs(t){let e=new tu(t);return e.on("error",r),!t.sync&&PT&&(Xv.register(e,FT),e.on("close",function(){Xv.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=dn,e.end=dn,e.flushSync=dn,e.destroy=dn;return}e.removeListener("error",r),e.emit("error",n);}}function FT(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function qT(t){return function(r,n,s={},i){if(typeof s=="string")i=Vs({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=Vs({dest:i});}else if(s instanceof tu||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof tu||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;s.customLevels&&(c=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=TT({caller:n,...s.transport,levels:c});}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:l}=s;return o===!1&&(s.level="silent"),l||(s.onChild=dn),i||(LT(process.stdout)?i=process.stdout:i=Vs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function DT(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[ru])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function NT(t,e,r){return {level:t,bindings:e,log:r}}function MT(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}ow.exports={noop:dn,buildSafeSonicBoom:Vs,asChindings:kT,asJson:IT,genLog:$T,createArgsNormalizer:qT,stringify:DT,buildFormatters:NT,normalizeDestFileDescriptor:MT};});var Js=R((sM,lw)=>{var{lsCacheSym:jT,levelValSym:nu,useOnlyCustomLevelsSym:BT,streamSym:HT,formattersSym:UT,hooksSym:WT}=hn(),{noop:zT,genLog:Ir}=Ys(),_t={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},aw={fatal:t=>{let e=Ir(_t.fatal,t);return function(...r){let n=this[HT];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>Ir(_t.error,t),warn:t=>Ir(_t.warn,t),info:t=>Ir(_t.info,t),debug:t=>Ir(_t.debug,t),trace:t=>Ir(_t.trace,t)},iu=Object.keys(_t).reduce((t,e)=>(t[_t[e]]=e,t),{}),GT=Object.keys(iu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function KT(t){let e=t[UT].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1);}return t[jT]=n,t}function VT(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function YT(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[nu],s=this[nu]=r[t],i=this[BT],o=this[WT].logMethod;for(let l in r){if(s>r[l]){this[l]=zT;continue}this[l]=VT(l,i)?aw[l](o):Ir(r[l],o);}this.emit("level-change",t,s,e[n],n,this);}function JT(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function XT(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[nu]}function QT(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:iu,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:_t,t);return {labels:n,values:s}}function ZT(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(iu).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:_t,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function e$(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}lw.exports={initialLsCache:GT,genLsCache:KT,levelMethods:aw,getLevel:JT,setLevel:YT,isLevelEnabled:XT,mappings:QT,levels:_t,assertNoLevelCollisions:e$,assertDefaultLevelFound:ZT};});var su=R((oM,uw)=>{uw.exports={version:"8.15.1"};});var Sw=R((lM,ww)=>{var{EventEmitter:t$}=z("events"),{lsCacheSym:r$,levelValSym:n$,setLevelSym:au,getLevelSym:cw,chindingsSym:lu,parsedChindingsSym:i$,mixinSym:s$,asJsonSym:gw,writeSym:o$,mixinMergeStrategySym:a$,timeSym:l$,timeSliceIndexSym:u$,streamSym:yw,serializersSym:kr,formattersSym:ou,errorKeySym:c$,messageKeySym:f$,useOnlyCustomLevelsSym:h$,needsMetadataGsym:p$,redactFmtSym:d$,stringifySym:g$,formatOptsSym:y$,stringifiersSym:m$,msgPrefixSym:fw}=hn(),{getLevel:v$,setLevel:w$,isLevelEnabled:S$,mappings:b$,initialLsCache:E$,genLsCache:A$,assertNoLevelCollisions:_$}=Js(),{asChindings:mw,asJson:x$,buildFormatters:hw,stringify:pw}=Ys(),{version:C$}=su(),R$=Bl(),O$=class{},vw={constructor:O$,child:P$,bindings:T$,setBindings:$$,flush:F$,isLevelEnabled:S$,version:C$,get level(){return this[cw]()},set level(t){this[au](t);},get levelVal(){return this[n$]},set levelVal(t){throw Error("levelVal is read-only")},[r$]:E$,[o$]:k$,[gw]:x$,[cw]:v$,[au]:w$};Object.setPrototypeOf(vw,t$.prototype);ww.exports=function(){return Object.create(vw)};var dw=t=>t;function P$(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[kr],n=this[ou],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[kr]=Object.create(null);for(let u in r)s[kr][u]=r[u];let c=Object.getOwnPropertySymbols(r);for(var i=0;i{var{hasOwnProperty:Xs}=Object.prototype,Fr=fu();Fr.configure=fu;Fr.stringify=Fr;Fr.default=Fr;hu.stringify=Fr;hu.configure=fu;_w.exports=Fr;var q$=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function gr(t){return t.length<5e3&&!q$.test(t)?`"${t}"`:JSON.stringify(t)}function uu(t){if(t.length>200)return t.sort();for(let e=1;er;)t[n]=t[n-1],n--;t[n]=r;}return t}var D$=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function cu(t){return D$.call(t)!==void 0&&t.length!==0}function bw(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function Lr(t){return t===1?"1 item":`${t} items`}function M$(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function j$(t){if(Xs.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function fu(t){t={...t};let e=j$(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=N$(t),n=Ew(t,"bigint"),s=Ew(t,"deterministic"),i=Aw(t,"maximumDepth"),o=Aw(t,"maximumBreadth");function l(y,m,v,b,_,x){let A=m[y];switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(y)),A=b.call(m,y,A),typeof A){case"string":return gr(A);case"object":{if(A===null)return "null";if(v.indexOf(A)!==-1)return r;let O="",I=",",F=x;if(Array.isArray(A)){if(A.length===0)return "[]";if(io){let se=A.length-o-1;O+=`${I}"... ${Lr(se)} not stringified"`;}return _!==""&&(O+=` -${F}`),v.pop(),`[${O}]`}let U=Object.keys(A),H=U.length;if(H===0)return "{}";if(io){let C=H-o;O+=`${k}"...":${q}"${Lr(C)} not stringified"`,k=I;}return _!==""&&k.length>1&&(O=` -${x}${O} -${F}`),v.pop(),`{${O}}`}case"number":return isFinite(A)?String(A):e?e(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(A);default:return e?e(A):void 0}}function c(y,m,v,b,_,x){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(y)),typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(v.indexOf(m)!==-1)return r;let A=x,O="",I=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let j=m.length-o-1;O+=`${I}"... ${Lr(j)} not stringified"`;}return _!==""&&(O+=` -${A}`),v.pop(),`[${O}]`}v.push(m);let F="";_!==""&&(x+=_,I=`, -${x}`,F=" ");let U="";for(let H of b){let q=c(H,m[H],v,b,_,x);q!==void 0&&(O+=`${U}${gr(H)}:${F}${q}`,U=I);}return _!==""&&U.length>1&&(O=` -${x}${O} -${A}`),v.pop(),`{${O}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function p(y,m,v,b,_){switch(typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(y),typeof m!="object")return p(y,m,v,b,_);if(m===null)return "null"}if(v.indexOf(m)!==-1)return r;let x=_;if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let Y=m.length-o-1;q+=`${k}"... ${Lr(Y)} not stringified"`;}return q+=` -${x}`,v.pop(),`[${q}]`}let A=Object.keys(m),O=A.length;if(O===0)return "{}";if(io){let q=O-o;F+=`${U}"...": "${Lr(q)} not stringified"`,U=I;}return U!==""&&(F=` -${_}${F} -${x}`),v.pop(),`{${F}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function u(y,m,v){switch(typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(y),typeof m!="object")return u(y,m,v);if(m===null)return "null"}if(v.indexOf(m)!==-1)return r;let b="";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let H=m.length-o-1;b+=`,"... ${Lr(H)} not stringified"`;}return v.pop(),`[${b}]`}let _=Object.keys(m),x=_.length;if(x===0)return "{}";if(io){let I=x-o;b+=`${A}"...":"${Lr(I)} not stringified"`;}return v.pop(),`{${b}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function g(y,m,v){if(arguments.length>1){let b="";if(typeof v=="number"?b=" ".repeat(Math.min(v,10)):typeof v=="string"&&(b=v.slice(0,10)),m!=null){if(typeof m=="function")return l("",{"":y},[],m,b,"");if(Array.isArray(m))return c("",y,[],M$(m),b,"")}if(b.length!==0)return p("",y,[],b,"")}return u("",y,[])}return g}});var Ow=R((uM,Rw)=>{var pu=Symbol.for("pino.metadata"),{levels:Cw}=Js(),B$=Cw.info;function H$(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(Cw);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(u=>{n[u]=e.levels[u];});let s={write:i,add:l,flushSync:o,end:c,minLevel:0,streams:[],clone:p,[pu]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(l,s):l.call(s,t),t=null,s;function i(u){let g,y=this.lastLevel,{streams:m}=this,v=0,b;for(let _=W$(m.length,e.dedupe);G$(_,m.length,e.dedupe);_=z$(_,e.dedupe))if(g=m[_],g.level<=y){if(v!==0&&v!==g.level)break;if(b=g.stream,b[pu]){let{lastTime:x,lastMsg:A,lastObj:O,lastLogger:I}=this;b.lastLevel=y,b.lastTime=x,b.lastMsg=A,b.lastObj=O,b.lastLogger=I;}b.write(u),e.dedupe&&(v=g.level);}else if(!e.dedupe)break}function o(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function l(u){if(!u)return s;let g=typeof u.write=="function"||u.stream,y=u.write?u:u.stream;if(!g)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:v}=this,b;typeof u.levelVal=="number"?b=u.levelVal:typeof u.level=="string"?b=v[u.level]:typeof u.level=="number"?b=u.level:b=B$;let _={stream:y,level:b,levelVal:void 0,id:r++};return m.unshift(_),m.sort(U$),this.minLevel=m[0].level,s}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function p(u){let g=new Array(this.streams.length);for(let y=0;y=0:t{var K$=z("os"),qw=kl(),V$=Ll(),Y$=Bl(),Dw=xv(),J$=Sw(),Nw=hn(),{configure:X$}=xw(),{assertDefaultLevelFound:Q$,mappings:Mw,genLsCache:Z$,levels:eI}=Js(),{createArgsNormalizer:tI,asChindings:rI,buildSafeSonicBoom:Pw,buildFormatters:nI,stringify:du,normalizeDestFileDescriptor:Tw,noop:iI}=Ys(),{version:sI}=su(),{chindingsSym:$w,redactFmtSym:oI,serializersSym:Iw,timeSym:aI,timeSliceIndexSym:lI,streamSym:uI,stringifySym:kw,stringifySafeSym:gu,stringifiersSym:Lw,setLevelSym:cI,endSym:fI,formatOptsSym:hI,messageKeySym:pI,errorKeySym:dI,nestedKeySym:gI,mixinSym:yI,useOnlyCustomLevelsSym:mI,formattersSym:Fw,hooksSym:vI,nestedKeyStrSym:wI,mixinMergeStrategySym:SI,msgPrefixSym:bI}=Nw,{epochTime:jw,nullTime:EI}=Dw,{pid:AI}=process,_I=K$.hostname(),xI=qw.err,CI={level:"info",levels:eI,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:AI,hostname:_I},serializers:Object.assign(Object.create(null),{err:xI}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:jw,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},RI=tI(CI),OI=Object.assign(Object.create(null),qw);function yu(...t){let e={},{opts:r,stream:n}=RI(e,V$(),...t),{redact:s,crlf:i,serializers:o,timestamp:l,messageKey:c,errorKey:p,nestedKey:u,base:g,name:y,level:m,customLevels:v,mixin:b,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:A,hooks:O,depthLimit:I,edgeLimit:F,onChild:U,msgPrefix:H}=r,q=X$({maximumDepth:I,maximumBreadth:F}),k=nI(A.level,A.bindings,A.log),j=du.bind({[gu]:q}),C=s?Y$(s,j):{},V=s?{stringify:C[oI]}:{stringify:j},Y="}"+(i?`\r + `}});var gw=T((FL,_w)=>{_w.exports=aO;function aO(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:a,wcLen:c}=t,d=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&d.push({serialize:s}),c>0&&d.push({groupRedact:i,nestedRedact:o,wildcards:a,wcLen:c}),Object.assign(...d)}});var bw=T((NL,ww)=>{var yw=sw(),lO=lw(),uO=cw(),cO=mw(),{groupRedact:fO,nestedRedact:hO}=Hl(),dO=gw(),pO=ps(),mO=yw(),jl=t=>t;jl.restore=jl;var _O="[REDACTED]";Wl.rx=pO;Wl.validator=yw;ww.exports=Wl;function Wl(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let s=n===!0?void 0:"censor"in t?t.censor:_O,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||jl;mO({paths:e,serialize:r,censor:s});let{wildcards:a,wcLen:c,secret:d}=lO({paths:e,censor:s}),u=cO({secret:d,wcLen:c}),p="strict"in t?t.strict:!0;return uO({secret:d,wcLen:c,serialize:r,strict:p,isCensorFct:i,censorFctTakesPath:o},dO({secret:d,censor:s,compileRestore:u,serialize:r,groupRedact:fO,nestedRedact:hO,wildcards:a,wcLen:c}))}});var Nr=T((kL,vw)=>{var gO=Symbol("pino.setLevel"),yO=Symbol("pino.getLevel"),wO=Symbol("pino.levelVal"),bO=Symbol("pino.useLevelLabels"),vO=Symbol("pino.useOnlyCustomLevels"),SO=Symbol("pino.mixin"),EO=Symbol("pino.lsCache"),AO=Symbol("pino.chindings"),xO=Symbol("pino.asJson"),CO=Symbol("pino.write"),RO=Symbol("pino.redactFmt"),TO=Symbol("pino.time"),IO=Symbol("pino.timeSliceIndex"),PO=Symbol("pino.stream"),OO=Symbol("pino.stringify"),MO=Symbol("pino.stringifySafe"),FO=Symbol("pino.stringifiers"),NO=Symbol("pino.end"),kO=Symbol("pino.formatOpts"),$O=Symbol("pino.messageKey"),LO=Symbol("pino.errorKey"),DO=Symbol("pino.nestedKey"),qO=Symbol("pino.nestedKeyStr"),BO=Symbol("pino.mixinMergeStrategy"),UO=Symbol("pino.msgPrefix"),HO=Symbol("pino.wildcardFirst"),jO=Symbol.for("pino.serializers"),WO=Symbol.for("pino.formatters"),zO=Symbol.for("pino.hooks"),GO=Symbol.for("pino.metadata");vw.exports={setLevelSym:gO,getLevelSym:yO,levelValSym:wO,useLevelLabelsSym:bO,mixinSym:SO,lsCacheSym:EO,chindingsSym:AO,asJsonSym:xO,writeSym:CO,serializersSym:jO,redactFmtSym:RO,timeSym:TO,timeSliceIndexSym:IO,streamSym:PO,stringifySym:OO,stringifySafeSym:MO,stringifiersSym:FO,endSym:NO,formatOptsSym:kO,messageKeySym:$O,errorKeySym:LO,nestedKeySym:DO,wildcardFirstSym:HO,needsMetadataGsym:GO,useOnlyCustomLevelsSym:vO,formattersSym:WO,hooksSym:zO,nestedKeyStrSym:qO,mixinMergeStrategySym:BO,msgPrefixSym:UO};});var Vl=T(($L,xw)=>{var Gl=bw(),{redactFmtSym:VO,wildcardFirstSym:ms}=Nr(),{rx:zl,validator:KO}=Gl,Sw=KO({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),Ew="[Redacted]",Aw=!1;function ZO(t,e){let{paths:r,censor:n}=YO(t),s=r.reduce((a,c)=>{zl.lastIndex=0;let d=zl.exec(c),u=zl.exec(c),p=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(p==="*"&&(p=ms),u===null)return a[p]=null,a;if(a[p]===null)return a;let{index:_}=u,m=`${c.substr(_,c.length-1)}`;return a[p]=a[p]||[],p!==ms&&a[p].length===0&&a[p].push(...a[ms]||[]),p===ms&&Object.keys(a).forEach(function(y){a[y]&&a[y].push(m);}),a[p].push(m),a},{}),i={[VO]:Gl({paths:r,censor:n,serialize:e,strict:Aw})},o=(...a)=>e(typeof n=="function"?n(...a):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((a,c)=>{if(s[c]===null)a[c]=d=>o(d,[c]);else {let d=typeof n=="function"?(u,p)=>n(u,[c,...p]):n;a[c]=Gl({paths:s[c],censor:d,serialize:e,strict:Aw});}return a},i)}function YO(t){if(Array.isArray(t))return t={paths:t,censor:Ew},Sw(t),t;let{paths:e,censor:r=Ew,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),Sw({paths:e,censor:r}),{paths:e,censor:r}}xw.exports=ZO;});var Rw=T((LL,Cw)=>{var JO=()=>"",XO=()=>`,"time":${Date.now()}`,QO=()=>`,"time":${Math.round(Date.now()/1e3)}`,eM=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Cw.exports={nullTime:JO,epochTime:XO,unixTime:QO,isoTime:eM};});var Iw=T((DL,Tw)=>{function tM(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Tw.exports=rM;function rM(t,e,r){var n=r&&r.stringify||tM,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var a=1;a-1?p:0,t.charCodeAt(m+1)){case 100:case 102:if(u>=c||e[u]==null)break;p=c||e[u]==null)break;p=c||e[u]===void 0)break;p",p=m+2,m++;break}d+=n(e[u]),p=m+2,m++;break;case 115:if(u>=c)break;p{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));Kl.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};Kl.exports=t;}});var Nw=T((BL,Fw)=>{var je=G("fs"),nM=G("events"),iM=G("util").inherits,Pw=G("path"),Ow=Zl(),Yl=100,sM=16*1024;function Mw(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i);}):e.emit("error",i);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&kr(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&je.mkdirSync(Pw.dirname(t),{recursive:!0});let i=je.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?je.mkdir(Pw.dirname(t),{recursive:!0},i=>{if(i)return r(i);je.open(t,n,s,r);}):je.open(t,n,s,r);}function We(t){if(!(this instanceof We))return new We(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:a=!0,mode:c,mkdir:d,retryEAGAIN:u,fsync:p}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||sM,this.sync=o||!1,this._fsync=p||!1,this.append=a||!1,this.mode=c,this.retryEAGAIN=u||(()=>!0),this.mkdir=d||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Mw(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(_,m)=>{if(_){if((_.code==="EAGAIN"||_.code==="EBUSY")&&this.retryEAGAIN(_,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Ow(Yl),this.release(void 0,0);}catch(v){this.release(v);}else setTimeout(()=>{je.write(this.fd,this._writingBuf,"utf8",this.release);},Yl);else this._writing=!1,this.emit("error",_);return}if(this.emit("write",m),this._len-=m,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(m),this._writingBuf.length){if(!this.sync){je.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let v=je.writeSync(this.fd,this._writingBuf,"utf8");this._len-=v,this._writingBuf=this._writingBuf.slice(v);}while(this._writingBuf)}catch(v){this.release(v);return}}this._fsync&&je.fsyncSync(this.fd);let y=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):y>this.minLength?kr(this):this._ending?y>0?kr(this):(this._writing=!1,_s(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(oM,this)):this.emit("drain"));},this.on("newListener",function(_){_==="drain"&&(this._asyncDrainScheduled=!1);});}function oM(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}iM(We,nM);We.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&kr(this),this._len{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&je.close(e,r=>{if(r)return this.emit("error",r)});}),Mw(t||this.file,this);};We.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?kr(this):_s(this)));};We.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=je.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Ow(Yl);}}};We.prototype.destroy=function(){this.destroyed||_s(this);};function kr(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=je.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else je.write(t.fd,t._writingBuf,"utf8",e);}function _s(t){if(t.fd===-1){t.once("ready",_s.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?je.close(t.fd,e):setImmediate(e);function e(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}We.SonicBoom=We;We.default=We;Fw.exports=We;});var Jl=T((UL,Bw)=>{var qt={exit:[],beforeExit:[]},kw={exit:lM,beforeExit:uM},$w=new FinalizationRegistry(cM);function aM(t){qt[t].length>0||process.on(t,kw[t]);}function Lw(t){qt[t].length>0||process.removeListener(t,kw[t]);}function lM(){Dw("exit");}function uM(){Dw("beforeExit");}function Dw(t){for(let e of qt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function cM(t){for(let e of ["exit","beforeExit"]){let r=qt[e].indexOf(t);qt[e].splice(r,r+1),Lw(e);}}function qw(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");aM(t);let n=new WeakRef(e);n.fn=r,$w.register(e,n),qt[t].push(n);}function fM(t,e){qw("exit",t,e);}function hM(t,e){qw("beforeExit",t,e);}function dM(t){$w.unregister(t);for(let e of ["exit","beforeExit"])qt[e]=qt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Lw(e);}Bw.exports={register:fM,registerBeforeExit:hM,unregister:dM};});var Uw=T((HL,pM)=>{pM.exports={name:"thread-stream",version:"2.4.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var jw=T((jL,Hw)=>{function mM(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let a=o,c=d=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{a=o,o=Atomics.load(t,e),o===a?c(d>=1e3?1e3:d*2):o===r?s(null,"ok"):s(null,"not-equal");},d);};c(1);}function _M(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let a=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):a(c>=1e3?1e3:c*2);},c);};a(1);}Hw.exports={wait:mM,waitDiff:_M};});var zw=T((WL,Ww)=>{Ww.exports={WRITE_INDEX:4,READ_INDEX:8};});var Yw=T((GL,Zw)=>{var{version:gM}=Uw(),{EventEmitter:yM}=G("events"),{Worker:wM}=G("worker_threads"),{join:bM}=G("path"),{pathToFileURL:vM}=G("url"),{wait:SM}=jw(),{WRITE_INDEX:ze,READ_INDEX:pt}=zw(),EM=G("buffer"),AM=G("assert"),L=Symbol("kImpl"),xM=EM.constants.MAX_STRING_LENGTH,ys=class{constructor(e){this._value=e;}deref(){return this._value}},CM=global.FinalizationRegistry||class{register(){}unregister(){}},RM=global.WeakRef||ys,Gw=new CM(t=>{t.exited||t.terminate();});function TM(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||bM(__dirname,"lib","worker.js"),o=new wM(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:vM(r).href,dataBuf:t[L].dataBuf,stateBuf:t[L].stateBuf,workerData:{$context:{threadStreamVersion:gM},...n}}});return o.stream=new ys(t),o.on("message",IM),o.on("exit",Kw),Gw.register(t,o),o}function Vw(t){AM(!t[L].sync),t[L].needDrain&&(t[L].needDrain=!1,t.emit("drain"));}function gs(t){let e=Atomics.load(t[L].state,ze),r=t[L].data.length-e;if(r>0){if(t[L].buf.length===0){t[L].flushing=!1,t[L].ending?ru(t):t[L].needDrain&&process.nextTick(Vw,t);return}let n=t[L].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[L].buf=t[L].buf.slice(r),ws(t,n,gs.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0);s>t[L].data.length;)r=r/2,n=t[L].buf.slice(0,r),s=Buffer.byteLength(n);t[L].buf=t[L].buf.slice(r),ws(t,n,gs.bind(null,t));}});}else if(r===0){if(e===0&&t[L].buf.length===0)return;t.flush(()=>{Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0),gs(t);});}else mt(t,new Error("overwritten"));}function IM(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new RM(e),e.flush(()=>{e[L].ready=!0,e.emit("ready");});break;case"ERROR":mt(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:mt(e,new Error("this should not happen: "+t.code));}}function Kw(t){let e=this.stream.deref();e!==void 0&&(Gw.unregister(e),e.worker.exited=!0,e.worker.off("exit",Kw),mt(e,t!==0?new Error("the worker thread exited"):null));}var Ql=class extends yM{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[L]={},this[L].stateBuf=new SharedArrayBuffer(128),this[L].state=new Int32Array(this[L].stateBuf),this[L].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[L].data=Buffer.from(this[L].dataBuf),this[L].sync=e.sync||!1,this[L].ending=!1,this[L].ended=!1,this[L].needDrain=!1,this[L].destroyed=!1,this[L].flushing=!1,this[L].ready=!1,this[L].finished=!1,this[L].errored=null,this[L].closed=!1,this[L].buf="",this.worker=TM(this,e);}write(e){if(this[L].destroyed)return eu(this,new Error("the worker has exited")),!1;if(this[L].ending)return eu(this,new Error("the worker is ending")),!1;if(this[L].flushing&&this[L].buf.length+e.length>=xM)try{Xl(this),this[L].flushing=!0;}catch(r){return mt(this,r),!1}if(this[L].buf+=e,this[L].sync)try{return Xl(this),!0}catch(r){return mt(this,r),!1}return this[L].flushing||(this[L].flushing=!0,setImmediate(gs,this)),this[L].needDrain=this[L].data.length-this[L].buf.length-Atomics.load(this[L].state,ze)<=0,!this[L].needDrain}end(){this[L].destroyed||(this[L].ending=!0,ru(this));}flush(e){if(this[L].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[L].state,ze);SM(this[L].state,pt,r,1/0,(n,s)=>{if(n){mt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[L].destroyed||(Xl(this),tu(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[L].ready}get destroyed(){return this[L].destroyed}get closed(){return this[L].closed}get writable(){return !this[L].destroyed&&!this[L].ending}get writableEnded(){return this[L].ending}get writableFinished(){return this[L].finished}get writableNeedDrain(){return this[L].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[L].errored}};function eu(t,e){setImmediate(()=>{t.emit("error",e);});}function mt(t,e){t[L].destroyed||(t[L].destroyed=!0,e&&(t[L].errored=e,eu(t,e)),t.worker.exited?setImmediate(()=>{t[L].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[L].closed=!0,t.emit("close");}));}function ws(t,e,r){let n=Atomics.load(t[L].state,ze),s=Buffer.byteLength(e);return t[L].data.write(e,n),Atomics.store(t[L].state,ze,n+s),Atomics.notify(t[L].state,ze),r(),!0}function ru(t){if(!(t[L].ended||!t[L].ending||t[L].flushing)){t[L].ended=!0;try{t.flushSync();let e=Atomics.load(t[L].state,pt);Atomics.store(t[L].state,ze,-1),Atomics.notify(t[L].state,ze);let r=0;for(;e!==-1;){if(Atomics.wait(t[L].state,pt,e,1e3),e=Atomics.load(t[L].state,pt),e===-2){mt(t,new Error("end() failed"));return}if(++r===10){mt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[L].finished=!0,t.emit("finish");});}catch(e){mt(t,e);}}}function Xl(t){let e=()=>{t[L].ending?ru(t):t[L].needDrain&&process.nextTick(Vw,t);};for(t[L].flushing=!1;t[L].buf.length!==0;){let r=Atomics.load(t[L].state,ze),n=t[L].data.length-r;if(n===0){tu(t),Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0);continue}else if(n<0)throw new Error("overwritten");let s=t[L].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[L].buf=t[L].buf.slice(n),ws(t,s,e);else {for(tu(t),Atomics.store(t[L].state,pt,0),Atomics.store(t[L].state,ze,0);i>t[L].buf.length;)n=n/2,s=t[L].buf.slice(0,n),i=Buffer.byteLength(s);t[L].buf=t[L].buf.slice(n),ws(t,s,e);}}}function tu(t){if(t[L].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[L].state,ze),r=0;for(;;){let n=Atomics.load(t[L].state,pt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[L].state,pt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Zw.exports=Ql;});var su=T((VL,Jw)=>{var{createRequire:PM}=G("module"),OM=Bl(),{join:nu,isAbsolute:MM,sep:FM}=G("path"),NM=Zl(),iu=Jl(),kM=Yw();function $M(t){iu.register(t,DM),iu.registerBeforeExit(t,qM),t.on("close",function(){iu.unregister(t);});}function LM(t,e,r){let n=new kM({filename:t,workerData:e,workerOpts:r});n.on("ready",s),n.on("close",function(){process.removeListener("exit",i);}),process.on("exit",i);function s(){process.removeListener("exit",i),n.unref(),r.autoEnd!==!1&&$M(n);}function i(){n.closed||(n.flushSync(),NM(100),n.end());}return n}function DM(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function qM(t){t.flushSync();}function BM(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:a=OM()}=t,c=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=t.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=d["pino-worker"]||nu(__dirname,"worker.js"),i.targets=r.map(_=>({..._,target:p(_.target)}))):e&&(u=d["pino-pipeline-worker"]||nu(__dirname,"worker-pipeline.js"),i.targets=e.map(_=>({..._,target:p(_.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),LM(p(u),i,o);function p(_){if(_=d[_]||_,MM(_)||_.indexOf("file://")===0)return _;if(_==="pino/file")return nu(__dirname,"..","file.js");let m;for(let y of c)try{let v=y==="node:repl"?process.cwd()+FM:y;m=PM(v).resolve(_);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${_}"`);return m}}Jw.exports=BM;});var Ss=T((KL,lb)=>{var Xw=Iw(),{mapHttpRequest:UM,mapHttpResponse:HM}=ql(),au=Nw(),Qw=Jl(),{lsCacheSym:jM,chindingsSym:rb,writeSym:eb,serializersSym:nb,formatOptsSym:tb,endSym:WM,stringifiersSym:ib,stringifySym:sb,stringifySafeSym:lu,wildcardFirstSym:ob,nestedKeySym:zM,formattersSym:ab,messageKeySym:GM,errorKeySym:VM,nestedKeyStrSym:KM,msgPrefixSym:bs}=Nr(),{isMainThread:ZM}=G("worker_threads"),YM=su();function $r(){}function JM(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t);};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=UM(n):typeof n.setHeader=="function"&&(n=HM(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[bs]=="string"&&i!==void 0&&i!==null&&(i=this[bs]+i),this[eb](n,Xw(i,o,this[tb]),t);}else {let i=n===void 0?s.shift():n;typeof this[bs]=="string"&&i!==void 0&&i!==null&&(i=this[bs]+i),this[eb](null,Xw(i,s,this[tb]),t);}}}function ou(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function XM(t,e,r,n){let s=this[sb],i=this[lu],o=this[ib],a=this[WM],c=this[rb],d=this[nb],u=this[ab],p=this[GM],_=this[VM],m=this[jM][r]+n;m=m+c;let y;u.log&&(t=u.log(t));let v=o[ob],E="";for(let w in t)if(y=t[w],Object.prototype.hasOwnProperty.call(t,w)&&y!==void 0){d[w]?y=d[w](y):w===_&&d.err&&(y=d.err(y));let x=o[w]||v;switch(typeof y){case"undefined":case"function":continue;case"number":Number.isFinite(y)===!1&&(y=null);case"boolean":x&&(y=x(y));break;case"string":y=(x||ou)(y);break;default:y=(x||s)(y,i);}if(y===void 0)continue;let M=ou(w);E+=","+M+":"+y;}let A="";if(e!==void 0){y=d[p]?d[p](e):e;let w=o[p]||v;switch(typeof y){case"function":break;case"number":Number.isFinite(y)===!1&&(y=null);case"boolean":w&&(y=w(y)),A=',"'+p+'":'+y;break;case"string":y=(w||ou)(y),A=',"'+p+'":'+y;break;default:y=(w||s)(y,i),A=',"'+p+'":'+y;}}return this[zM]&&E?m+this[KM]+E.slice(1)+"}"+A+a:m+E+A+a}function QM(t,e){let r,n=t[rb],s=t[sb],i=t[lu],o=t[ib],a=o[ob],c=t[nb],d=t[ab].bindings;e=d(e);for(let u in e)if(r=e[u],(u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels"&&e.hasOwnProperty(u)&&r!==void 0)===!0){if(r=c[u]?c[u](r):r,r=(o[u]||a||s)(r,i),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function eF(t){return t.write!==t.constructor.prototype.write}function vs(t){let e=new au(t);return e.on("error",r),!t.sync&&ZM&&(Qw.register(e,tF),e.on("close",function(){Qw.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=$r,e.end=$r,e.flushSync=$r,e.destroy=$r;return}e.removeListener("error",r),e.emit("error",n);}}function tF(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function rF(t){return function(r,n,s={},i){if(typeof s=="string")i=vs({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=vs({dest:i});}else if(s instanceof au||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof au||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;s.customLevels&&(c=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=YM({caller:n,...s.transport,levels:c});}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=s;return o===!1&&(s.level="silent"),a||(s.onChild=$r),i||(eF(process.stdout)?i=process.stdout:i=vs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function nF(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[lu])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function iF(t,e,r){return {level:t,bindings:e,log:r}}function sF(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}lb.exports={noop:$r,buildSafeSonicBoom:vs,asChindings:QM,asJson:XM,genLog:JM,createArgsNormalizer:rF,stringify:nF,buildFormatters:iF,normalizeDestFileDescriptor:sF};});var Es=T((ZL,cb)=>{var{lsCacheSym:oF,levelValSym:uu,useOnlyCustomLevelsSym:aF,streamSym:lF,formattersSym:uF,hooksSym:cF}=Nr(),{noop:fF,genLog:nr}=Ss(),lt={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},ub={fatal:t=>{let e=nr(lt.fatal,t);return function(...r){let n=this[lF];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>nr(lt.error,t),warn:t=>nr(lt.warn,t),info:t=>nr(lt.info,t),debug:t=>nr(lt.debug,t),trace:t=>nr(lt.trace,t)},cu=Object.keys(lt).reduce((t,e)=>(t[lt[e]]=e,t),{}),hF=Object.keys(cu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function dF(t){let e=t[uF].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1);}return t[oF]=n,t}function pF(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function mF(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[uu],s=this[uu]=r[t],i=this[aF],o=this[cF].logMethod;for(let a in r){if(s>r[a]){this[a]=fF;continue}this[a]=pF(a,i)?ub[a](o):nr(r[a],o);}this.emit("level-change",t,s,e[n],n,this);}function _F(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function gF(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[uu]}function yF(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:cu,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:lt,t);return {labels:n,values:s}}function wF(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(cu).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:lt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function bF(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}cb.exports={initialLsCache:hF,genLsCache:dF,levelMethods:ub,getLevel:_F,setLevel:mF,isLevelEnabled:gF,mappings:yF,levels:lt,assertNoLevelCollisions:bF,assertDefaultLevelFound:wF};});var fu=T((YL,fb)=>{fb.exports={version:"8.15.1"};});var Sb=T((XL,vb)=>{var{EventEmitter:vF}=G("events"),{lsCacheSym:SF,levelValSym:EF,setLevelSym:du,getLevelSym:hb,chindingsSym:pu,parsedChindingsSym:AF,mixinSym:xF,asJsonSym:gb,writeSym:CF,mixinMergeStrategySym:RF,timeSym:TF,timeSliceIndexSym:IF,streamSym:yb,serializersSym:ir,formattersSym:hu,errorKeySym:PF,messageKeySym:OF,useOnlyCustomLevelsSym:MF,needsMetadataGsym:FF,redactFmtSym:NF,stringifySym:kF,formatOptsSym:$F,stringifiersSym:LF,msgPrefixSym:db}=Nr(),{getLevel:DF,setLevel:qF,isLevelEnabled:BF,mappings:UF,initialLsCache:HF,genLsCache:jF,assertNoLevelCollisions:WF}=Es(),{asChindings:wb,asJson:zF,buildFormatters:pb,stringify:mb}=Ss(),{version:GF}=fu(),VF=Vl(),KF=class{},bb={constructor:KF,child:ZF,bindings:YF,setBindings:JF,flush:tN,isLevelEnabled:BF,version:GF,get level(){return this[hb]()},set level(t){this[du](t);},get levelVal(){return this[EF]},set levelVal(t){throw Error("levelVal is read-only")},[SF]:HF,[CF]:QF,[gb]:zF,[hb]:DF,[du]:qF};Object.setPrototypeOf(bb,vF.prototype);vb.exports=function(){return Object.create(bb)};var _b=t=>t;function ZF(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[ir],n=this[hu],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[ir]=Object.create(null);for(let u in r)s[ir][u]=r[u];let c=Object.getOwnPropertySymbols(r);for(var i=0;i{var{hasOwnProperty:As}=Object.prototype,or=gu();or.configure=gu;or.stringify=or;or.default=or;yu.stringify=or;yu.configure=gu;Cb.exports=or;var rN=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Bt(t){return t.length<5e3&&!rN.test(t)?`"${t}"`:JSON.stringify(t)}function mu(t){if(t.length>200)return t.sort();for(let e=1;er;)t[n]=t[n-1],n--;t[n]=r;}return t}var nN=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function _u(t){return nN.call(t)!==void 0&&t.length!==0}function Eb(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function sr(t){return t===1?"1 item":`${t} items`}function sN(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function oN(t){if(As.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function gu(t){t={...t};let e=oN(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=iN(t),n=Ab(t,"bigint"),s=Ab(t,"deterministic"),i=xb(t,"maximumDepth"),o=xb(t,"maximumBreadth");function a(_,m,y,v,E,A){let w=m[_];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(_)),w=v.call(m,_,w),typeof w){case"string":return Bt(w);case"object":{if(w===null)return "null";if(y.indexOf(w)!==-1)return r;let x="",M=",",k=A;if(Array.isArray(w)){if(w.length===0)return "[]";if(io){let te=w.length-o-1;x+=`${M}"... ${sr(te)} not stringified"`;}return E!==""&&(x+=` +${k}`),y.pop(),`[${x}]`}let j=Object.keys(w),U=j.length;if(U===0)return "{}";if(io){let R=U-o;x+=`${F}"...":${$}"${sr(R)} not stringified"`,F=M;}return E!==""&&F.length>1&&(x=` +${A}${x} +${k}`),y.pop(),`{${x}}`}case"number":return isFinite(w)?String(w):e?e(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return e?e(w):void 0}}function c(_,m,y,v,E,A){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(_)),typeof m){case"string":return Bt(m);case"object":{if(m===null)return "null";if(y.indexOf(m)!==-1)return r;let w=A,x="",M=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let B=m.length-o-1;x+=`${M}"... ${sr(B)} not stringified"`;}return E!==""&&(x+=` +${w}`),y.pop(),`[${x}]`}y.push(m);let k="";E!==""&&(A+=E,M=`, +${A}`,k=" ");let j="";for(let U of v){let $=c(U,m[U],y,v,E,A);$!==void 0&&(x+=`${j}${Bt(U)}:${k}${$}`,j=M);}return E!==""&&j.length>1&&(x=` +${A}${x} +${w}`),y.pop(),`{${x}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function d(_,m,y,v,E){switch(typeof m){case"string":return Bt(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(_),typeof m!="object")return d(_,m,y,v,E);if(m===null)return "null"}if(y.indexOf(m)!==-1)return r;let A=E;if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let V=m.length-o-1;$+=`${F}"... ${sr(V)} not stringified"`;}return $+=` +${A}`,y.pop(),`[${$}]`}let w=Object.keys(m),x=w.length;if(x===0)return "{}";if(io){let $=x-o;k+=`${j}"...": "${sr($)} not stringified"`,j=M;}return j!==""&&(k=` +${E}${k} +${A}`),y.pop(),`{${k}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function u(_,m,y){switch(typeof m){case"string":return Bt(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(_),typeof m!="object")return u(_,m,y);if(m===null)return "null"}if(y.indexOf(m)!==-1)return r;let v="";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let U=m.length-o-1;v+=`,"... ${sr(U)} not stringified"`;}return y.pop(),`[${v}]`}let E=Object.keys(m),A=E.length;if(A===0)return "{}";if(io){let M=A-o;v+=`${w}"...":"${sr(M)} not stringified"`;}return y.pop(),`{${v}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function p(_,m,y){if(arguments.length>1){let v="";if(typeof y=="number"?v=" ".repeat(Math.min(y,10)):typeof y=="string"&&(v=y.slice(0,10)),m!=null){if(typeof m=="function")return a("",{"":_},[],m,v,"");if(Array.isArray(m))return c("",_,[],sN(m),v,"")}if(v.length!==0)return d("",_,[],v,"")}return u("",_,[])}return p}});var Pb=T((QL,Ib)=>{var wu=Symbol.for("pino.metadata"),{levels:Tb}=Es(),aN=Tb.info;function lN(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(Tb);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(u=>{n[u]=e.levels[u];});let s={write:i,add:a,flushSync:o,end:c,minLevel:0,streams:[],clone:d,[wu]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(a,s):a.call(s,t),t=null,s;function i(u){let p,_=this.lastLevel,{streams:m}=this,y=0,v;for(let E=cN(m.length,e.dedupe);hN(E,m.length,e.dedupe);E=fN(E,e.dedupe))if(p=m[E],p.level<=_){if(y!==0&&y!==p.level)break;if(v=p.stream,v[wu]){let{lastTime:A,lastMsg:w,lastObj:x,lastLogger:M}=this;v.lastLevel=_,v.lastTime=A,v.lastMsg=w,v.lastObj=x,v.lastLogger=M;}v.write(u),e.dedupe&&(y=p.level);}else if(!e.dedupe)break}function o(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function a(u){if(!u)return s;let p=typeof u.write=="function"||u.stream,_=u.write?u:u.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:y}=this,v;typeof u.levelVal=="number"?v=u.levelVal:typeof u.level=="string"?v=y[u.level]:typeof u.level=="number"?v=u.level:v=aN;let E={stream:_,level:v,levelVal:void 0,id:r++};return m.unshift(E),m.sort(uN),this.minLevel=m[0].level,s}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function d(u){let p=new Array(this.streams.length);for(let _=0;_=0:t{var dN=G("os"),Db=ql(),pN=Bl(),mN=Vl(),qb=Rw(),_N=Sb(),Bb=Nr(),{configure:gN}=Rb(),{assertDefaultLevelFound:yN,mappings:Ub,genLsCache:wN,levels:bN}=Es(),{createArgsNormalizer:vN,asChindings:SN,buildSafeSonicBoom:Ob,buildFormatters:EN,stringify:bu,normalizeDestFileDescriptor:Mb,noop:AN}=Ss(),{version:xN}=fu(),{chindingsSym:Fb,redactFmtSym:CN,serializersSym:Nb,timeSym:RN,timeSliceIndexSym:TN,streamSym:IN,stringifySym:kb,stringifySafeSym:vu,stringifiersSym:$b,setLevelSym:PN,endSym:ON,formatOptsSym:MN,messageKeySym:FN,errorKeySym:NN,nestedKeySym:kN,mixinSym:$N,useOnlyCustomLevelsSym:LN,formattersSym:Lb,hooksSym:DN,nestedKeyStrSym:qN,mixinMergeStrategySym:BN,msgPrefixSym:UN}=Bb,{epochTime:Hb,nullTime:HN}=qb,{pid:jN}=process,WN=dN.hostname(),zN=Db.err,GN={level:"info",levels:bN,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:jN,hostname:WN},serializers:Object.assign(Object.create(null),{err:zN}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:Hb,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},VN=vN(GN),KN=Object.assign(Object.create(null),Db);function Su(...t){let e={},{opts:r,stream:n}=VN(e,pN(),...t),{redact:s,crlf:i,serializers:o,timestamp:a,messageKey:c,errorKey:d,nestedKey:u,base:p,name:_,level:m,customLevels:y,mixin:v,mixinMergeStrategy:E,useOnlyCustomLevels:A,formatters:w,hooks:x,depthLimit:M,edgeLimit:k,onChild:j,msgPrefix:U}=r,$=gN({maximumDepth:M,maximumBreadth:k}),F=EN(w.level,w.bindings,w.log),B=bu.bind({[vu]:$}),R=s?mN(s,B):{},z=s?{stringify:R[CN]}:{stringify:B},V="}"+(i?`\r `:` -`),se=rI.bind(null,{[$w]:"",[Iw]:o,[Lw]:C,[kw]:du,[gu]:q,[Fw]:k}),T="";g!==null&&(y===void 0?T=se(g):T=se(Object.assign({},g,{name:y})));let $=l instanceof Function?l:l?jw:EI,te=$().indexOf(":")+1;if(x&&!v)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(b&&typeof b!="function")throw Error(`Unknown mixin type "${typeof b}" - expected "function"`);if(H&&typeof H!="string")throw Error(`Unknown msgPrefix type "${typeof H}" - expected "string"`);Q$(m,v,x);let Q=Mw(v,x);return Object.assign(e,{levels:Q,[mI]:x,[uI]:n,[aI]:$,[lI]:te,[kw]:du,[gu]:q,[Lw]:C,[fI]:Y,[hI]:V,[pI]:c,[dI]:p,[gI]:u,[wI]:u?`,${JSON.stringify(u)}:{`:"",[Iw]:o,[yI]:b,[SI]:_,[$w]:T,[Fw]:k,[vI]:O,silent:iI,onChild:U,[bI]:H}),Object.setPrototypeOf(e,J$()),Z$(e),e[cI](m),e}vt.exports=yu;vt.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Tw(t.dest||process.stdout.fd),Pw(t)):Pw({dest:Tw(t),minLength:0});vt.exports.transport=Zl();vt.exports.multistream=Ow();vt.exports.levels=Mw();vt.exports.stdSerializers=OI;vt.exports.stdTimeFunctions=Object.assign({},Dw);vt.exports.symbols=Nw;vt.exports.version=sI;vt.exports.default=yu;vt.exports.pino=yu;});var Vw={};Wo(Vw,{RotatingFileStream:()=>eo,RotatingFileStreamError:()=>ai,createStream:()=>KI});async function Uw(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function Ww(t){return (e,r,n)=>{let s=parseInt(n,10);if(e!=="number"||s!==n||s<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function vu(t,e){return (r,n,s)=>{if(r!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${r}`);n[t]=e(s);}}function Kw(t,e,r){let n={};if(n.num=parseInt(t,10),isNaN(n.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(n.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(n.unit=t.replace(/^[ 0]*/g,"").substr((n.num+"").length,1),n.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!r[n.unit])throw new Error(`Unknown 'options.${e}' unit: ${n.unit}`);return n}function wu(t,e,r){if(parseInt(r/t.num,10)*t.num!==r)throw new Error(`An integer divider of ${r} is expected as ${e} for 'options.interval'`)}function HI(t){let e=Kw(t,"interval",BI);switch(e.unit){case"h":wu(e,"hours",24);break;case"m":wu(e,"minutes",60);break;case"s":wu(e,"seconds",60);break}return e}function zw(t){let e=Kw(t,"size",UI);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function WI(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in Gw))throw new Error(`Unknown option: ${r}`);e[r]=t[r],Gw[r](s,e,n);}return e.path||(e.path=""),e.interval||(delete e.immutable,delete e.initialRotation,delete e.intervalBoundary),e.rotate&&(delete e.history,delete e.immutable,delete e.maxFiles,delete e.maxSize,delete e.intervalBoundary),e.immutable&&delete e.compress,e.intervalBoundary||delete e.initialRotation,e}function zI(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function GI(t,e,r){let n=s=>(s>9?"":"0")+s;return (s,i)=>{if(!s)return t;let o=s.getFullYear()+""+n(s.getMonth()+1),l=n(s.getDate()),c=n(s.getHours()),p=n(s.getMinutes());return o+l+"-"+c+p+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function KI(t,e){if(typeof e>"u")e={};else if(typeof e!="object")throw new Error(`The "options" argument must be of type object. Received type ${typeof e}`);let r=WI(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?zI(t,n!==void 0,s):GI(t,n!==void 0,s);else if(typeof t=="function")i=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new eo(i,r)}var ai,eo,BI,UI,Gw,Yw=qi(()=>{ai=class extends Error{constructor(){super("Too many destination file attempts");ne(this,"code","RFS-TOO-MANY");}},eo=class extends stream.Writable{constructor(r,n){let{encoding:s,history:i,maxFiles:o,maxSize:l,path:c}=n;super({decodeStrings:!0,defaultEncoding:s});ne(this,"createGzip");ne(this,"exec");ne(this,"file");ne(this,"filename");ne(this,"finished");ne(this,"fsCreateReadStream");ne(this,"fsCreateWriteStream");ne(this,"fsOpen");ne(this,"fsReadFile");ne(this,"fsStat");ne(this,"fsUnlink");ne(this,"generator");ne(this,"initPromise");ne(this,"last");ne(this,"maxTimeout");ne(this,"next");ne(this,"options");ne(this,"prev");ne(this,"rotation");ne(this,"size");ne(this,"stdout");ne(this,"timeout");ne(this,"timeoutPromise");this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=c+r(null),this.fsCreateReadStream=fs.createReadStream,this.fsCreateWriteStream=fs.createWriteStream,this.fsOpen=promises.open,this.fsReadFile=promises.readFile,this.fsStat=promises.stat,this.fsUnlink=promises.unlink,this.generator=r,this.maxTimeout=2147483640,this.options=n,this.stdout=process.stdout,(o||l)&&(n.history=c+(i||this.generator(null)+".txt")),this.on("close",()=>this.finished?null:this.emit("finish")),this.on("finish",()=>this.finished=this.clear()),(async()=>{try{this.initPromise=this.init(),await this.initPromise,delete this.initPromise;}catch{}})();}_destroy(r,n){this.refinal(r,n);}_final(r){this.refinal(void 0,r);}_write(r,n,s){this.rewrite([{chunk:r,encoding:n}],0,s);}_writev(r,n){this.rewrite(r,0,n);}async refinal(r,n){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(s){return n(r||s)}n(r);}async rewrite(r,n,s){let{size:i,teeToStdout:o}=this.options;try{this.initPromise&&await this.initPromise;for(let l=0;l=i&&await this.rotate();}}catch(l){return s(l)}s();}async init(){let{immutable:r,initialRotation:n,interval:s,size:i}=this.options;if(r)return new Promise((l,c)=>process.nextTick(()=>this.immutate(!0).then(l).catch(c)));let o;try{o=await promises.stat(this.filename);}catch(l){if(l.code!=="ENOENT")throw l;return this.reopen(0)}if(!o.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(n){this.intervalBounds(this.now());let l=this.prev;if(this.intervalBounds(new Date(o.mtime.getTime())),l!==this.prev)return this.rotate()}return this.size=o.size,!i||o.size0;--o){let l=n+this.generator(o),c=o===1?this.filename:n+this.generator(o-1);if(await Uw(c))if(i||(i=l),o===1&&r)await this.compress(l);else try{await promises.rename(c,l);}catch(p){if(p.code!=="ENOENT")throw p;await this.makePath(l),await promises.rename(c,l);}}return this.rotated(i)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(r){let n=r.getFullYear(),s=r.getMonth(),i=r.getDate(),o=r.getHours(),{num:l,unit:c}=this.options.interval;c==="M"?(i=1,o=0):c==="d"?o=0:o=parseInt(o/l,10)*l,this.prev=new Date(n,s,i,o,0,0,0).getTime(),c==="M"?s+=l:c==="d"?i+=l:o+=l,this.next=new Date(n,s,i,o,0,0,0).getTime();}intervalBounds(r){let n=this.options.interval.unit;if(n==="M"||n==="d"||n==="h")this.intervalBoundsBig(r);else {let s=1e3*this.options.interval.num;n==="m"&&(s*=60),this.prev=parseInt(r.getTime()/s,10)*s,this.next=this.prev+s;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let r=async()=>{let n=this.next-this.now().getTime();if(n<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(r,n>this.maxTimeout?this.maxTimeout:n),this.timeout.unref();};r();}async compress(r){let{compress:n}=this.options;return typeof n=="function"?await new Promise((s,i)=>{this.exec(n(this.filename,r),(o,l,c)=>{this.emit("external",l,c),o?i(o):s();});}):await this.gzip(r),this.unlink(this.filename)}async gzip(r){let{mode:n}=this.options,s=n?{mode:n}:{},i=this.fsCreateReadStream(this.filename,{}),o=this.fsCreateWriteStream(r,s),l=this.createGzip();return new Promise((c,p)=>{[i,o,l].map(u=>u.once("error",p)),o.once("finish",c),i.pipe(l).pipe(o);})}async rotated(r){let{maxFiles:n,maxSize:s}=this.options;return (n||s)&&await this.history(r),this.emit("rotated",r),this.reopen(0)}async history(r){let{history:n,maxFiles:s,maxSize:i}=this.options,o=[],l=[r];try{l=[...(await this.fsReadFile(n,"utf8")).toString().split(` -`),r];}catch(c){if(c.code!=="ENOENT")throw c}for(let c of l)if(c)try{let p=await this.fsStat(c);p.isFile()?o.push({name:c,size:p.size,time:p.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`));}catch(p){if(p.code!=="ENOENT")throw p}if(o.sort((c,p)=>c.time-p.time),s)for(;o.length>s;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!0);}if(i)for(;o.reduce((c,p)=>c+p.size,0)>i;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!1);}await promises.writeFile(n,o.map(c=>c.name).join(` +`),te=SN.bind(null,{[Fb]:"",[Nb]:o,[$b]:R,[kb]:bu,[vu]:$,[Lb]:F}),I="";p!==null&&(_===void 0?I=te(p):I=te(Object.assign({},p,{name:_})));let O=a instanceof Function?a:a?Hb:HN,X=O().indexOf(":")+1;if(A&&!y)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(v&&typeof v!="function")throw Error(`Unknown mixin type "${typeof v}" - expected "function"`);if(U&&typeof U!="string")throw Error(`Unknown msgPrefix type "${typeof U}" - expected "string"`);yN(m,y,A);let Q=Ub(y,A);return Object.assign(e,{levels:Q,[LN]:A,[IN]:n,[RN]:O,[TN]:X,[kb]:bu,[vu]:$,[$b]:R,[ON]:V,[MN]:z,[FN]:c,[NN]:d,[kN]:u,[qN]:u?`,${JSON.stringify(u)}:{`:"",[Nb]:o,[$N]:v,[BN]:E,[Fb]:I,[Lb]:F,[DN]:x,silent:AN,onChild:j,[UN]:U}),Object.setPrototypeOf(e,_N()),wN(e),e[PN](m),e}rt.exports=Su;rt.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Mb(t.dest||process.stdout.fd),Ob(t)):Ob({dest:Mb(t),minLength:0});rt.exports.transport=su();rt.exports.multistream=Pb();rt.exports.levels=Ub();rt.exports.stdSerializers=KN;rt.exports.stdTimeFunctions=Object.assign({},qb);rt.exports.symbols=Bb;rt.exports.version=xN;rt.exports.default=Su;rt.exports.pino=Su;});var Yb={};Js(Yb,{RotatingFileStream:()=>Rs,RotatingFileStreamError:()=>Pn,createStream:()=>dk});async function zb(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function Gb(t){return (e,r,n)=>{let s=parseInt(n,10);if(e!=="number"||s!==n||s<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function Au(t,e){return (r,n,s)=>{if(r!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${r}`);n[t]=e(s);}}function Zb(t,e,r){let n={};if(n.num=parseInt(t,10),isNaN(n.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(n.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(n.unit=t.replace(/^[ 0]*/g,"").substr((n.num+"").length,1),n.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!r[n.unit])throw new Error(`Unknown 'options.${e}' unit: ${n.unit}`);return n}function xu(t,e,r){if(parseInt(r/t.num,10)*t.num!==r)throw new Error(`An integer divider of ${r} is expected as ${e} for 'options.interval'`)}function lk(t){let e=Zb(t,"interval",ak);switch(e.unit){case"h":xu(e,"hours",24);break;case"m":xu(e,"minutes",60);break;case"s":xu(e,"seconds",60);break}return e}function Vb(t){let e=Zb(t,"size",uk);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function ck(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in Kb))throw new Error(`Unknown option: ${r}`);e[r]=t[r],Kb[r](s,e,n);}return e.path||(e.path=""),e.interval||(delete e.immutable,delete e.initialRotation,delete e.intervalBoundary),e.rotate&&(delete e.history,delete e.immutable,delete e.maxFiles,delete e.maxSize,delete e.intervalBoundary),e.immutable&&delete e.compress,e.intervalBoundary||delete e.initialRotation,e}function fk(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function hk(t,e,r){let n=s=>(s>9?"":"0")+s;return (s,i)=>{if(!s)return t;let o=s.getFullYear()+""+n(s.getMonth()+1),a=n(s.getDate()),c=n(s.getHours()),d=n(s.getMinutes());return o+a+"-"+c+d+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function dk(t,e){if(typeof e>"u")e={};else if(typeof e!="object")throw new Error(`The "options" argument must be of type object. Received type ${typeof e}`);let r=ck(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?fk(t,n!==void 0,s):hk(t,n!==void 0,s);else if(typeof t=="function")i=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new Rs(i,r)}var Pn,Rs,ak,uk,Kb,Jb=jn(()=>{Pn=class extends Error{code="RFS-TOO-MANY";constructor(){super("Too many destination file attempts");}},Rs=class extends stream.Writable{createGzip;exec;file;filename;finished;fsCreateReadStream;fsCreateWriteStream;fsOpen;fsReadFile;fsStat;fsUnlink;generator;initPromise;last;maxTimeout;next;options;prev;rotation;size;stdout;timeout;timeoutPromise;constructor(e,r){let{encoding:n,history:s,maxFiles:i,maxSize:o,path:a}=r;super({decodeStrings:!0,defaultEncoding:n}),this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=a+e(null),this.fsCreateReadStream=fs.createReadStream,this.fsCreateWriteStream=fs.createWriteStream,this.fsOpen=promises.open,this.fsReadFile=promises.readFile,this.fsStat=promises.stat,this.fsUnlink=promises.unlink,this.generator=e,this.maxTimeout=2147483640,this.options=r,this.stdout=process.stdout,(i||o)&&(r.history=a+(s||this.generator(null)+".txt")),this.on("close",()=>this.finished?null:this.emit("finish")),this.on("finish",()=>this.finished=this.clear()),(async()=>{try{this.initPromise=this.init(),await this.initPromise,delete this.initPromise;}catch{}})();}_destroy(e,r){this.refinal(e,r);}_final(e){this.refinal(void 0,e);}_write(e,r,n){this.rewrite([{chunk:e,encoding:r}],0,n);}_writev(e,r){this.rewrite(e,0,r);}async refinal(e,r){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(n){return r(e||n)}r(e);}async rewrite(e,r,n){let{size:s,teeToStdout:i}=this.options;try{this.initPromise&&await this.initPromise;for(let o=0;o=s&&await this.rotate();}}catch(o){return n(o)}n();}async init(){let{immutable:e,initialRotation:r,interval:n,size:s}=this.options;if(e)return new Promise((o,a)=>process.nextTick(()=>this.immutate(!0).then(o).catch(a)));let i;try{i=await promises.stat(this.filename);}catch(o){if(o.code!=="ENOENT")throw o;return this.reopen(0)}if(!i.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(r){this.intervalBounds(this.now());let o=this.prev;if(this.intervalBounds(new Date(i.mtime.getTime())),o!==this.prev)return this.rotate()}return this.size=i.size,!s||i.size0;--i){let o=r+this.generator(i),a=i===1?this.filename:r+this.generator(i-1);if(await zb(a))if(s||(s=o),i===1&&e)await this.compress(o);else try{await promises.rename(a,o);}catch(c){if(c.code!=="ENOENT")throw c;await this.makePath(o),await promises.rename(a,o);}}return this.rotated(s)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(e){let r=e.getFullYear(),n=e.getMonth(),s=e.getDate(),i=e.getHours(),{num:o,unit:a}=this.options.interval;a==="M"?(s=1,i=0):a==="d"?i=0:i=parseInt(i/o,10)*o,this.prev=new Date(r,n,s,i,0,0,0).getTime(),a==="M"?n+=o:a==="d"?s+=o:i+=o,this.next=new Date(r,n,s,i,0,0,0).getTime();}intervalBounds(e){let r=this.options.interval.unit;if(r==="M"||r==="d"||r==="h")this.intervalBoundsBig(e);else {let n=1e3*this.options.interval.num;r==="m"&&(n*=60),this.prev=parseInt(e.getTime()/n,10)*n,this.next=this.prev+n;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let e=async()=>{let r=this.next-this.now().getTime();if(r<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(e,r>this.maxTimeout?this.maxTimeout:r),this.timeout.unref();};e();}async compress(e){let{compress:r}=this.options;return typeof r=="function"?await new Promise((n,s)=>{this.exec(r(this.filename,e),(i,o,a)=>{this.emit("external",o,a),i?s(i):n();});}):await this.gzip(e),this.unlink(this.filename)}async gzip(e){let{mode:r}=this.options,n=r?{mode:r}:{},s=this.fsCreateReadStream(this.filename,{}),i=this.fsCreateWriteStream(e,n),o=this.createGzip();return new Promise((a,c)=>{[s,i,o].map(d=>d.once("error",c)),i.once("finish",a),s.pipe(o).pipe(i);})}async rotated(e){let{maxFiles:r,maxSize:n}=this.options;return (r||n)&&await this.history(e),this.emit("rotated",e),this.reopen(0)}async history(e){let{history:r,maxFiles:n,maxSize:s}=this.options,i=[],o=[e];try{o=[...(await this.fsReadFile(r,"utf8")).toString().split(` +`),e];}catch(a){if(a.code!=="ENOENT")throw a}for(let a of o)if(a)try{let c=await this.fsStat(a);c.isFile()?i.push({name:a,size:c.size,time:c.ctime.getTime()}):this.emit("warning",new Error(`File '${a}' contained in history is not a regular file`));}catch(c){if(c.code!=="ENOENT")throw c}if(i.sort((a,c)=>a.time-c.time),n)for(;i.length>n;){let a=i.shift();await this.unlink(a.name),this.emit("removed",a.name,!0);}if(s)for(;i.reduce((a,c)=>a+c.size,0)>s;){let a=i.shift();await this.unlink(a.name),this.emit("removed",a.name,!1);}await promises.writeFile(r,i.map(a=>a.name).join(` `)+` -`,"utf-8"),this.emit("history");}async immutate(r){let{size:n}=this.options,s=this.now();for(let i=1;i<1e3;++i){let o=0,l;this.filename=this.options.path+this.generator(s,i);try{l=await this.fsStat(this.filename);}catch(c){if(c.code!=="ENOENT")throw c}if(l){if(o=l.size,!l.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(n&&o>=n)continue}if(r)return this.last=this.filename,this.reopen(o);await this.rotated(this.last),this.last=this.filename;return}throw new ai}async unlink(r){try{await this.fsUnlink(r);}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n);}}};BI={M:!0,d:!0,h:!0,m:!0,s:!0};UI={B:!0,G:!0,K:!0,M:!0};Gw={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:vu("interval",HI),intervalBoundary:()=>{},maxFiles:Ww("maxFiles"),maxSize:vu("maxSize",zw),mode:()=>{},omitExtension:()=>{},rotate:Ww("rotate"),size:vu("size",zw),teeToStdout:()=>{},compress:(t,e,r)=>{if(!r)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(n,s)=>`cat ${n} | gzip -c9 > ${s}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(r!=="gzip")throw new Error(`Don't know how to handle compression method: ${r}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,r)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);r[r.length-1]!==path.sep&&(e.path=r+path.sep);}};});var Zw={};Wo(Zw,{allLoggers:()=>gn,rootLogger:()=>Ce});var to,Jw,Xw,Ce,gn,Nt=qi(()=>{to=Nn(Bw());Jn();Jw=(Yw(),zo(Vw)).createStream("tabby-agent.log",{path:z("path").join(z("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Xw={serializers:{error:to.default.stdSerializers.err}},Ce=Jw?(0, to.default)(Xw,Jw):(0, to.default)(Xw);Ce.level="silent";gn=[Ce];Ce.onChild=t=>{gn.push(t);};});var tS=R((OM,eS)=>{eS.exports=function(){function t(n,s){function i(){this.constructor=n;}i.prototype=s.prototype,n.prototype=new i;}function e(n,s,i,o,l,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=l,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:sf},l=sf,p=function(){return _f},u=i,g="#",y={type:"literal",value:"#",description:'"#"'},m=void 0,v={type:"any",description:"any character"},b="[",_={type:"literal",value:"[",description:'"["'},x="]",A={type:"literal",value:"]",description:'"]"'},O=function(a){Ho(je("ObjectPath",a,Ne,Me));},I=function(a){Ho(je("ArrayPath",a,Ne,Me));},F=function(a,h){return a.concat(h)},U=function(a){return [a]},H=function(a){return a},q=".",k={type:"literal",value:".",description:'"."'},j="=",C={type:"literal",value:"=",description:'"="'},V=function(a,h){Ho(je("Assign",h,Ne,Me,a));},Y=function(a){return a.join("")},se=function(a){return a.value},T='"""',$={type:"literal",value:'"""',description:'"\\"\\"\\""'},te=null,Q=function(a){return je("String",a.join(""),Ne,Me)},ue='"',Ge={type:"literal",value:'"',description:'"\\""'},Oe="'''",Qt={type:"literal",value:"'''",description:`"'''"`},Pn="'",Zt={type:"literal",value:"'",description:`"'"`},St=function(a){return a},ce=function(a){return a},zr="\\",Fo={type:"literal",value:"\\",description:'"\\\\"'},K=function(){return ""},me="e",W={type:"literal",value:"e",description:'"e"'},le="E",we={type:"literal",value:"E",description:'"E"'},De=function(a,h){return je("Float",parseFloat(a+"e"+h),Ne,Me)},_e=function(a){return je("Float",parseFloat(a),Ne,Me)},Er="+",er={type:"literal",value:"+",description:'"+"'},Fc=function(a){return a.join("")},Tn="-",$n={type:"literal",value:"-",description:'"-"'},qc=function(a){return "-"+a.join("")},$0=function(a){return je("Integer",parseInt(a,10),Ne,Me)},Dc="true",I0={type:"literal",value:"true",description:'"true"'},k0=function(){return je("Boolean",!0,Ne,Me)},Nc="false",L0={type:"literal",value:"false",description:'"false"'},F0=function(){return je("Boolean",!1,Ne,Me)},q0=function(){return je("Array",[],Ne,Me)},D0=function(a){return je("Array",a?[a]:[],Ne,Me)},N0=function(a){return je("Array",a,Ne,Me)},M0=function(a,h){return je("Array",a.concat(h),Ne,Me)},Mc=function(a){return a},jc=",",Bc={type:"literal",value:",",description:'","'},j0="{",B0={type:"literal",value:"{",description:'"{"'},H0="}",U0={type:"literal",value:"}",description:'"}"'},W0=function(a){return je("InlineTable",a,Ne,Me)},Hc=function(a,h){return je("InlineTableValue",h,Ne,Me,a)},z0=function(a){return "."+a},G0=function(a){return a.join("")},In=":",kn={type:"literal",value:":",description:'":"'},Uc=function(a){return a.join("")},Wc="T",zc={type:"literal",value:"T",description:'"T"'},K0="Z",V0={type:"literal",value:"Z",description:'"Z"'},Y0=function(a,h){return je("Date",new Date(a+"T"+h+"Z"),Ne,Me)},J0=function(a,h){return je("Date",new Date(a+"T"+h),Ne,Me)},X0=/^[ \t]/,Q0={type:"class",value:"[ \\t]",description:"[ \\t]"},Gc=` -`,Kc={type:"literal",value:` -`,description:'"\\n"'},Z0="\r",eE={type:"literal",value:"\r",description:'"\\r"'},tE=/^[0-9a-f]/i,rE={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},nE=/^[0-9]/,iE={type:"class",value:"[0-9]",description:"[0-9]"},sE="_",oE={type:"literal",value:"_",description:'"_"'},aE=function(){return ""},lE=/^[A-Za-z0-9_\-]/,uE={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},cE=function(a){return a.join("")},Vc='\\"',fE={type:"literal",value:'\\"',description:'"\\\\\\""'},hE=function(){return '"'},Yc="\\\\",pE={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},dE=function(){return "\\"},Jc="\\b",gE={type:"literal",value:"\\b",description:'"\\\\b"'},yE=function(){return "\b"},Xc="\\t",mE={type:"literal",value:"\\t",description:'"\\\\t"'},vE=function(){return " "},Qc="\\n",wE={type:"literal",value:"\\n",description:'"\\\\n"'},SE=function(){return ` -`},Zc="\\f",bE={type:"literal",value:"\\f",description:'"\\\\f"'},EE=function(){return "\f"},ef="\\r",AE={type:"literal",value:"\\r",description:'"\\\\r"'},_E=function(){return "\r"},tf="\\U",xE={type:"literal",value:"\\U",description:'"\\\\U"'},rf=function(a){return zE(a.join(""))},nf="\\u",CE={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,J=0,Ln=0,qo={line:1,column:1,seenCR:!1},$i=0,Do=[],N=0,M={},Ii;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');l=o[s.startRule];}function Ne(){return No(J).line}function Me(){return No(J).column}function No(a){function h(d,w,E){var P,L;for(P=w;Pa&&(Ln=0,qo={line:1,column:1,seenCR:!1}),h(qo,Ln,a),Ln=a),qo}function B(a){f<$i||(f>$i&&($i=f,Do=[]),Do.push(a));}function Mo(a,h,d){function w(G){var ie=1;for(G.sort(function(de,he){return de.descriptionhe.description?1:0});ie1?he.slice(0,-1).join(", ")+" or "+he[G.length-1]:he[0],xe=ie?'"'+de(ie)+'"':"end of input","Expected "+Ee+" but "+xe+" found."}var P=No(d),L=df?(P=n.charAt(f),f++):(P=i,N===0&&B(v)),P!==i?(E=[E,P],w=E):(f=w,w=u)):(f=w,w=u);w!==i;)d.push(w),w=f,E=f,N++,P=gt(),P===i&&(P=Fi()),N--,P===i?E=m:(f=E,E=u),E!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,N===0&&B(v)),P!==i?(E=[E,P],w=E):(f=w,w=u)):(f=w,w=u);d!==i?(h=[h,d],a=h):(f=a,a=u);}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function OE(){var a,h,d,w,E,P,L=f*49+4,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(w=af(),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(n.charCodeAt(f)===93?(P=x,f++):(P=i,N===0&&B(A)),P!==i?(J=a,h=O(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function PE(){var a,h,d,w,E,P,L,G,ie=f*49+5,de=M[ie];if(de)return f=de.nextPos,de.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i)if(n.charCodeAt(f)===91?(d=b,f++):(d=i,N===0&&B(_)),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(E=af(),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(n.charCodeAt(f)===93?(L=x,f++):(L=i,N===0&&B(A)),L!==i?(n.charCodeAt(f)===93?(G=x,f++):(G=i,N===0&&B(A)),G!==i?(J=a,h=I(E),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;return M[ie]={nextPos:f,result:a},a}function af(){var a,h,d,w=f*49+6,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=uf(),d!==i)for(;d!==i;)h.push(d),d=uf();else h=u;return h!==i?(d=lf(),d!==i?(J=a,h=F(h,d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=lf(),h!==i&&(J=a,h=U(h)),a=h),M[w]={nextPos:f,result:a},a}function lf(){var a,h,d,w,E,P=f*49+7,L=M[P];if(L)return f=L.nextPos,L.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();w!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=jo(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();w!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}return M[P]={nextPos:f,result:a},a}function uf(){var a,h,d,w,E,P,L,G=f*49+8,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=jo(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}return M[G]={nextPos:f,result:a},a}function TE(){var a,h,d,w,E,P,L=f*49+9,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,h=Fn(),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(n.charCodeAt(f)===61?(w=j,f++):(w=i,N===0&&B(C)),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(P=Gr(),P!==i?(J=a,h=V(h,P),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;if(a===i)if(a=f,h=jo(),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(n.charCodeAt(f)===61?(w=j,f++):(w=i,N===0&&B(C)),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(P=Gr(),P!==i?(J=a,h=V(h,P),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function Fn(){var a,h,d,w=f*49+10,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=Ef(),d!==i)for(;d!==i;)h.push(d),d=Ef();else h=u;return h!==i&&(J=a,h=Y(h)),a=h,M[w]={nextPos:f,result:a},a}function jo(){var a,h,d=f*49+11,w=M[d];return w?(f=w.nextPos,w.result):(a=f,h=cf(),h!==i&&(J=a,h=se(h)),a=h,a===i&&(a=f,h=ff(),h!==i&&(J=a,h=se(h)),a=h),M[d]={nextPos:f,result:a},a)}function Gr(){var a,h=f*49+12,d=M[h];return d?(f=d.nextPos,d.result):(a=$E(),a===i&&(a=HE(),a===i&&(a=FE(),a===i&&(a=qE(),a===i&&(a=DE(),a===i&&(a=NE(),a===i&&(a=ME())))))),M[h]={nextPos:f,result:a},a)}function $E(){var a,h=f*49+13,d=M[h];return d?(f=d.nextPos,d.result):(a=IE(),a===i&&(a=cf(),a===i&&(a=kE(),a===i&&(a=ff()))),M[h]={nextPos:f,result:a},a)}function IE(){var a,h,d,w,E,P=f*49+14,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===T?(h=T,f+=3):(h=i,N===0&&B($)),h!==i)if(d=gt(),d===i&&(d=te),d!==i){for(w=[],E=df();E!==i;)w.push(E),E=df();w!==i?(n.substr(f,3)===T?(E=T,f+=3):(E=i,N===0&&B($)),E!==i?(J=a,h=Q(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function cf(){var a,h,d,w,E=f*49+15,P=M[E];if(P)return f=P.nextPos,P.result;if(a=f,n.charCodeAt(f)===34?(h=ue,f++):(h=i,N===0&&B(Ge)),h!==i){for(d=[],w=hf();w!==i;)d.push(w),w=hf();d!==i?(n.charCodeAt(f)===34?(w=ue,f++):(w=i,N===0&&B(Ge)),w!==i?(J=a,h=Q(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[E]={nextPos:f,result:a},a}function kE(){var a,h,d,w,E,P=f*49+16,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===Oe?(h=Oe,f+=3):(h=i,N===0&&B(Qt)),h!==i)if(d=gt(),d===i&&(d=te),d!==i){for(w=[],E=gf();E!==i;)w.push(E),E=gf();w!==i?(n.substr(f,3)===Oe?(E=Oe,f+=3):(E=i,N===0&&B(Qt)),E!==i?(J=a,h=Q(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function ff(){var a,h,d,w,E=f*49+17,P=M[E];if(P)return f=P.nextPos,P.result;if(a=f,n.charCodeAt(f)===39?(h=Pn,f++):(h=i,N===0&&B(Zt)),h!==i){for(d=[],w=pf();w!==i;)d.push(w),w=pf();d!==i?(n.charCodeAt(f)===39?(w=Pn,f++):(w=i,N===0&&B(Zt)),w!==i?(J=a,h=Q(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[E]={nextPos:f,result:a},a}function hf(){var a,h,d,w=f*49+18,E=M[w];return E?(f=E.nextPos,E.result):(a=Af(),a===i&&(a=f,h=f,N++,n.charCodeAt(f)===34?(d=ue,f++):(d=i,N===0&&B(Ge)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u)),M[w]={nextPos:f,result:a},a)}function pf(){var a,h,d,w=f*49+19,E=M[w];return E?(f=E.nextPos,E.result):(a=f,h=f,N++,n.charCodeAt(f)===39?(d=Pn,f++):(d=i,N===0&&B(Zt)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function df(){var a,h,d,w=f*49+20,E=M[w];return E?(f=E.nextPos,E.result):(a=Af(),a===i&&(a=LE(),a===i&&(a=f,h=f,N++,n.substr(f,3)===T?(d=T,f+=3):(d=i,N===0&&B($)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=ce(d),a=h):(f=a,a=u)):(f=a,a=u))),M[w]={nextPos:f,result:a},a)}function LE(){var a,h,d,w,E,P=f*49+21,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===92?(h=zr,f++):(h=i,N===0&&B(Fo)),h!==i)if(d=gt(),d!==i){for(w=[],E=bf();E!==i;)w.push(E),E=bf();w!==i?(J=a,h=K(),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function gf(){var a,h,d,w=f*49+22,E=M[w];return E?(f=E.nextPos,E.result):(a=f,h=f,N++,n.substr(f,3)===Oe?(d=Oe,f+=3):(d=i,N===0&&B(Qt)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function FE(){var a,h,d,w,E=f*49+23,P=M[E];return P?(f=P.nextPos,P.result):(a=f,h=yf(),h===i&&(h=Bo()),h!==i?(n.charCodeAt(f)===101?(d=me,f++):(d=i,N===0&&B(W)),d===i&&(n.charCodeAt(f)===69?(d=le,f++):(d=i,N===0&&B(we))),d!==i?(w=Bo(),w!==i?(J=a,h=De(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=yf(),h!==i&&(J=a,h=_e(h)),a=h),M[E]={nextPos:f,result:a},a)}function yf(){var a,h,d,w,E,P,L=f*49+24,G=M[L];return G?(f=G.nextPos,G.result):(a=f,n.charCodeAt(f)===43?(h=Er,f++):(h=i,N===0&&B(er)),h===i&&(h=te),h!==i?(d=f,w=qn(),w!==i?(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i?(P=qn(),P!==i?(w=[w,E,P],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=Fc(d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,n.charCodeAt(f)===45?(h=Tn,f++):(h=i,N===0&&B($n)),h!==i?(d=f,w=qn(),w!==i?(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i?(P=qn(),P!==i?(w=[w,E,P],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=qc(d),a=h):(f=a,a=u)):(f=a,a=u)),M[L]={nextPos:f,result:a},a)}function qE(){var a,h,d=f*49+25,w=M[d];return w?(f=w.nextPos,w.result):(a=f,h=Bo(),h!==i&&(J=a,h=$0(h)),a=h,M[d]={nextPos:f,result:a},a)}function Bo(){var a,h,d,w,E,P=f*49+26,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===43?(h=Er,f++):(h=i,N===0&&B(er)),h===i&&(h=te),h!==i){if(d=[],w=pe(),w!==i)for(;w!==i;)d.push(w),w=pe();else d=u;d!==i?(w=f,N++,n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),N--,E===i?w=m:(f=w,w=u),w!==i?(J=a,h=Fc(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i)if(a=f,n.charCodeAt(f)===45?(h=Tn,f++):(h=i,N===0&&B($n)),h!==i){if(d=[],w=pe(),w!==i)for(;w!==i;)d.push(w),w=pe();else d=u;d!==i?(w=f,N++,n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),N--,E===i?w=m:(f=w,w=u),w!==i?(J=a,h=qc(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[P]={nextPos:f,result:a},a}function DE(){var a,h,d=f*49+27,w=M[d];return w?(f=w.nextPos,w.result):(a=f,n.substr(f,4)===Dc?(h=Dc,f+=4):(h=i,N===0&&B(I0)),h!==i&&(J=a,h=k0()),a=h,a===i&&(a=f,n.substr(f,5)===Nc?(h=Nc,f+=5):(h=i,N===0&&B(L0)),h!==i&&(J=a,h=F0()),a=h),M[d]={nextPos:f,result:a},a)}function NE(){var a,h,d,w,E,P=f*49+28,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){for(d=[],w=dt();w!==i;)d.push(w),w=dt();d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=q0(),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i&&(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i?(d=mf(),d===i&&(d=te),d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=D0(d),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i)){if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){if(d=[],w=Li(),w!==i)for(;w!==i;)d.push(w),w=Li();else d=u;d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=N0(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i)if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){if(d=[],w=Li(),w!==i)for(;w!==i;)d.push(w),w=Li();else d=u;d!==i?(w=mf(),w!==i?(n.charCodeAt(f)===93?(E=x,f++):(E=i,N===0&&B(A)),E!==i?(J=a,h=M0(d,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;}return M[P]={nextPos:f,result:a},a}function mf(){var a,h,d,w,E,P=f*49+29,L=M[P];if(L)return f=L.nextPos,L.result;for(a=f,h=[],d=dt();d!==i;)h.push(d),d=dt();if(h!==i)if(d=Gr(),d!==i){for(w=[],E=dt();E!==i;)w.push(E),E=dt();w!==i?(J=a,h=Mc(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function Li(){var a,h,d,w,E,P,L,G=f*49+30,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=dt();d!==i;)h.push(d),d=dt();if(h!==i)if(d=Gr(),d!==i){for(w=[],E=dt();E!==i;)w.push(E),E=dt();if(w!==i)if(n.charCodeAt(f)===44?(E=jc,f++):(E=i,N===0&&B(Bc)),E!==i){for(P=[],L=dt();L!==i;)P.push(L),L=dt();P!==i?(J=a,h=Mc(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;return M[G]={nextPos:f,result:a},a}function dt(){var a,h=f*49+31,d=M[h];return d?(f=d.nextPos,d.result):(a=X(),a===i&&(a=gt(),a===i&&(a=ki())),M[h]={nextPos:f,result:a},a)}function ME(){var a,h,d,w,E,P,L=f*49+32,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===123?(h=j0,f++):(h=i,N===0&&B(B0)),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i){for(w=[],E=vf();E!==i;)w.push(E),E=vf();if(w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(n.charCodeAt(f)===125?(P=H0,f++):(P=i,N===0&&B(U0)),P!==i?(J=a,h=W0(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;}else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function vf(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+33,xe=M[Ee];if(xe)return f=xe.nextPos,xe.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===61?(E=j,f++):(E=i,N===0&&B(C)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();if(P!==i)if(L=Gr(),L!==i){for(G=[],ie=X();ie!==i;)G.push(ie),ie=X();if(G!==i)if(n.charCodeAt(f)===44?(ie=jc,f++):(ie=i,N===0&&B(Bc)),ie!==i){for(de=[],he=X();he!==i;)de.push(he),he=X();de!==i?(J=a,h=Hc(d,L),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===61?(E=j,f++):(E=i,N===0&&B(C)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(L=Gr(),L!==i?(J=a,h=Hc(d,L),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}return M[Ee]={nextPos:f,result:a},a}function wf(){var a,h,d,w=f*49+34,E=M[w];return E?(f=E.nextPos,E.result):(a=f,n.charCodeAt(f)===46?(h=q,f++):(h=i,N===0&&B(k)),h!==i?(d=qn(),d!==i?(J=a,h=z0(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function Sf(){var a,h,d,w,E,P,L,G,ie,de,he,Ee,xe=f*49+35,st=M[xe];return st?(f=st.nextPos,st.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(E=pe(),E!==i?(P=pe(),P!==i?(n.charCodeAt(f)===45?(L=Tn,f++):(L=i,N===0&&B($n)),L!==i?(G=pe(),G!==i?(ie=pe(),ie!==i?(n.charCodeAt(f)===45?(de=Tn,f++):(de=i,N===0&&B($n)),de!==i?(he=pe(),he!==i?(Ee=pe(),Ee!==i?(d=[d,w,E,P,L,G,ie,de,he,Ee],h=d):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(J=a,h=G0(h)),a=h,M[xe]={nextPos:f,result:a},a)}function jE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+36,xe=M[Ee];return xe?(f=xe.nextPos,xe.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(n.charCodeAt(f)===58?(E=In,f++):(E=i,N===0&&B(kn)),E!==i?(P=pe(),P!==i?(L=pe(),L!==i?(n.charCodeAt(f)===58?(G=In,f++):(G=i,N===0&&B(kn)),G!==i?(ie=pe(),ie!==i?(de=pe(),de!==i?(he=wf(),he===i&&(he=te),he!==i?(d=[d,w,E,P,L,G,ie,de,he],h=d):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(J=a,h=Uc(h)),a=h,M[Ee]={nextPos:f,result:a},a)}function BE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee,xe,st,Kr,tr,ot,xf=f*49+37,Uo=M[xf];return Uo?(f=Uo.nextPos,Uo.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(n.charCodeAt(f)===58?(E=In,f++):(E=i,N===0&&B(kn)),E!==i?(P=pe(),P!==i?(L=pe(),L!==i?(n.charCodeAt(f)===58?(G=In,f++):(G=i,N===0&&B(kn)),G!==i?(ie=pe(),ie!==i?(de=pe(),de!==i?(he=wf(),he===i&&(he=te),he!==i?(n.charCodeAt(f)===45?(Ee=Tn,f++):(Ee=i,N===0&&B($n)),Ee===i&&(n.charCodeAt(f)===43?(Ee=Er,f++):(Ee=i,N===0&&B(er))),Ee!==i?(xe=pe(),xe!==i?(st=pe(),st!==i?(n.charCodeAt(f)===58?(Kr=In,f++):(Kr=i,N===0&&B(kn)),Kr!==i?(tr=pe(),tr!==i?(ot=pe(),ot!==i?(d=[d,w,E,P,L,G,ie,de,he,Ee,xe,st,Kr,tr,ot],h=d):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(J=a,h=Uc(h)),a=h,M[xf]={nextPos:f,result:a},a)}function HE(){var a,h,d,w,E,P=f*49+38,L=M[P];return L?(f=L.nextPos,L.result):(a=f,h=Sf(),h!==i?(n.charCodeAt(f)===84?(d=Wc,f++):(d=i,N===0&&B(zc)),d!==i?(w=jE(),w!==i?(n.charCodeAt(f)===90?(E=K0,f++):(E=i,N===0&&B(V0)),E!==i?(J=a,h=Y0(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=Sf(),h!==i?(n.charCodeAt(f)===84?(d=Wc,f++):(d=i,N===0&&B(zc)),d!==i?(w=BE(),w!==i?(J=a,h=J0(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u)),M[P]={nextPos:f,result:a},a)}function X(){var a,h=f*49+39,d=M[h];return d?(f=d.nextPos,d.result):(X0.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(Q0)),M[h]={nextPos:f,result:a},a)}function gt(){var a,h,d,w=f*49+40,E=M[w];return E?(f=E.nextPos,E.result):(n.charCodeAt(f)===10?(a=Gc,f++):(a=i,N===0&&B(Kc)),a===i&&(a=f,n.charCodeAt(f)===13?(h=Z0,f++):(h=i,N===0&&B(eE)),h!==i?(n.charCodeAt(f)===10?(d=Gc,f++):(d=i,N===0&&B(Kc)),d!==i?(h=[h,d],a=h):(f=a,a=u)):(f=a,a=u)),M[w]={nextPos:f,result:a},a)}function bf(){var a,h=f*49+41,d=M[h];return d?(f=d.nextPos,d.result):(a=gt(),a===i&&(a=X()),M[h]={nextPos:f,result:a},a)}function Fi(){var a,h,d=f*49+42,w=M[d];return w?(f=w.nextPos,w.result):(a=f,N++,n.length>f?(h=n.charAt(f),f++):(h=i,N===0&&B(v)),N--,h===i?a=m:(f=a,a=u),M[d]={nextPos:f,result:a},a)}function yt(){var a,h=f*49+43,d=M[h];return d?(f=d.nextPos,d.result):(tE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(rE)),M[h]={nextPos:f,result:a},a)}function pe(){var a,h,d=f*49+44,w=M[d];return w?(f=w.nextPos,w.result):(nE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(iE)),a===i&&(a=f,n.charCodeAt(f)===95?(h=sE,f++):(h=i,N===0&&B(oE)),h!==i&&(J=a,h=aE()),a=h),M[d]={nextPos:f,result:a},a)}function Ef(){var a,h=f*49+45,d=M[h];return d?(f=d.nextPos,d.result):(lE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(uE)),M[h]={nextPos:f,result:a},a)}function qn(){var a,h,d,w=f*49+46,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=pe(),d!==i)for(;d!==i;)h.push(d),d=pe();else h=u;return h!==i&&(J=a,h=cE(h)),a=h,M[w]={nextPos:f,result:a},a}function Af(){var a,h,d=f*49+47,w=M[d];return w?(f=w.nextPos,w.result):(a=f,n.substr(f,2)===Vc?(h=Vc,f+=2):(h=i,N===0&&B(fE)),h!==i&&(J=a,h=hE()),a=h,a===i&&(a=f,n.substr(f,2)===Yc?(h=Yc,f+=2):(h=i,N===0&&B(pE)),h!==i&&(J=a,h=dE()),a=h,a===i&&(a=f,n.substr(f,2)===Jc?(h=Jc,f+=2):(h=i,N===0&&B(gE)),h!==i&&(J=a,h=yE()),a=h,a===i&&(a=f,n.substr(f,2)===Xc?(h=Xc,f+=2):(h=i,N===0&&B(mE)),h!==i&&(J=a,h=vE()),a=h,a===i&&(a=f,n.substr(f,2)===Qc?(h=Qc,f+=2):(h=i,N===0&&B(wE)),h!==i&&(J=a,h=SE()),a=h,a===i&&(a=f,n.substr(f,2)===Zc?(h=Zc,f+=2):(h=i,N===0&&B(bE)),h!==i&&(J=a,h=EE()),a=h,a===i&&(a=f,n.substr(f,2)===ef?(h=ef,f+=2):(h=i,N===0&&B(AE)),h!==i&&(J=a,h=_E()),a=h,a===i&&(a=UE()))))))),M[d]={nextPos:f,result:a},a)}function UE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+48,xe=M[Ee];return xe?(f=xe.nextPos,xe.result):(a=f,n.substr(f,2)===tf?(h=tf,f+=2):(h=i,N===0&&B(xE)),h!==i?(d=f,w=yt(),w!==i?(E=yt(),E!==i?(P=yt(),P!==i?(L=yt(),L!==i?(G=yt(),G!==i?(ie=yt(),ie!==i?(de=yt(),de!==i?(he=yt(),he!==i?(w=[w,E,P,L,G,ie,de,he],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=rf(d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,n.substr(f,2)===nf?(h=nf,f+=2):(h=i,N===0&&B(CE)),h!==i?(d=f,w=yt(),w!==i?(E=yt(),E!==i?(P=yt(),P!==i?(L=yt(),L!==i?(w=[w,E,P,L],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=rf(d),a=h):(f=a,a=u)):(f=a,a=u)),M[Ee]={nextPos:f,result:a},a)}var _f=[];function WE(a,h,d){var w=new Error(a);throw w.line=h,w.column=d,w}function Ho(a){_f.push(a);}function je(a,h,d,w,E){var P={type:a,value:h,line:d(),column:w()};return E&&(P.key=E),P}function zE(a,h,d){var w=parseInt("0x"+a);if(!isFinite(w)||Math.floor(w)!=w||w<0||w>1114111||w>55295&&w<57344)WE("Invalid Unicode escape code: "+a,h,d);else return GE(w)}function GE(){var a=16384,h=[],d,w,E=-1,P=arguments.length;if(!P)return "";for(var L="";++E>10)+55296,w=G%1024+56320,h.push(d,w)),(E+1==P||h.length>a)&&(L+=String.fromCharCode.apply(null,h),h.length=0);}return L}if(Ii=l(),Ii!==i&&f===n.length)return Ii;throw Ii!==i&&f{function YI(t){var e=[],r=[],n="",s=Object.create(null),i=s;return l(t);function l(A){for(var O,I=0;I"u"?C===O.length-1?j[V]=I:j[V]=Object.create(null):C!==O.length-1&&r.indexOf(q)>-1&&c("Cannot redefine existing key '"+q+"'.",F,U),j=j[V],j instanceof Array&&j.length&&C-1?'"'+A+'"':A}}rS.exports={compile:YI};});var sS=R((TM,iS)=>{var JI=tS(),XI=nS();iS.exports={parse:function(t){var e=JI.parse(t.toString());return XI.compile(e)}};});var li=R(($M,cS)=>{var QI=z("path"),Mt="\\\\/",oS=`[^${Mt}]`,Kt="\\.",ZI="\\+",ek="\\?",no="\\/",tk="(?=.)",aS="[^/]",Su=`(?:${no}|$)`,lS=`(?:^|${no})`,bu=`${Kt}{1,2}${Su}`,rk=`(?!${Kt})`,nk=`(?!${lS}${bu})`,ik=`(?!${Kt}{0,1}${Su})`,sk=`(?!${bu})`,ok=`[^.${no}]`,ak=`${aS}*?`,uS={DOT_LITERAL:Kt,PLUS_LITERAL:ZI,QMARK_LITERAL:ek,SLASH_LITERAL:no,ONE_CHAR:tk,QMARK:aS,END_ANCHOR:Su,DOTS_SLASH:bu,NO_DOT:rk,NO_DOTS:nk,NO_DOT_SLASH:ik,NO_DOTS_SLASH:sk,QMARK_NO_DOT:ok,STAR:ak,START_ANCHOR:lS},lk={...uS,SLASH_LITERAL:`[${Mt}]`,QMARK:oS,STAR:`${oS}*?`,DOTS_SLASH:`${Kt}{1,2}(?:[${Mt}]|$)`,NO_DOT:`(?!${Kt})`,NO_DOTS:`(?!(?:^|[${Mt}])${Kt}{1,2}(?:[${Mt}]|$))`,NO_DOT_SLASH:`(?!${Kt}{0,1}(?:[${Mt}]|$))`,NO_DOTS_SLASH:`(?!${Kt}{1,2}(?:[${Mt}]|$))`,QMARK_NO_DOT:`[^.${Mt}]`,START_ANCHOR:`(?:^|[${Mt}])`,END_ANCHOR:`(?:[${Mt}]|$)`},uk={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};cS.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:uk,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:QI.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?lk:uS}};});var io=R(nt=>{var ck=z("path"),fk=process.platform==="win32",{REGEX_BACKSLASH:hk,REGEX_REMOVE_BACKSLASH:pk,REGEX_SPECIAL_CHARS:dk,REGEX_SPECIAL_CHARS_GLOBAL:gk}=li();nt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);nt.hasRegexChars=t=>dk.test(t);nt.isRegexChar=t=>t.length===1&&nt.hasRegexChars(t);nt.escapeRegex=t=>t.replace(gk,"\\$1");nt.toPosixSlashes=t=>t.replace(hk,"/");nt.removeBackslashes=t=>t.replace(pk,e=>e==="\\"?"":e);nt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};nt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:fk===!0||ck.sep==="\\";nt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?nt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};nt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};nt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var vS=R((kM,mS)=>{var fS=io(),{CHAR_ASTERISK:Eu,CHAR_AT:yk,CHAR_BACKWARD_SLASH:ui,CHAR_COMMA:mk,CHAR_DOT:Au,CHAR_EXCLAMATION_MARK:_u,CHAR_FORWARD_SLASH:yS,CHAR_LEFT_CURLY_BRACE:xu,CHAR_LEFT_PARENTHESES:Cu,CHAR_LEFT_SQUARE_BRACKET:vk,CHAR_PLUS:wk,CHAR_QUESTION_MARK:hS,CHAR_RIGHT_CURLY_BRACE:Sk,CHAR_RIGHT_PARENTHESES:pS,CHAR_RIGHT_SQUARE_BRACKET:bk}=li(),dS=t=>t===yS||t===ui,gS=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},Ek=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],l=[],c=t,p=-1,u=0,g=0,y=!1,m=!1,v=!1,b=!1,_=!1,x=!1,A=!1,O=!1,I=!1,F=!1,U=0,H,q,k={value:"",depth:0,isGlob:!1},j=()=>p>=n,C=()=>c.charCodeAt(p+1),V=()=>(H=q,c.charCodeAt(++p));for(;p0&&(se=c.slice(0,u),c=c.slice(u),g-=u),Y&&v===!0&&g>0?(Y=c.slice(0,g),T=c.slice(g)):v===!0?(Y="",T=c):Y=c,Y&&Y!==""&&Y!=="/"&&Y!==c&&dS(Y.charCodeAt(Y.length-1))&&(Y=Y.slice(0,-1)),r.unescape===!0&&(T&&(T=fS.removeBackslashes(T)),Y&&A===!0&&(Y=fS.removeBackslashes(Y)));let $={prefix:se,input:t,start:u,base:Y,glob:T,isBrace:y,isBracket:m,isGlob:v,isExtglob:b,isGlobstar:_,negated:O,negatedExtglob:I};if(r.tokens===!0&&($.maxDepth=0,dS(q)||o.push(k),$.tokens=o),r.parts===!0||r.tokens===!0){let te;for(let Q=0;Q{var so=li(),ut=io(),{MAX_LENGTH:oo,POSIX_REGEX_SOURCE:Ak,REGEX_NON_SPECIAL_CHARS:_k,REGEX_SPECIAL_CHARS_BACKREF:xk,REPLACEMENTS:wS}=so,Ck=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},yn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Ru=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=wS[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(oo,r.maxLength):oo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],l=r.capture?"":"?:",c=ut.isWindows(e),p=so.globChars(c),u=so.extglobChars(p),{DOT_LITERAL:g,PLUS_LITERAL:y,SLASH_LITERAL:m,ONE_CHAR:v,DOTS_SLASH:b,NO_DOT:_,NO_DOT_SLASH:x,NO_DOTS_SLASH:A,QMARK:O,QMARK_NO_DOT:I,STAR:F,START_ANCHOR:U}=p,H=K=>`(${l}(?:(?!${U}${K.dot?b:g}).)*?)`,q=r.dot?"":_,k=r.dot?O:I,j=r.bash===!0?H(r):F;r.capture&&(j=`(${j})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=ut.removePrefix(t,C),s=t.length;let V=[],Y=[],se=[],T=i,$,te=()=>C.index===s-1,Q=C.peek=(K=1)=>t[C.index+K],ue=C.advance=()=>t[++C.index]||"",Ge=()=>t.slice(C.index+1),Oe=(K="",me=0)=>{C.consumed+=K,C.index+=me;},Qt=K=>{C.output+=K.output!=null?K.output:K.value,Oe(K.value);},Pn=()=>{let K=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ue(),C.start++,K++;return K%2===0?!1:(C.negated=!0,C.start++,!0)},Zt=K=>{C[K]++,se.push(K);},St=K=>{C[K]--,se.pop();},ce=K=>{if(T.type==="globstar"){let me=C.braces>0&&(K.type==="comma"||K.type==="brace"),W=K.extglob===!0||V.length&&(K.type==="pipe"||K.type==="paren");K.type!=="slash"&&K.type!=="paren"&&!me&&!W&&(C.output=C.output.slice(0,-T.output.length),T.type="star",T.value="*",T.output=j,C.output+=T.output);}if(V.length&&K.type!=="paren"&&(V[V.length-1].inner+=K.value),(K.value||K.output)&&Qt(K),T&&T.type==="text"&&K.type==="text"){T.value+=K.value,T.output=(T.output||"")+K.value;return}K.prev=T,o.push(K),T=K;},zr=(K,me)=>{let W={...u[me],conditions:1,inner:""};W.prev=T,W.parens=C.parens,W.output=C.output;let le=(r.capture?"(":"")+W.open;Zt("parens"),ce({type:K,value:me,output:C.output?"":v}),ce({type:"paren",extglob:!0,value:ue(),output:le}),V.push(W);},Fo=K=>{let me=K.close+(r.capture?")":""),W;if(K.type==="negate"){let le=j;if(K.inner&&K.inner.length>1&&K.inner.includes("/")&&(le=H(r)),(le!==j||te()||/^\)+$/.test(Ge()))&&(me=K.close=`)$))${le}`),K.inner.includes("*")&&(W=Ge())&&/^\.[^\\/.]+$/.test(W)){let we=Ru(W,{...e,fastpaths:!1}).output;me=K.close=`)${we})${le})`;}K.prev.type==="bos"&&(C.negatedExtglob=!0);}ce({type:"paren",extglob:!0,value:$,output:me}),St("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let K=!1,me=t.replace(xk,(W,le,we,De,_e,Er)=>De==="\\"?(K=!0,W):De==="?"?le?le+De+(_e?O.repeat(_e.length):""):Er===0?k+(_e?O.repeat(_e.length):""):O.repeat(we.length):De==="."?g.repeat(we.length):De==="*"?le?le+De+(_e?j:""):j:le?W:`\\${W}`);return K===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),me===t&&r.contains===!0?(C.output=t,C):(C.output=ut.wrapOutput(me,C,e),C)}for(;!te();){if($=ue(),$==="\0")continue;if($==="\\"){let W=Q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){$+="\\",ce({type:"text",value:$});continue}let le=/^\\+/.exec(Ge()),we=0;if(le&&le[0].length>2&&(we=le[0].length,C.index+=we,we%2!==0&&($+="\\")),r.unescape===!0?$=ue():$+=ue(),C.brackets===0){ce({type:"text",value:$});continue}}if(C.brackets>0&&($!=="]"||T.value==="["||T.value==="[^")){if(r.posix!==!1&&$===":"){let W=T.value.slice(1);if(W.includes("[")&&(T.posix=!0,W.includes(":"))){let le=T.value.lastIndexOf("["),we=T.value.slice(0,le),De=T.value.slice(le+2),_e=Ak[De];if(_e){T.value=we+_e,C.backtrack=!0,ue(),!i.output&&o.indexOf(T)===1&&(i.output=v);continue}}}($==="["&&Q()!==":"||$==="-"&&Q()==="]")&&($=`\\${$}`),$==="]"&&(T.value==="["||T.value==="[^")&&($=`\\${$}`),r.posix===!0&&$==="!"&&T.value==="["&&($="^"),T.value+=$,Qt({value:$});continue}if(C.quotes===1&&$!=='"'){$=ut.escapeRegex($),T.value+=$,Qt({value:$});continue}if($==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:$});continue}if($==="("){Zt("parens"),ce({type:"paren",value:$});continue}if($===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(yn("opening","("));let W=V[V.length-1];if(W&&C.parens===W.parens+1){Fo(V.pop());continue}ce({type:"paren",value:$,output:C.parens?")":"\\)"}),St("parens");continue}if($==="["){if(r.nobracket===!0||!Ge().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(yn("closing","]"));$=`\\${$}`;}else Zt("brackets");ce({type:"bracket",value:$});continue}if($==="]"){if(r.nobracket===!0||T&&T.type==="bracket"&&T.value.length===1){ce({type:"text",value:$,output:`\\${$}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(yn("opening","["));ce({type:"text",value:$,output:`\\${$}`});continue}St("brackets");let W=T.value.slice(1);if(T.posix!==!0&&W[0]==="^"&&!W.includes("/")&&($=`/${$}`),T.value+=$,Qt({value:$}),r.literalBrackets===!1||ut.hasRegexChars(W))continue;let le=ut.escapeRegex(T.value);if(C.output=C.output.slice(0,-T.value.length),r.literalBrackets===!0){C.output+=le,T.value=le;continue}T.value=`(${l}${le}|${T.value})`,C.output+=T.value;continue}if($==="{"&&r.nobrace!==!0){Zt("braces");let W={type:"brace",value:$,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};Y.push(W),ce(W);continue}if($==="}"){let W=Y[Y.length-1];if(r.nobrace===!0||!W){ce({type:"text",value:$,output:$});continue}let le=")";if(W.dots===!0){let we=o.slice(),De=[];for(let _e=we.length-1;_e>=0&&(o.pop(),we[_e].type!=="brace");_e--)we[_e].type!=="dots"&&De.unshift(we[_e].value);le=Ck(De,r),C.backtrack=!0;}if(W.comma!==!0&&W.dots!==!0){let we=C.output.slice(0,W.outputIndex),De=C.tokens.slice(W.tokensIndex);W.value=W.output="\\{",$=le="\\}",C.output=we;for(let _e of De)C.output+=_e.output||_e.value;}ce({type:"brace",value:$,output:le}),St("braces"),Y.pop();continue}if($==="|"){V.length>0&&V[V.length-1].conditions++,ce({type:"text",value:$});continue}if($===","){let W=$,le=Y[Y.length-1];le&&se[se.length-1]==="braces"&&(le.comma=!0,W="|"),ce({type:"comma",value:$,output:W});continue}if($==="/"){if(T.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),T=i;continue}ce({type:"slash",value:$,output:m});continue}if($==="."){if(C.braces>0&&T.type==="dot"){T.value==="."&&(T.output=g);let W=Y[Y.length-1];T.type="dots",T.output+=$,T.value+=$,W.dots=!0;continue}if(C.braces+C.parens===0&&T.type!=="bos"&&T.type!=="slash"){ce({type:"text",value:$,output:g});continue}ce({type:"dot",value:$,output:g});continue}if($==="?"){if(!(T&&T.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){zr("qmark",$);continue}if(T&&T.type==="paren"){let le=Q(),we=$;if(le==="<"&&!ut.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(T.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Ge()))&&(we=`\\${$}`),ce({type:"text",value:$,output:we});continue}if(r.dot!==!0&&(T.type==="slash"||T.type==="bos")){ce({type:"qmark",value:$,output:I});continue}ce({type:"qmark",value:$,output:O});continue}if($==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){zr("negate",$);continue}if(r.nonegate!==!0&&C.index===0){Pn();continue}}if($==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){zr("plus",$);continue}if(T&&T.value==="("||r.regex===!1){ce({type:"plus",value:$,output:y});continue}if(T&&(T.type==="bracket"||T.type==="paren"||T.type==="brace")||C.parens>0){ce({type:"plus",value:$});continue}ce({type:"plus",value:y});continue}if($==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ce({type:"at",extglob:!0,value:$,output:""});continue}ce({type:"text",value:$});continue}if($!=="*"){($==="$"||$==="^")&&($=`\\${$}`);let W=_k.exec(Ge());W&&($+=W[0],C.index+=W[0].length),ce({type:"text",value:$});continue}if(T&&(T.type==="globstar"||T.star===!0)){T.type="star",T.star=!0,T.value+=$,T.output=j,C.backtrack=!0,C.globstar=!0,Oe($);continue}let K=Ge();if(r.noextglob!==!0&&/^\([^?]/.test(K)){zr("star",$);continue}if(T.type==="star"){if(r.noglobstar===!0){Oe($);continue}let W=T.prev,le=W.prev,we=W.type==="slash"||W.type==="bos",De=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!we||K[0]&&K[0]!=="/")){ce({type:"star",value:$,output:""});continue}let _e=C.braces>0&&(W.type==="comma"||W.type==="brace"),Er=V.length&&(W.type==="pipe"||W.type==="paren");if(!we&&W.type!=="paren"&&!_e&&!Er){ce({type:"star",value:$,output:""});continue}for(;K.slice(0,3)==="/**";){let er=t[C.index+4];if(er&&er!=="/")break;K=K.slice(3),Oe("/**",3);}if(W.type==="bos"&&te()){T.type="globstar",T.value+=$,T.output=H(r),C.output=T.output,C.globstar=!0,Oe($);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!De&&te()){C.output=C.output.slice(0,-(W.output+T.output).length),W.output=`(?:${W.output}`,T.type="globstar",T.output=H(r)+(r.strictSlashes?")":"|$)"),T.value+=$,C.globstar=!0,C.output+=W.output+T.output,Oe($);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&K[0]==="/"){let er=K[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(W.output+T.output).length),W.output=`(?:${W.output}`,T.type="globstar",T.output=`${H(r)}${m}|${m}${er})`,T.value+=$,C.output+=W.output+T.output,C.globstar=!0,Oe($+ue()),ce({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&K[0]==="/"){T.type="globstar",T.value+=$,T.output=`(?:^|${m}|${H(r)}${m})`,C.output=T.output,C.globstar=!0,Oe($+ue()),ce({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-T.output.length),T.type="globstar",T.output=H(r),T.value+=$,C.output+=T.output,C.globstar=!0,Oe($);continue}let me={type:"star",value:$,output:j};if(r.bash===!0){me.output=".*?",(T.type==="bos"||T.type==="slash")&&(me.output=q+me.output),ce(me);continue}if(T&&(T.type==="bracket"||T.type==="paren")&&r.regex===!0){me.output=$,ce(me);continue}(C.index===C.start||T.type==="slash"||T.type==="dot")&&(T.type==="dot"?(C.output+=x,T.output+=x):r.dot===!0?(C.output+=A,T.output+=A):(C.output+=q,T.output+=q),Q()!=="*"&&(C.output+=v,T.output+=v)),ce(me);}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing","]"));C.output=ut.escapeLast(C.output,"["),St("brackets");}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing",")"));C.output=ut.escapeLast(C.output,"("),St("parens");}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing","}"));C.output=ut.escapeLast(C.output,"{"),St("braces");}if(r.strictSlashes!==!0&&(T.type==="star"||T.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${m}?`}),C.backtrack===!0){C.output="";for(let K of C.tokens)C.output+=K.output!=null?K.output:K.value,K.suffix&&(C.output+=K.suffix);}return C};Ru.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(oo,r.maxLength):oo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=wS[t]||t;let i=ut.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:c,DOTS_SLASH:p,NO_DOT:u,NO_DOTS:g,NO_DOTS_SLASH:y,STAR:m,START_ANCHOR:v}=so.globChars(i),b=r.dot?g:u,_=r.dot?y:u,x=r.capture?"":"?:",A={negated:!1,prefix:""},O=r.bash===!0?".*?":m;r.capture&&(O=`(${O})`);let I=q=>q.noglobstar===!0?O:`(${x}(?:(?!${v}${q.dot?p:o}).)*?)`,F=q=>{switch(q){case"*":return `${b}${c}${O}`;case".*":return `${o}${c}${O}`;case"*.*":return `${b}${O}${o}${c}${O}`;case"*/*":return `${b}${O}${l}${c}${_}${O}`;case"**":return b+I(r);case"**/*":return `(?:${b}${I(r)}${l})?${_}${c}${O}`;case"**/*.*":return `(?:${b}${I(r)}${l})?${_}${O}${o}${c}${O}`;case"**/.*":return `(?:${b}${I(r)}${l})?${o}${c}${O}`;default:{let k=/^(.*?)\.(\w+)$/.exec(q);if(!k)return;let j=F(k[1]);return j?j+o+k[2]:void 0}}},U=ut.removePrefix(t,A),H=F(U);return H&&r.strictSlashes!==!0&&(H+=`${l}?`),H};SS.exports=Ru;});var AS=R((FM,ES)=>{var Rk=z("path"),Ok=vS(),Ou=bS(),Pu=io(),Pk=li(),Tk=t=>t&&typeof t=="object"&&!Array.isArray(t),Re=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(y=>Re(y,e,r));return y=>{for(let m of u){let v=m(y);if(v)return v}return !1}}let n=Tk(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Pu.isWindows(e),o=n?Re.compileRe(t,e):Re.makeRe(t,e,!1,!0),l=o.state;delete o.state;let c=()=>!1;if(s.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Re(s.ignore,u,r);}let p=(u,g=!1)=>{let{isMatch:y,match:m,output:v}=Re.test(u,o,e,{glob:t,posix:i}),b={glob:t,state:l,regex:o,posix:i,input:u,output:v,match:m,isMatch:y};return typeof s.onResult=="function"&&s.onResult(b),y===!1?(b.isMatch=!1,g?b:!1):c(u)?(typeof s.onIgnore=="function"&&s.onIgnore(b),b.isMatch=!1,g?b:!1):(typeof s.onMatch=="function"&&s.onMatch(b),g?b:!0)};return r&&(p.state=l),p};Re.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let i=r||{},o=i.format||(s?Pu.toPosixSlashes:null),l=t===n,c=l&&o?o(t):t;return l===!1&&(c=o?o(t):t,l=c===n),(l===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?l=Re.matchBase(t,e,r,s):l=e.exec(c)),{isMatch:!!l,match:l,output:c}};Re.matchBase=(t,e,r,n=Pu.isWindows(r))=>(e instanceof RegExp?e:Re.makeRe(e,r)).test(Rk.basename(t));Re.isMatch=(t,e,r)=>Re(e,r)(t);Re.parse=(t,e)=>Array.isArray(t)?t.map(r=>Re.parse(r,e)):Ou(t,{...e,fastpaths:!1});Re.scan=(t,e)=>Ok(t,e);Re.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let c=Re.toRegex(l,e);return n===!0&&(c.state=t),c};Re.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=Ou.fastpaths(t,e)),s.output||(s=Ou(t,e)),Re.compileRe(s,e,r,n)};Re.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};Re.constants=Pk;ES.exports=Re;});var Tu=R((qM,_S)=>{_S.exports=AS();});var IS=R((DM,$S)=>{var fi=z("fs"),{Readable:$k}=z("stream"),ci=z("path"),{promisify:co}=z("util"),$u=Tu(),Ik=co(fi.readdir),kk=co(fi.stat),xS=co(fi.lstat),Lk=co(fi.realpath),Fk="!",PS="READDIRP_RECURSIVE_ERROR",qk=new Set(["ENOENT","EPERM","EACCES","ELOOP",PS]),Iu="files",TS="directories",lo="files_directories",ao="all",CS=[Iu,TS,lo,ao],Dk=t=>qk.has(t.code),[RS,Nk]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),Mk=process.platform==="win32"&&(RS>10||RS===10&&Nk>=5),OS=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=$u(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===Fk?r.push($u(s.slice(1))):e.push($u(s));}return r.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!r.some(s=>s(n.basename)):n=>!r.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},uo=class t extends $k{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Iu,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:s}=r;this._fileFilter=OS(r.fileFilter),this._directoryFilter=OS(r.directoryFilter);let i=r.lstat?xS:kk;Mk?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[TS,lo,ao].includes(s),this._wantsFile=[Iu,lo,ao].includes(s),this._wantsEverything=s===ao,this._root=ci.resolve(n),this._isDirent="Dirent"in fi&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(i)){if(this.destroyed)return;let l=await this._getEntryType(o);l==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(l==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await Ik(e,this._rdOptions);}catch(s){this._onError(s);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let s=this._isDirent?e.name:e,i=ci.resolve(ci.join(r,s));n={path:ci.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i);}catch(s){this._onError(s);}return n}_onError(e){Dk(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let s=await Lk(n),i=await xS(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===ci.sep){let l=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return l.code=PS,this._onError(l)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},mn=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=lo),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!CS.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${CS.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new uo(e)},jk=(t,e={})=>new Promise((r,n)=>{let s=[];mn(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});mn.promise=jk;mn.ReaddirpStream=uo;mn.default=mn;$S.exports=mn;});var ku=R((NM,kS)=>{kS.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")};});var MS=R((DS,NS)=>{Object.defineProperty(DS,"__esModule",{value:!0});var qS=Tu(),Bk=ku(),LS="!",Hk={returnIndex:!1},Uk=t=>Array.isArray(t)?t:[t],Wk=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=qS(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},FS=(t,e,r,n)=>{let s=Array.isArray(r),i=s?r[0]:r;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=Bk(i,!1);for(let c=0;c{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=Uk(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===LS).map(c=>c.slice(1)).map(c=>qS(c,n)),l=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==LS).map(c=>Wk(c,n));return e==null?(c,p=!1)=>FS(l,o,c,typeof p=="boolean"?p:!1):FS(l,o,e,s)};Lu.default=Lu;NS.exports=Lu;});var BS=R((MM,jS)=>{jS.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var Fu=R((jM,US)=>{var zk=BS(),HS={"{":"}","(":")","[":"]"},Gk=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;ee&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(o=t.indexOf("\\",r),o===-1||o>i))))return !0;if(t[e]==="\\"){var l=t[e+1];e+=2;var c=HS[l];if(c){var p=t.indexOf(c,e);p!==-1&&(e=p+1);}if(t[e]==="!")return !0}else e++;}return !1},Kk=function(t){if(t[0]==="!")return !0;for(var e=0;e{var Vk=Fu(),Yk=z("path").posix.dirname,Jk=z("os").platform()==="win32",qu="/",Xk=/\\/g,Qk=/[\{\[].*[\}\]]$/,Zk=/(^|[^\\])([\{\[]|\([^\)]+$)/,eL=/\\([\!\*\?\|\[\]\(\)\{\}])/g;WS.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Jk&&e.indexOf(qu)<0&&(e=e.replace(Xk,qu)),Qk.test(e)&&(e+=qu),e+="a";do e=Yk(e);while(Vk(e)||Zk.test(e));return e.replace(eL,"$1")};});var fo=R(wt=>{wt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;wt.find=(t,e)=>t.nodes.find(r=>r.type===e);wt.exceedsLimit=(t,e,r=1,n)=>n===!1||!wt.isInteger(t)||!wt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;wt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};wt.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);wt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;wt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;wt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);wt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s{var GS=fo();KS.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&GS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l="";if(n.value)return (i||o)&&GS.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)l+=r(c);return l};return r(t)};});var YS=R((WM,VS)=>{VS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var ib=R((zM,nb)=>{var JS=YS(),qr=(t,e,r)=>{if(JS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(JS(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),l=String(n.wrap),c=t+":"+e+"="+s+i+o+l;if(qr.cache.hasOwnProperty(c))return qr.cache[c].result;let p=Math.min(t,e),u=Math.max(t,e);if(Math.abs(p-u)===1){let b=t+"|"+e;return n.capture?`(${b})`:n.wrap===!1?b:`(?:${b})`}let g=rb(t)||rb(e),y={min:t,max:e,a:p,b:u},m=[],v=[];if(g&&(y.isPadded=g,y.maxLen=String(y.max).length),p<0){let b=u<0?Math.abs(u):1;v=XS(b,Math.abs(p),y,n),p=y.a=0;}return u>=0&&(m=XS(p,u,y,n)),y.negatives=v,y.positives=m,y.result=tL(v,m),n.capture===!0?y.result=`(${y.result})`:n.wrap!==!1&&m.length+v.length>1&&(y.result=`(?:${y.result})`),qr.cache[c]=y,y.result};function tL(t,e,r){let n=Du(t,e,"-",!1)||[],s=Du(e,t,"",!1)||[],i=Du(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function rL(t,e){let r=1,n=1,s=ZS(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=ZS(t,r);for(s=eb(e+1,n)-1;t1&&l.count.pop(),l.count.push(u.count[0]),l.string=l.pattern+tb(l.count),o=p+1;continue}r.isPadded&&(g=aL(p,r,n)),u.string=g+u.pattern+tb(u.count),i.push(u),o=p+1,l=u;}return i}function Du(t,e,r,n,s){let i=[];for(let o of t){let{string:l}=o;!n&&!QS(e,"string",l)&&i.push(r+l),n&&QS(e,"string",l)&&i.push(r+l);}return i}function iL(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function QS(t,e,r){return t.some(n=>n[e]===r)}function ZS(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function eb(t,e){return t-t%Math.pow(10,e)}function tb(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function oL(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function rb(t){return /^-?(0+)\d/.test(t)}function aL(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}qr.cache={};qr.clearCache=()=>qr.cache={};nb.exports=qr;});var ju=R((GM,hb)=>{var lL=z("util"),ab=ib(),sb=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uL=t=>e=>t===!0?Number(e):String(e),Nu=t=>typeof t=="number"||typeof t=="string"&&t!=="",hi=t=>Number.isInteger(+t),Mu=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},cL=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,fL=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},ob=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((o,l)=>ol?1:0),t.positives.sort((o,l)=>ol?1:0);let r=e.capture?"":"?:",n="",s="",i;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(s=`-(${r}${t.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,e.wrap?`(${r}${i})`:i},lb=(t,e,r,n)=>{if(r)return ab(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},ub=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return ab(t,e,r)},cb=(...t)=>new RangeError("Invalid range arguments: "+lL.inspect(...t)),fb=(t,e,r)=>{if(r.strictRanges===!0)throw cb([t,e]);return []},pL=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},dL=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw cb([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,l=String(t),c=String(e),p=String(r);r=Math.max(Math.abs(r),1);let u=Mu(l)||Mu(c)||Mu(p),g=u?Math.max(l.length,c.length,p.length):0,y=u===!1&&cL(t,e,n)===!1,m=n.transform||uL(y);if(n.toRegex&&r===1)return lb(ob(t,g),ob(e,g),!0,n);let v={negatives:[],positives:[]},b=A=>v[A<0?"negatives":"positives"].push(Math.abs(A)),_=[],x=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?b(s):_.push(fL(m(s,x),g,y)),s=o?s-r:s+r,x++;return n.toRegex===!0?r>1?hL(v,n):ub(_,null,{wrap:!1,...n}):_},gL=(t,e,r=1,n={})=>{if(!hi(t)&&t.length>1||!hi(e)&&e.length>1)return fb(t,e,n);let s=n.transform||(y=>String.fromCharCode(y)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),l=i>o,c=Math.min(i,o),p=Math.max(i,o);if(n.toRegex&&r===1)return lb(c,p,!1,n);let u=[],g=0;for(;l?i>=o:i<=o;)u.push(s(i,g)),i=l?i-r:i+r,g++;return n.toRegex===!0?ub(u,null,{wrap:!1,options:n}):u},po=(t,e,r,n={})=>{if(e==null&&Nu(t))return [t];if(!Nu(t)||!Nu(e))return fb(t,e,n);if(typeof r=="function")return po(t,e,1,{transform:r});if(sb(r))return po(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,hi(r)?hi(t)&&hi(e)?dL(t,e,r,s):gL(t,e,Math.max(Math.abs(r),1),s):r!=null&&!sb(r)?pL(r,s):po(t,e,1,r)};hb.exports=po;});var gb=R((KM,db)=>{var yL=ju(),pb=fo(),mL=(t,e={})=>{let r=(n,s={})=>{let i=pb.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",p="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return l?c+n.value:"(";if(n.type==="close")return l?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":l?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=pb.reduce(n.nodes),g=yL(...u,{...e,wrap:!1,toRegex:!0});if(g.length!==0)return u.length>1&&g.length>1?`(${g})`:g}if(n.nodes)for(let u of n.nodes)p+=r(u,n);return p};return r(t)};db.exports=mL;});var vb=R((VM,mb)=>{var vL=ju(),yb=ho(),vn=fo(),Dr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?vn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Dr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Dr(s,i,r):s+i);return vn.flatten(n)},wL=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,l=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,l=o.queue;if(s.invalid||s.dollar){l.push(Dr(l.pop(),yb(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){l.push(Dr(l.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let g=vn.reduce(s.nodes);if(vn.exceedsLimit(...g,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let y=vL(...g,e);y.length===0&&(y=yb(s,e)),l.push(Dr(l.pop(),y)),s.nodes=[];return}let c=vn.encloseBrace(s),p=s.queue,u=s;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,p=u.queue;for(let g=0;g{wb.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` -`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var xb=R((JM,_b)=>{var SL=ho(),{MAX_LENGTH:bb,CHAR_BACKSLASH:Bu,CHAR_BACKTICK:bL,CHAR_COMMA:EL,CHAR_DOT:AL,CHAR_LEFT_PARENTHESES:_L,CHAR_RIGHT_PARENTHESES:xL,CHAR_LEFT_CURLY_BRACE:CL,CHAR_RIGHT_CURLY_BRACE:RL,CHAR_LEFT_SQUARE_BRACKET:Eb,CHAR_RIGHT_SQUARE_BRACKET:Ab,CHAR_DOUBLE_QUOTE:OL,CHAR_SINGLE_QUOTE:PL,CHAR_NO_BREAK_SPACE:TL,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$L}=Sb(),IL=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(bb,r.maxLength):bb;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,l=s,c=0,p=t.length,u=0,g=0,y,v=()=>t[u++],b=_=>{if(_.type==="text"&&l.type==="dot"&&(l.type="text"),l&&l.type==="text"&&_.type==="text"){l.value+=_.value;return}return o.nodes.push(_),_.parent=o,_.prev=l,l=_,_};for(b({type:"bos"});u0){if(o.ranges>0){o.ranges=0;let _=o.nodes.shift();o.nodes=[_,{type:"text",value:SL(o)}];}b({type:"comma",value:y}),o.commas++;continue}if(y===AL&&g>0&&o.commas===0){let _=o.nodes;if(g===0||_.length===0){b({type:"text",value:y});continue}if(l.type==="dot"){if(o.range=[],l.value+=y,l.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,l.type="text";continue}o.ranges++,o.args=[];continue}if(l.type==="range"){_.pop();let x=_[_.length-1];x.value+=l.value+y,l=x,o.ranges--;continue}b({type:"dot",value:y});continue}b({type:"text",value:y});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(A=>{A.nodes||(A.type==="open"&&(A.isOpen=!0),A.type==="close"&&(A.isClose=!0),A.nodes||(A.type="text"),A.invalid=!0);});let _=i[i.length-1],x=_.nodes.indexOf(o);_.nodes.splice(x,1,...o.nodes);}while(i.length>0);return b({type:"eos"}),s};_b.exports=IL;});var Ob=R((XM,Rb)=>{var Cb=ho(),kL=gb(),LL=vb(),FL=xb(),ct=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=ct.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(ct.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ct.parse=(t,e={})=>FL(t,e);ct.stringify=(t,e={})=>Cb(typeof t=="string"?ct.parse(t,e):t,e);ct.compile=(t,e={})=>(typeof t=="string"&&(t=ct.parse(t,e)),kL(t,e));ct.expand=(t,e={})=>{typeof t=="string"&&(t=ct.parse(t,e));let r=LL(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ct.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ct.compile(t,e):ct.expand(t,e);Rb.exports=ct;});var Pb=R((QM,qL)=>{qL.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var $b=R((ZM,Tb)=>{Tb.exports=Pb();});var kb=R((ej,Ib)=>{var DL=z("path"),NL=$b(),ML=new Set(NL);Ib.exports=t=>ML.has(DL.extname(t).slice(1).toLowerCase());});var go=R(Z=>{var{sep:jL}=z("path"),{platform:Hu}=process,BL=z("os");Z.EV_ALL="all";Z.EV_READY="ready";Z.EV_ADD="add";Z.EV_CHANGE="change";Z.EV_ADD_DIR="addDir";Z.EV_UNLINK="unlink";Z.EV_UNLINK_DIR="unlinkDir";Z.EV_RAW="raw";Z.EV_ERROR="error";Z.STR_DATA="data";Z.STR_END="end";Z.STR_CLOSE="close";Z.FSEVENT_CREATED="created";Z.FSEVENT_MODIFIED="modified";Z.FSEVENT_DELETED="deleted";Z.FSEVENT_MOVED="moved";Z.FSEVENT_CLONED="cloned";Z.FSEVENT_UNKNOWN="unknown";Z.FSEVENT_TYPE_FILE="file";Z.FSEVENT_TYPE_DIRECTORY="directory";Z.FSEVENT_TYPE_SYMLINK="symlink";Z.KEY_LISTENERS="listeners";Z.KEY_ERR="errHandlers";Z.KEY_RAW="rawEmitters";Z.HANDLER_KEYS=[Z.KEY_LISTENERS,Z.KEY_ERR,Z.KEY_RAW];Z.DOT_SLASH=`.${jL}`;Z.BACK_SLASH_RE=/\\/g;Z.DOUBLE_SLASH_RE=/\/\//;Z.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Z.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Z.REPLACER_RE=/^\.[/\\]/;Z.SLASH="/";Z.SLASH_SLASH="//";Z.BRACE_START="{";Z.BANG="!";Z.ONE_DOT=".";Z.TWO_DOTS="..";Z.STAR="*";Z.GLOBSTAR="**";Z.ROOT_GLOBSTAR="/**/*";Z.SLASH_GLOBSTAR="/**";Z.DIR_SUFFIX="Dir";Z.ANYMATCH_OPTS={dot:!0};Z.STRING_TYPE="string";Z.FUNCTION_TYPE="function";Z.EMPTY_STR="";Z.EMPTY_FN=()=>{};Z.IDENTITY_FN=t=>t;Z.isWindows=Hu==="win32";Z.isMacos=Hu==="darwin";Z.isLinux=Hu==="linux";Z.isIBMi=BL.type()==="OS400";});var Mb=R((rj,Nb)=>{var Vt=z("fs"),Le=z("path"),{promisify:yi}=z("util"),HL=kb(),{isWindows:UL,isLinux:WL,EMPTY_FN:zL,EMPTY_STR:GL,KEY_LISTENERS:wn,KEY_ERR:Uu,KEY_RAW:pi,HANDLER_KEYS:KL,EV_CHANGE:mo,EV_ADD:yo,EV_ADD_DIR:VL,EV_ERROR:Fb,STR_DATA:YL,STR_END:JL,BRACE_START:XL,STAR:QL}=go(),ZL="watch",eF=yi(Vt.open),qb=yi(Vt.stat),tF=yi(Vt.lstat),rF=yi(Vt.close),Wu=yi(Vt.realpath),nF={lstat:tF,stat:qb},Gu=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},di=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},iF=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},gi=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},Db=t=>t instanceof Set?t.size===0:!t,vo=new Map;function Lb(t,e,r,n,s){let i=(o,l)=>{r(t),s(o,l,{watchedPath:t}),l&&t!==l&&wo(Le.resolve(t,l),wn,Le.join(t,l));};try{return Vt.watch(t,e,i)}catch(o){n(o);}}var wo=(t,e,r,n,s)=>{let i=vo.get(t);i&&Gu(i[e],o=>{o(r,n,s);});},sF=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,l=vo.get(e),c;if(!r.persistent)return c=Lb(t,r,s,i,o),c.close.bind(c);if(l)di(l,wn,s),di(l,Uu,i),di(l,pi,o);else {if(c=Lb(t,r,wo.bind(null,e,wn),i,wo.bind(null,e,pi)),!c)return;c.on(Fb,async p=>{let u=wo.bind(null,e,Uu);if(l.watcherUnusable=!0,UL&&p.code==="EPERM")try{let g=await eF(t,"r");await rF(g),u(p);}catch{}else u(p);}),l={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},vo.set(e,l);}return ()=>{gi(l,wn,s),gi(l,Uu,i),gi(l,pi,o),Db(l.listeners)&&(l.watcher.close(),vo.delete(e),KL.forEach(iF(l)),l.watcher=void 0,Object.freeze(l));}},zu=new Map,oF=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=zu.get(e),p=o&&o.options;return p&&(p.persistentr.interval)&&(Vt.unwatchFile(e),o=void 0),o?(di(o,wn,s),di(o,pi,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Vt.watchFile(e,r,(u,g)=>{Gu(o.rawEmitters,m=>{m(mo,e,{curr:u,prev:g});});let y=u.mtimeMs;(u.size!==g.size||y>g.mtimeMs||y===0)&&Gu(o.listeners,m=>m(t,u));})},zu.set(e,o)),()=>{gi(o,wn,s),gi(o,pi,i),Db(o.listeners)&&(zu.delete(e),Vt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},Ku=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Le.dirname(e),i=Le.basename(e);this.fsw._getWatchedDir(s).add(i);let l=Le.resolve(e),c={persistent:n.persistent};r||(r=zL);let p;return n.usePolling?(c.interval=n.enableBinaryInterval&&HL(i)?n.binaryInterval:n.interval,p=oF(e,l,c,{listener:r,rawEmitter:this.fsw._emitRaw})):p=sF(e,l,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),p}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Le.dirname(e),i=Le.basename(e),o=this.fsw._getWatchedDir(s),l=r;if(o.has(i))return;let c=async(u,g)=>{if(this.fsw._throttle(ZL,e,5)){if(!g||g.mtimeMs===0)try{let y=await qb(e);if(this.fsw.closed)return;let m=y.atimeMs,v=y.mtimeMs;(!m||m<=v||v!==l.mtimeMs)&&this.fsw._emit(mo,e,y),WL&&l.ino!==y.ino?(this.fsw._closeFile(u),l=y,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):l=y;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let y=g.atimeMs,m=g.mtimeMs;(!y||y<=m||m!==l.mtimeMs)&&this.fsw._emit(mo,e,g),l=g;}}},p=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(yo,e,0))return;this.fsw._emit(yo,e,r);}return p}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let l;try{l=await Wu(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==l&&(this.fsw._symlinkPaths.set(i,l),this.fsw._emit(mo,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,l),this.fsw._emit(yo,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return !0;this.fsw._symlinkPaths.set(i,!0);}_handleRead(e,r,n,s,i,o,l){if(e=Le.join(e,GL),!n.hasGlob&&(l=this.fsw._throttle("readdir",e,1e3),!l))return;let c=this.fsw._getWatchedDir(n.path),p=new Set,u=this.fsw._readdirp(e,{fileFilter:g=>n.filterPath(g),directoryFilter:g=>n.filterDir(g),depth:0}).on(YL,async g=>{if(this.fsw.closed){u=void 0;return}let y=g.path,m=Le.join(e,y);if(p.add(y),!(g.stats.isSymbolicLink()&&await this._handleSymlink(g,e,m,y))){if(this.fsw.closed){u=void 0;return}(y===s||!s&&!c.has(y))&&(this.fsw._incrReadyCount(),m=Le.join(i,Le.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(Fb,this._boundHandleError);return new Promise(g=>u.once(JL,()=>{if(this.fsw.closed){u=void 0;return}let y=l?l.clear():!1;g(),c.getChildren().filter(m=>m!==e&&!p.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Le.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),u=void 0,y&&this._handleRead(e,!1,n,s,i,o,l);}))}async _handleDir(e,r,n,s,i,o,l){let c=this.fsw._getWatchedDir(Le.dirname(e)),p=c.has(Le.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!p&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(VL,e,r),c.add(Le.basename(e)),this.fsw._getWatchedDir(e);let u,g,y=this.fsw.options.depth;if((y==null||s<=y)&&!this.fsw._symlinkPaths.has(l)){if(!i&&(await this._handleRead(e,n,o,i,e,s,u),this.fsw.closed))return;g=this._watchWithNodeFs(e,(m,v)=>{v&&v.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,u);});}return g}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let l=this.fsw._getWatchHelpers(e,s);!l.hasGlob&&n&&(l.hasGlob=n.hasGlob,l.globFilter=n.globFilter,l.filterPath=c=>n.filterPath(c),l.filterDir=c=>n.filterDir(c));try{let c=await nF[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,c))return o(),!1;let p=this.fsw.options.followSymlinks&&!e.includes(QL)&&!e.includes(XL),u;if(c.isDirectory()){let g=Le.resolve(e),y=p?await Wu(e):e;if(this.fsw.closed||(u=await this._handleDir(l.watchPath,c,r,s,i,l,y),this.fsw.closed))return;g!==y&&y!==void 0&&this.fsw._symlinkPaths.set(g,y);}else if(c.isSymbolicLink()){let g=p?await Wu(e):e;if(this.fsw.closed)return;let y=Le.dirname(l.watchPath);if(this.fsw._getWatchedDir(y).add(l.watchPath),this.fsw._emit(yo,l.watchPath,c),u=await this._handleDir(y,c,r,s,e,l,g),this.fsw.closed)return;g!==void 0&&this.fsw._symlinkPaths.set(Le.resolve(e),g);}else u=this._handleFile(l.watchPath,c,r);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};Nb.exports=Ku;});var Gb=R((nj,tc)=>{var Zu=z("fs"),Fe=z("path"),{promisify:ec}=z("util"),Sn;try{Sn=z("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Sn){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Sn=void 0);}}var{EV_ADD:Vu,EV_CHANGE:aF,EV_ADD_DIR:jb,EV_UNLINK:So,EV_ERROR:lF,STR_DATA:uF,STR_END:cF,FSEVENT_CREATED:fF,FSEVENT_MODIFIED:hF,FSEVENT_DELETED:pF,FSEVENT_MOVED:dF,FSEVENT_UNKNOWN:gF,FSEVENT_TYPE_FILE:yF,FSEVENT_TYPE_DIRECTORY:mi,FSEVENT_TYPE_SYMLINK:zb,ROOT_GLOBSTAR:Bb,DIR_SUFFIX:mF,DOT_SLASH:Hb,FUNCTION_TYPE:Yu,EMPTY_FN:vF,IDENTITY_FN:wF}=go(),SF=t=>isNaN(t)?{}:{depth:t},Xu=ec(Zu.stat),bF=ec(Zu.lstat),Ub=ec(Zu.realpath),EF={stat:Xu,lstat:bF},Nr=new Map,AF=10,_F=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),xF=(t,e)=>({stop:Sn.watch(t,e)});function CF(t,e,r,n){let s=Fe.extname(e)?Fe.dirname(e):e,i=Fe.dirname(s),o=Nr.get(s);RF(i)&&(s=i);let l=Fe.resolve(t),c=l!==e,p=(g,y,m)=>{c&&(g=g.replace(e,l)),(g===l||!g.indexOf(l+Fe.sep))&&r(g,y,m);},u=!1;for(let g of Nr.keys())if(e.indexOf(Fe.resolve(g)+Fe.sep)===0){s=g,o=Nr.get(s),u=!0;break}return o||u?o.listeners.add(p):(o={listeners:new Set([p]),rawEmitter:n,watcher:xF(s,(g,y)=>{if(!o.listeners.size)return;let m=Sn.getInfo(g,y);o.listeners.forEach(v=>{v(g,y,m);}),o.rawEmitter(m.event,g,m);})},Nr.set(s,o)),()=>{let g=o.listeners;if(g.delete(p),!g.size&&(Nr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var RF=t=>{let e=0;for(let r of Nr.keys())if(r.indexOf(t)===0&&(e++,e>=AF))return !0;return !1},OF=()=>Sn&&Nr.size<128,Ju=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=Fe.dirname(t))!==e;)r++;return r},Wb=(t,e)=>t.type===mi&&e.isDirectory()||t.type===zb&&e.isSymbolicLink()||t.type===yF&&e.isFile(),Qu=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+Bb),!0;n.delete(e),n.delete(e+Bb);}addOrChange(e,r,n,s,i,o,l,c){let p=i.has(o)?aF:Vu;this.handleEvent(p,e,r,n,s,i,o,l,c);}async checkExists(e,r,n,s,i,o,l,c){try{let p=await Xu(e);if(this.fsw.closed)return;Wb(l,p)?this.addOrChange(e,r,n,s,i,o,l,c):this.handleEvent(So,e,r,n,s,i,o,l,c);}catch(p){p.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,l,c):this.handleEvent(So,e,r,n,s,i,o,l,c);}}handleEvent(e,r,n,s,i,o,l,c,p){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===So){let u=c.type===mi;(u||o.has(l))&&this.fsw._remove(i,l,u);}else {if(e===Vu){if(c.type===mi&&this.fsw._getWatchedDir(r),c.type===zb&&p.followSymlinks){let g=p.depth===void 0?void 0:Ju(n,s)+1;return this._addToFsEvents(r,!1,!0,g)}this.fsw._getWatchedDir(i).add(l);}let u=c.type===mi?e+mF:e;this.fsw._emit(u,r),u===jb&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,l=CF(e,r,async(c,p,u)=>{if(this.fsw.closed||i.depth!==void 0&&Ju(c,r)>i.depth)return;let g=n(Fe.join(e,Fe.relative(e,c)));if(s&&!s(g))return;let y=Fe.dirname(g),m=Fe.basename(g),v=this.fsw._getWatchedDir(u.type===mi?g:y);if(_F.has(p)||u.event===gF)if(typeof i.ignored===Yu){let b;try{b=await Xu(g);}catch{}if(this.fsw.closed||this.checkIgnored(g,b))return;Wb(u,b)?this.addOrChange(g,c,r,y,v,m,u,i):this.handleEvent(So,g,c,r,y,v,m,u,i);}else this.checkExists(g,c,r,y,v,m,u,i);else switch(u.event){case fF:case hF:return this.addOrChange(g,c,r,y,v,m,u,i);case pF:case dF:return this.checkExists(g,c,r,y,v,m,u,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),l}async _handleFsEventsSymlink(e,r,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let i=await Ub(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let l=e;return i&&i!==Hb?l=o.replace(i,e):o!==Hb&&(l=Fe.join(e,o)),n(l)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),l=r.isDirectory(),c=this.fsw._getWatchedDir(Fe.dirname(o)),p=Fe.basename(o);l&&this.fsw._getWatchedDir(o),!c.has(p)&&(c.add(p),(!s.ignoreInitial||i===!0)&&this.fsw._emit(l?jb:Vu,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,Fe.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(r,i);}async _addToFsEvents(e,r,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof r===Yu?r:wF,l=this.fsw._getWatchHelpers(e);try{let c=await EF[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,c))throw null;if(c.isDirectory()){if(l.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(l.watchPath,{fileFilter:p=>l.filterPath(p),directoryFilter:p=>l.filterDir(p),...SF(i.depth-(s||0))}).on(uF,p=>{if(this.fsw.closed||p.stats.isDirectory()&&!l.filterPath(p))return;let u=Fe.join(l.watchPath,p.path),{fullPath:g}=p;if(l.followSymlinks&&p.stats.isSymbolicLink()){let y=i.depth===void 0?void 0:Ju(u,Fe.resolve(l.watchPath))+1;this._handleFsEventsSymlink(u,g,o,y);}else this.emitAdd(u,p.stats,o,i,n);}).on(lF,vF).on(cF,()=>{this.fsw._emitReady();});}else this.emitAdd(l.watchPath,c,o,i,n),this.fsw._emitReady();}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(i.persistent&&n!==!0)if(typeof r===Yu)this.initWatch(void 0,e,l,o);else {let c;try{c=await Ub(l.watchPath);}catch{}this.initWatch(c,e,l,o);}}};tc.exports=Qu;tc.exports.canUse=OF;});var n0=R(yc=>{var{EventEmitter:PF}=z("events"),dc=z("fs"),ye=z("path"),{promisify:Zb}=z("util"),TF=IS(),ac=MS().default,$F=zS(),rc=Fu(),IF=Ob(),kF=ku(),LF=Mb(),Kb=Gb(),{EV_ALL:nc,EV_READY:FF,EV_ADD:bo,EV_CHANGE:vi,EV_UNLINK:Vb,EV_ADD_DIR:qF,EV_UNLINK_DIR:DF,EV_RAW:NF,EV_ERROR:ic,STR_CLOSE:MF,STR_END:jF,BACK_SLASH_RE:BF,DOUBLE_SLASH_RE:Yb,SLASH_OR_BACK_SLASH_RE:HF,DOT_RE:UF,REPLACER_RE:WF,SLASH:sc,SLASH_SLASH:zF,BRACE_START:GF,BANG:lc,ONE_DOT:e0,TWO_DOTS:KF,GLOBSTAR:VF,SLASH_GLOBSTAR:oc,ANYMATCH_OPTS:uc,STRING_TYPE:gc,FUNCTION_TYPE:YF,EMPTY_STR:cc,EMPTY_FN:JF,isWindows:XF,isMacos:QF,isIBMi:ZF}=go(),eq=Zb(dc.stat),tq=Zb(dc.readdir),fc=(t=[])=>Array.isArray(t)?t:[t],t0=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?t0(r,e):e.push(r);}),e),Jb=t=>{let e=t0(fc(t));if(!e.every(r=>typeof r===gc))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(r0)},Xb=t=>{let e=t.replace(BF,sc),r=!1;for(e.startsWith(zF)&&(r=!0);e.match(Yb);)e=e.replace(Yb,sc);return r&&(e=sc+e),e},r0=t=>Xb(ye.normalize(Xb(t))),Qb=(t=cc)=>e=>typeof e!==gc?e:r0(ye.isAbsolute(e)?e:ye.join(t,e)),rq=(t,e)=>ye.isAbsolute(t)?t:t.startsWith(lc)?lc+ye.join(e,t.slice(1)):ye.join(e,t),xt=(t,e)=>t[e]===void 0,hc=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==e0&&e!==KF&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await tq(n);}catch{this._removeWatcher&&this._removeWatcher(ye.dirname(n),ye.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},nq="stat",iq="lstat",pc=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(WF,cc),this.watchPath=r,this.fullWatchPath=ye.resolve(r),this.hasGlob=r!==e,e===cc&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?ac(e,void 0,uc):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?nq:iq;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ye.join(this.watchPath,ye.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===YF?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(GF)?IF.expand(e):[e]).forEach(s=>{r.push(ye.relative(this.watchPath,s).split(HF));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===VF&&(n=!0),n||!r[0][o]||ac(i,r[0][o],uc))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Eo=class extends PF{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,xt(r,"persistent")&&(r.persistent=!0),xt(r,"ignoreInitial")&&(r.ignoreInitial=!1),xt(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),xt(r,"interval")&&(r.interval=100),xt(r,"binaryInterval")&&(r.binaryInterval=300),xt(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,xt(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Kb.canUse()||(r.useFsEvents=!1),xt(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=QF),ZF&&(r.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c;}let i=process.env.CHOKIDAR_INTERVAL;i&&(r.interval=Number.parseInt(i,10)),xt(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),xt(r,"followSymlinks")&&(r.followSymlinks=!0),xt(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=fc(r.ignored));let l=0;this._emitReady=()=>{l++,l>=this._readyCount&&(this._emitReady=JF,this._readyEmitted=!0,process.nextTick(()=>this.emit(FF)));},this._emitRaw=(...c)=>this.emit(NF,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Kb(this):this._nodeFsHandler=new LF(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=Jb(e);return s&&(o=o.map(l=>{let c=rq(l,s);return i||!rc(l)?c:kF(c)})),o=o.filter(l=>l.startsWith(lc)?(this._ignoredPaths.add(l.slice(1)),!1):(this._ignoredPaths.delete(l),this._ignoredPaths.delete(l+oc),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(l=>this._fsEventsHandler._addToFsEvents(l))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async l=>{let c=await this._nodeFsHandler._addToNodeFs(l,!n,0,0,r);return c&&this._emitReady(),c})).then(l=>{this.closed||l.filter(c=>c).forEach(c=>{this.add(ye.dirname(c),ye.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=Jb(e),{cwd:n}=this.options;return r.forEach(s=>{!ye.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=ye.join(n,s)),s=ye.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+oc),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let s=n();s instanceof Promise&&e.push(s);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=this.options.cwd?ye.relative(this.options.cwd,n):n;e[s||e0]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==ic&&this.emit(nc,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;XF&&(r=ye.normalize(r)),o.cwd&&(r=ye.relative(o.cwd,r));let l=[e,r];i!==void 0?l.push(n,s,i):s!==void 0?l.push(n,s):n!==void 0&&l.push(n);let c=o.awaitWriteFinish,p;if(c&&(p=this._pendingWrites.get(r)))return p.lastChange=new Date,this;if(o.atomic){if(e===Vb)return this._pendingUnlinks.set(r,l),setTimeout(()=>{this._pendingUnlinks.forEach((u,g)=>{this.emit(...u),this.emit(nc,...u),this._pendingUnlinks.delete(g);});},typeof o.atomic=="number"?o.atomic:100),this;e===bo&&this._pendingUnlinks.has(r)&&(e=l[0]=vi,this._pendingUnlinks.delete(r));}if(c&&(e===bo||e===vi)&&this._readyEmitted){let u=(g,y)=>{g?(e=l[0]=ic,l[1]=g,this.emitWithAll(e,l)):y&&(l.length>2?l[2]=y:l.push(y),this.emitWithAll(e,l));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,u),this}if(e===vi&&!this._throttle(vi,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===bo||e===qF||e===vi)){let u=o.cwd?ye.join(o.cwd,r):r,g;try{g=await eq(u);}catch{}if(!g||this.closed)return;l.push(g);}return this.emitWithAll(e,l),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(ic,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(r);if(i)return i.count++,!1;let o,l=()=>{let p=s.get(r),u=p?p.count:0;return s.delete(r),clearTimeout(o),p&&clearTimeout(p.timeoutObject),u};o=setTimeout(l,n);let c={timeoutObject:o,clear:l,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!ye.isAbsolute(e)&&(o=ye.join(this.options.cwd,e));let l=new Date,c=p=>{dc.stat(o,(u,g)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&s(u);return}let y=Number(new Date);p&&g.size!==p.size&&(this._pendingWrites.get(e).lastChange=y);let m=this._pendingWrites.get(e);y-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,g)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,g);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:l,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(c,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&UF.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(Qb(n)),o=fc(i).filter(c=>typeof c===gc&&!rc(c)).map(c=>c+oc),l=this._getGlobIgnored().map(Qb(n)).concat(i,o);this._userIgnored=ac(l,void 0,uc);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!rc(e)?e:$F(e),s=this.options.followSymlinks;return new pc(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=ye.resolve(e);return this._watched.has(r)||this._watched.set(r,new hc(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let s=ye.join(e,r),i=ye.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(s).getChildren().forEach(y=>this._remove(s,y));let c=this._getWatchedDir(e),p=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=s;if(this.options.cwd&&(u=ye.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===bo)return;this._watched.delete(s),this._watched.delete(i);let g=n?DF:Vb;p&&!this._isIgnored(s)&&this._emit(g,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=ye.dirname(e);this._getWatchedDir(r).remove(ye.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:nc,alwaysStat:!0,lstat:!0,...r},s=TF(e,n);return this._streams.add(s),s.once(MF,()=>{s=void 0;}),s.once(jF,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};yc.FSWatcher=Eo;var sq=(t,e)=>{let r=new Eo(e);return r.add(t),r};yc.watch=sq;});var d0=R((Ur,p0)=>{var _c=z("crypto");Ur=p0.exports=Ci;function Ci(t,e){return e=f0(t,e),uq(t,e)}Ur.sha1=function(t){return Ci(t)};Ur.keys=function(t){return Ci(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};Ur.MD5=function(t){return Ci(t,{algorithm:"md5",encoding:"hex"})};Ur.keysMD5=function(t){return Ci(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var On=_c.getHashes?_c.getHashes().slice():["sha1","md5"];On.push("passthrough");var u0=["buffer","hex","binary","base64"];function f0(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n"u"&&(r.write=r.update,r.end=r.update);var n=xc(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var s=r.read();return e.encoding==="buffer"?s:s.toString(e.encoding)}Ur.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=f0(t,e),xc(e,r).dispatch(t)};function xc(t,e,r){r=r||[];var n=function(s){return e.update?e.update(s,"utf8"):e.write(s,"utf8")};return {dispatch:function(s){t.replacer&&(s=t.replacer(s));var i=typeof s;return s===null&&(i="null"),this["_"+i](s)},_object:function(s){var i=/\[object (.*)\]/i,o=Object.prototype.toString.call(s),l=i.exec(o);l?l=l[1]:l="unknown:["+o+"]",l=l.toLowerCase();var c=null;if((c=r.indexOf(s))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(s),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return n("buffer:"),n(s);if(l!=="object"&&l!=="function"&&l!=="asyncfunction")if(this["_"+l])this["_"+l](s);else {if(t.ignoreUnknown)return n("["+l+"]");throw new Error('Unknown object type "'+l+'"')}else {var p=Object.keys(s);t.unorderedObjects&&(p=p.sort()),t.respectType!==!1&&!c0(s)&&p.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(p=p.filter(function(g){return !t.excludeKeys(g)})),n("object:"+p.length+":");var u=this;return p.forEach(function(g){u.dispatch(g),n(":"),t.excludeValues||u.dispatch(s[g]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(p){return o.dispatch(p)});var l=[],c=s.map(function(p){var u=new h0,g=r.slice(),y=xc(t,u,g);return y.dispatch(p),l=l.concat(g.slice(r.length)),u.read().toString()});return r=r.concat(l),c.sort(),this._array(c,!1)},_date:function(s){return n("date:"+s.toJSON())},_symbol:function(s){return n("symbol:"+s.toString())},_error:function(s){return n("error:"+s.toString())},_boolean:function(s){return n("bool:"+s.toString())},_string:function(s){n("string:"+s.length+":"),n(s.toString());},_function:function(s){n("fn:"),c0(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this._object(s);},_number:function(s){return n("number:"+s.toString())},_xml:function(s){return n("xml:"+s.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(s){return n("regex:"+s.toString())},_uint8array:function(s){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint8clampedarray:function(s){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},_int8array:function(s){return n("int8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint16array:function(s){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},_int16array:function(s){return n("int16array:"),this.dispatch(Array.prototype.slice.call(s))},_uint32array:function(s){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},_int32array:function(s){return n("int32array:"),this.dispatch(Array.prototype.slice.call(s))},_float32array:function(s){return n("float32array:"),this.dispatch(Array.prototype.slice.call(s))},_float64array:function(s){return n("float64array:"),this.dispatch(Array.prototype.slice.call(s))},_arraybuffer:function(s){return n("arraybuffer:"),this.dispatch(new Uint8Array(s))},_url:function(s){return n("url:"+s.toString())},_map:function(s){n("map:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_set:function(s){n("set:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_file:function(s){return n("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported +`,"utf-8"),this.emit("history");}async immutate(e){let{size:r}=this.options,n=this.now();for(let s=1;s<1e3;++s){let i=0,o;this.filename=this.options.path+this.generator(n,s);try{o=await this.fsStat(this.filename);}catch(a){if(a.code!=="ENOENT")throw a}if(o){if(i=o.size,!o.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(r&&i>=r)continue}if(e)return this.last=this.filename,this.reopen(i);await this.rotated(this.last),this.last=this.filename;return}throw new Pn}async unlink(e){try{await this.fsUnlink(e);}catch(r){if(r.code!=="ENOENT")throw r;this.emit("warning",r);}}};ak={M:!0,d:!0,h:!0,m:!0,s:!0};uk={B:!0,G:!0,K:!0,M:!0};Kb={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:Au("interval",lk),intervalBoundary:()=>{},maxFiles:Gb("maxFiles"),maxSize:Au("maxSize",Vb),mode:()=>{},omitExtension:()=>{},rotate:Gb("rotate"),size:Au("size",Vb),teeToStdout:()=>{},compress:(t,e,r)=>{if(!r)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(n,s)=>`cat ${n} | gzip -c9 > ${s}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(r!=="gzip")throw new Error(`Don't know how to handle compression method: ${r}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,r)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);r[r.length-1]!==path.sep&&(e.path=r+path.sep);}};});var ev={};Js(ev,{allLoggers:()=>Lr,rootLogger:()=>be});var Ts,Xb,Qb,be,Lr,_t=jn(()=>{Ts=fr(jb());Ft();Xb=(Jb(),Xs(Yb)).createStream("tabby-agent.log",{path:G("path").join(G("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Qb={serializers:{error:Ts.default.stdSerializers.err}},be=Xb?(0, Ts.default)(Qb,Xb):(0, Ts.default)(Qb);be.level="silent";Lr=[be];be.onChild=t=>{Lr.push(t);};});var rv=T((gD,tv)=>{tv.exports=function(){function t(n,s){function i(){this.constructor=n;}i.prototype=s.prototype,n.prototype=new i;}function e(n,s,i,o,a,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=a,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:hc},a=hc,d=function(){return Oc},u=i,p="#",_={type:"literal",value:"#",description:'"#"'},m=void 0,y={type:"any",description:"any character"},v="[",E={type:"literal",value:"[",description:'"["'},A="]",w={type:"literal",value:"]",description:'"]"'},x=function(l){Zs(Pe("ObjectPath",l,Te,Ie));},M=function(l){Zs(Pe("ArrayPath",l,Te,Ie));},k=function(l,h){return l.concat(h)},j=function(l){return [l]},U=function(l){return l},$=".",F={type:"literal",value:".",description:'"."'},B="=",R={type:"literal",value:"=",description:'"="'},z=function(l,h){Zs(Pe("Assign",h,Te,Ie,l));},V=function(l){return l.join("")},te=function(l){return l.value},I='"""',O={type:"literal",value:'"""',description:'"\\"\\"\\""'},X=null,Q=function(l){return Pe("String",l.join(""),Te,Ie)},ie='"',Ne={type:"literal",value:'"',description:'"\\""'},ve="'''",Et={type:"literal",value:"'''",description:`"'''"`},Hr="'",At={type:"literal",value:"'",description:`"'"`},nt=function(l){return l},se=function(l){return l},lr="\\",Hs={type:"literal",value:"\\",description:'"\\\\"'},Z=function(){return ""},he="e",W={type:"literal",value:"e",description:'"e"'},ne="E",de={type:"literal",value:"E",description:'"E"'},Re=function(l,h){return Pe("Float",parseFloat(l+"e"+h),Te,Ie)},ge=function(l){return Pe("Float",parseFloat(l),Te,Ie)},Wt="+",xt={type:"literal",value:"+",description:'"+"'},ju=function(l){return l.join("")},jr="-",Wr={type:"literal",value:"-",description:'"-"'},Wu=function(l){return "-"+l.join("")},jv=function(l){return Pe("Integer",parseInt(l,10),Te,Ie)},zu="true",Wv={type:"literal",value:"true",description:'"true"'},zv=function(){return Pe("Boolean",!0,Te,Ie)},Gu="false",Gv={type:"literal",value:"false",description:'"false"'},Vv=function(){return Pe("Boolean",!1,Te,Ie)},Kv=function(){return Pe("Array",[],Te,Ie)},Zv=function(l){return Pe("Array",l?[l]:[],Te,Ie)},Yv=function(l){return Pe("Array",l,Te,Ie)},Jv=function(l,h){return Pe("Array",l.concat(h),Te,Ie)},Vu=function(l){return l},Ku=",",Zu={type:"literal",value:",",description:'","'},Xv="{",Qv={type:"literal",value:"{",description:'"{"'},eS="}",tS={type:"literal",value:"}",description:'"}"'},rS=function(l){return Pe("InlineTable",l,Te,Ie)},Yu=function(l,h){return Pe("InlineTableValue",h,Te,Ie,l)},nS=function(l){return "."+l},iS=function(l){return l.join("")},zr=":",Gr={type:"literal",value:":",description:'":"'},Ju=function(l){return l.join("")},Xu="T",Qu={type:"literal",value:"T",description:'"T"'},sS="Z",oS={type:"literal",value:"Z",description:'"Z"'},aS=function(l,h){return Pe("Date",new Date(l+"T"+h+"Z"),Te,Ie)},lS=function(l,h){return Pe("Date",new Date(l+"T"+h),Te,Ie)},uS=/^[ \t]/,cS={type:"class",value:"[ \\t]",description:"[ \\t]"},ec=` +`,tc={type:"literal",value:` +`,description:'"\\n"'},fS="\r",hS={type:"literal",value:"\r",description:'"\\r"'},dS=/^[0-9a-f]/i,pS={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},mS=/^[0-9]/,_S={type:"class",value:"[0-9]",description:"[0-9]"},gS="_",yS={type:"literal",value:"_",description:'"_"'},wS=function(){return ""},bS=/^[A-Za-z0-9_\-]/,vS={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},SS=function(l){return l.join("")},rc='\\"',ES={type:"literal",value:'\\"',description:'"\\\\\\""'},AS=function(){return '"'},nc="\\\\",xS={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},CS=function(){return "\\"},ic="\\b",RS={type:"literal",value:"\\b",description:'"\\\\b"'},TS=function(){return "\b"},sc="\\t",IS={type:"literal",value:"\\t",description:'"\\\\t"'},PS=function(){return " "},oc="\\n",OS={type:"literal",value:"\\n",description:'"\\\\n"'},MS=function(){return ` +`},ac="\\f",NS={type:"literal",value:"\\f",description:'"\\\\f"'},kS=function(){return "\f"},lc="\\r",$S={type:"literal",value:"\\r",description:'"\\\\r"'},LS=function(){return "\r"},uc="\\U",DS={type:"literal",value:"\\U",description:'"\\\\U"'},cc=function(l){return iE(l.join(""))},fc="\\u",qS={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,Y=0,Vr=0,js={line:1,column:1,seenCR:!1},Ln=0,Ws=[],D=0,q={},Dn;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');a=o[s.startRule];}function Te(){return zs(Y).line}function Ie(){return zs(Y).column}function zs(l){function h(g,b,S){var P,N;for(P=b;Pl&&(Vr=0,js={line:1,column:1,seenCR:!1}),h(js,Vr,l),Vr=l),js}function H(l){fLn&&(Ln=f,Ws=[]),Ws.push(l));}function Gs(l,h,g){function b(K){var re=1;for(K.sort(function(ce,le){return ce.descriptionle.description?1:0});re1?le.slice(0,-1).join(", ")+" or "+le[K.length-1]:le[0],ye=re?'"'+ce(re)+'"':"end of input","Expected "+pe+" but "+ye+" found."}var P=zs(g),N=gf?(P=n.charAt(f),f++):(P=i,D===0&&H(y)),P!==i?(S=[S,P],b=S):(f=b,b=u)):(f=b,b=u);b!==i;)g.push(b),b=f,S=f,D++,P=Je(),P===i&&(P=Un()),D--,P===i?S=m:(f=S,S=u),S!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,D===0&&H(y)),P!==i?(S=[S,P],b=S):(f=b,b=u)):(f=b,b=u);g!==i?(h=[h,g],l=h):(f=l,l=u);}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function US(){var l,h,g,b,S,P,N=f*49+4,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i)if(b=pc(),b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(n.charCodeAt(f)===93?(P=A,f++):(P=i,D===0&&H(w)),P!==i?(Y=l,h=x(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function HS(){var l,h,g,b,S,P,N,K,re=f*49+5,ce=q[re];if(ce)return f=ce.nextPos,ce.result;if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i)if(n.charCodeAt(f)===91?(g=v,f++):(g=i,D===0&&H(E)),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(S=pc(),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(n.charCodeAt(f)===93?(N=A,f++):(N=i,D===0&&H(w)),N!==i?(n.charCodeAt(f)===93?(K=A,f++):(K=i,D===0&&H(w)),K!==i?(Y=l,h=M(S),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;return q[re]={nextPos:f,result:l},l}function pc(){var l,h,g,b=f*49+6,S=q[b];if(S)return f=S.nextPos,S.result;if(l=f,h=[],g=_c(),g!==i)for(;g!==i;)h.push(g),g=_c();else h=u;return h!==i?(g=mc(),g!==i?(Y=l,h=k(h,g),l=h):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,h=mc(),h!==i&&(Y=l,h=j(h)),l=h),q[b]={nextPos:f,result:l},l}function mc(){var l,h,g,b,S,P=f*49+7,N=q[P];if(N)return f=N.nextPos,N.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();b!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;if(l===i){for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Vs(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();b!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}return q[P]={nextPos:f,result:l},l}function _c(){var l,h,g,b,S,P,N,K=f*49+8,re=q[K];if(re)return f=re.nextPos,re.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;if(l===i){for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Vs(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(Y=l,h=U(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}return q[K]={nextPos:f,result:l},l}function jS(){var l,h,g,b,S,P,N=f*49+9,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,h=Kr(),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i)if(n.charCodeAt(f)===61?(b=B,f++):(b=i,D===0&&H(R)),b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(P=ur(),P!==i?(Y=l,h=z(h,P),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;if(l===i)if(l=f,h=Vs(),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i)if(n.charCodeAt(f)===61?(b=B,f++):(b=i,D===0&&H(R)),b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(P=ur(),P!==i?(Y=l,h=z(h,P),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function Kr(){var l,h,g,b=f*49+10,S=q[b];if(S)return f=S.nextPos,S.result;if(l=f,h=[],g=Ic(),g!==i)for(;g!==i;)h.push(g),g=Ic();else h=u;return h!==i&&(Y=l,h=V(h)),l=h,q[b]={nextPos:f,result:l},l}function Vs(){var l,h,g=f*49+11,b=q[g];return b?(f=b.nextPos,b.result):(l=f,h=gc(),h!==i&&(Y=l,h=te(h)),l=h,l===i&&(l=f,h=yc(),h!==i&&(Y=l,h=te(h)),l=h),q[g]={nextPos:f,result:l},l)}function ur(){var l,h=f*49+12,g=q[h];return g?(f=g.nextPos,g.result):(l=WS(),l===i&&(l=tE(),l===i&&(l=KS(),l===i&&(l=ZS(),l===i&&(l=YS(),l===i&&(l=JS(),l===i&&(l=XS())))))),q[h]={nextPos:f,result:l},l)}function WS(){var l,h=f*49+13,g=q[h];return g?(f=g.nextPos,g.result):(l=zS(),l===i&&(l=gc(),l===i&&(l=GS(),l===i&&(l=yc()))),q[h]={nextPos:f,result:l},l)}function zS(){var l,h,g,b,S,P=f*49+14,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.substr(f,3)===I?(h=I,f+=3):(h=i,D===0&&H(O)),h!==i)if(g=Je(),g===i&&(g=X),g!==i){for(b=[],S=vc();S!==i;)b.push(S),S=vc();b!==i?(n.substr(f,3)===I?(S=I,f+=3):(S=i,D===0&&H(O)),S!==i?(Y=l,h=Q(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function gc(){var l,h,g,b,S=f*49+15,P=q[S];if(P)return f=P.nextPos,P.result;if(l=f,n.charCodeAt(f)===34?(h=ie,f++):(h=i,D===0&&H(Ne)),h!==i){for(g=[],b=wc();b!==i;)g.push(b),b=wc();g!==i?(n.charCodeAt(f)===34?(b=ie,f++):(b=i,D===0&&H(Ne)),b!==i?(Y=l,h=Q(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;return q[S]={nextPos:f,result:l},l}function GS(){var l,h,g,b,S,P=f*49+16,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.substr(f,3)===ve?(h=ve,f+=3):(h=i,D===0&&H(Et)),h!==i)if(g=Je(),g===i&&(g=X),g!==i){for(b=[],S=Sc();S!==i;)b.push(S),S=Sc();b!==i?(n.substr(f,3)===ve?(S=ve,f+=3):(S=i,D===0&&H(Et)),S!==i?(Y=l,h=Q(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function yc(){var l,h,g,b,S=f*49+17,P=q[S];if(P)return f=P.nextPos,P.result;if(l=f,n.charCodeAt(f)===39?(h=Hr,f++):(h=i,D===0&&H(At)),h!==i){for(g=[],b=bc();b!==i;)g.push(b),b=bc();g!==i?(n.charCodeAt(f)===39?(b=Hr,f++):(b=i,D===0&&H(At)),b!==i?(Y=l,h=Q(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;return q[S]={nextPos:f,result:l},l}function wc(){var l,h,g,b=f*49+18,S=q[b];return S?(f=S.nextPos,S.result):(l=Pc(),l===i&&(l=f,h=f,D++,n.charCodeAt(f)===34?(g=ie,f++):(g=i,D===0&&H(Ne)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=nt(g),l=h):(f=l,l=u)):(f=l,l=u)),q[b]={nextPos:f,result:l},l)}function bc(){var l,h,g,b=f*49+19,S=q[b];return S?(f=S.nextPos,S.result):(l=f,h=f,D++,n.charCodeAt(f)===39?(g=Hr,f++):(g=i,D===0&&H(At)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=nt(g),l=h):(f=l,l=u)):(f=l,l=u),q[b]={nextPos:f,result:l},l)}function vc(){var l,h,g,b=f*49+20,S=q[b];return S?(f=S.nextPos,S.result):(l=Pc(),l===i&&(l=VS(),l===i&&(l=f,h=f,D++,n.substr(f,3)===I?(g=I,f+=3):(g=i,D===0&&H(O)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=se(g),l=h):(f=l,l=u)):(f=l,l=u))),q[b]={nextPos:f,result:l},l)}function VS(){var l,h,g,b,S,P=f*49+21,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.charCodeAt(f)===92?(h=lr,f++):(h=i,D===0&&H(Hs)),h!==i)if(g=Je(),g!==i){for(b=[],S=Tc();S!==i;)b.push(S),S=Tc();b!==i?(Y=l,h=Z(),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function Sc(){var l,h,g,b=f*49+22,S=q[b];return S?(f=S.nextPos,S.result):(l=f,h=f,D++,n.substr(f,3)===ve?(g=ve,f+=3):(g=i,D===0&&H(Et)),D--,g===i?h=m:(f=h,h=u),h!==i?(n.length>f?(g=n.charAt(f),f++):(g=i,D===0&&H(y)),g!==i?(Y=l,h=nt(g),l=h):(f=l,l=u)):(f=l,l=u),q[b]={nextPos:f,result:l},l)}function KS(){var l,h,g,b,S=f*49+23,P=q[S];return P?(f=P.nextPos,P.result):(l=f,h=Ec(),h===i&&(h=Ks()),h!==i?(n.charCodeAt(f)===101?(g=he,f++):(g=i,D===0&&H(W)),g===i&&(n.charCodeAt(f)===69?(g=ne,f++):(g=i,D===0&&H(de))),g!==i?(b=Ks(),b!==i?(Y=l,h=Re(h,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,h=Ec(),h!==i&&(Y=l,h=ge(h)),l=h),q[S]={nextPos:f,result:l},l)}function Ec(){var l,h,g,b,S,P,N=f*49+24,K=q[N];return K?(f=K.nextPos,K.result):(l=f,n.charCodeAt(f)===43?(h=Wt,f++):(h=i,D===0&&H(xt)),h===i&&(h=X),h!==i?(g=f,b=Zr(),b!==i?(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i?(P=Zr(),P!==i?(b=[b,S,P],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=ju(g),l=h):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,n.charCodeAt(f)===45?(h=jr,f++):(h=i,D===0&&H(Wr)),h!==i?(g=f,b=Zr(),b!==i?(n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),S!==i?(P=Zr(),P!==i?(b=[b,S,P],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=Wu(g),l=h):(f=l,l=u)):(f=l,l=u)),q[N]={nextPos:f,result:l},l)}function ZS(){var l,h,g=f*49+25,b=q[g];return b?(f=b.nextPos,b.result):(l=f,h=Ks(),h!==i&&(Y=l,h=jv(h)),l=h,q[g]={nextPos:f,result:l},l)}function Ks(){var l,h,g,b,S,P=f*49+26,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.charCodeAt(f)===43?(h=Wt,f++):(h=i,D===0&&H(xt)),h===i&&(h=X),h!==i){if(g=[],b=ue(),b!==i)for(;b!==i;)g.push(b),b=ue();else g=u;g!==i?(b=f,D++,n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),D--,S===i?b=m:(f=b,b=u),b!==i?(Y=l,h=ju(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;if(l===i)if(l=f,n.charCodeAt(f)===45?(h=jr,f++):(h=i,D===0&&H(Wr)),h!==i){if(g=[],b=ue(),b!==i)for(;b!==i;)g.push(b),b=ue();else g=u;g!==i?(b=f,D++,n.charCodeAt(f)===46?(S=$,f++):(S=i,D===0&&H(F)),D--,S===i?b=m:(f=b,b=u),b!==i?(Y=l,h=Wu(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;return q[P]={nextPos:f,result:l},l}function YS(){var l,h,g=f*49+27,b=q[g];return b?(f=b.nextPos,b.result):(l=f,n.substr(f,4)===zu?(h=zu,f+=4):(h=i,D===0&&H(Wv)),h!==i&&(Y=l,h=zv()),l=h,l===i&&(l=f,n.substr(f,5)===Gu?(h=Gu,f+=5):(h=i,D===0&&H(Gv)),h!==i&&(Y=l,h=Vv()),l=h),q[g]={nextPos:f,result:l},l)}function JS(){var l,h,g,b,S,P=f*49+28,N=q[P];if(N)return f=N.nextPos,N.result;if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){for(g=[],b=Ye();b!==i;)g.push(b),b=Ye();g!==i?(n.charCodeAt(f)===93?(b=A,f++):(b=i,D===0&&H(w)),b!==i?(Y=l,h=Kv(),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;if(l===i&&(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i?(g=Ac(),g===i&&(g=X),g!==i?(n.charCodeAt(f)===93?(b=A,f++):(b=i,D===0&&H(w)),b!==i?(Y=l,h=Zv(g),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u),l===i)){if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){if(g=[],b=Bn(),b!==i)for(;b!==i;)g.push(b),b=Bn();else g=u;g!==i?(n.charCodeAt(f)===93?(b=A,f++):(b=i,D===0&&H(w)),b!==i?(Y=l,h=Yv(g),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;if(l===i)if(l=f,n.charCodeAt(f)===91?(h=v,f++):(h=i,D===0&&H(E)),h!==i){if(g=[],b=Bn(),b!==i)for(;b!==i;)g.push(b),b=Bn();else g=u;g!==i?(b=Ac(),b!==i?(n.charCodeAt(f)===93?(S=A,f++):(S=i,D===0&&H(w)),S!==i?(Y=l,h=Jv(g,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;}return q[P]={nextPos:f,result:l},l}function Ac(){var l,h,g,b,S,P=f*49+29,N=q[P];if(N)return f=N.nextPos,N.result;for(l=f,h=[],g=Ye();g!==i;)h.push(g),g=Ye();if(h!==i)if(g=ur(),g!==i){for(b=[],S=Ye();S!==i;)b.push(S),S=Ye();b!==i?(Y=l,h=Vu(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;return q[P]={nextPos:f,result:l},l}function Bn(){var l,h,g,b,S,P,N,K=f*49+30,re=q[K];if(re)return f=re.nextPos,re.result;for(l=f,h=[],g=Ye();g!==i;)h.push(g),g=Ye();if(h!==i)if(g=ur(),g!==i){for(b=[],S=Ye();S!==i;)b.push(S),S=Ye();if(b!==i)if(n.charCodeAt(f)===44?(S=Ku,f++):(S=i,D===0&&H(Zu)),S!==i){for(P=[],N=Ye();N!==i;)P.push(N),N=Ye();P!==i?(Y=l,h=Vu(g),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;return q[K]={nextPos:f,result:l},l}function Ye(){var l,h=f*49+31,g=q[h];return g?(f=g.nextPos,g.result):(l=J(),l===i&&(l=Je(),l===i&&(l=qn())),q[h]={nextPos:f,result:l},l)}function XS(){var l,h,g,b,S,P,N=f*49+32,K=q[N];if(K)return f=K.nextPos,K.result;if(l=f,n.charCodeAt(f)===123?(h=Xv,f++):(h=i,D===0&&H(Qv)),h!==i){for(g=[],b=J();b!==i;)g.push(b),b=J();if(g!==i){for(b=[],S=xc();S!==i;)b.push(S),S=xc();if(b!==i){for(S=[],P=J();P!==i;)S.push(P),P=J();S!==i?(n.charCodeAt(f)===125?(P=eS,f++):(P=i,D===0&&H(tS)),P!==i?(Y=l,h=rS(b),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;}else f=l,l=u;}else f=l,l=u;return q[N]={nextPos:f,result:l},l}function xc(){var l,h,g,b,S,P,N,K,re,ce,le,pe=f*49+33,ye=q[pe];if(ye)return f=ye.nextPos,ye.result;for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===61?(S=B,f++):(S=i,D===0&&H(R)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();if(P!==i)if(N=ur(),N!==i){for(K=[],re=J();re!==i;)K.push(re),re=J();if(K!==i)if(n.charCodeAt(f)===44?(re=Ku,f++):(re=i,D===0&&H(Zu)),re!==i){for(ce=[],le=J();le!==i;)ce.push(le),le=J();ce!==i?(Y=l,h=Yu(g,N),l=h):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;if(l===i){for(l=f,h=[],g=J();g!==i;)h.push(g),g=J();if(h!==i)if(g=Kr(),g!==i){for(b=[],S=J();S!==i;)b.push(S),S=J();if(b!==i)if(n.charCodeAt(f)===61?(S=B,f++):(S=i,D===0&&H(R)),S!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(N=ur(),N!==i?(Y=l,h=Yu(g,N),l=h):(f=l,l=u)):(f=l,l=u);}else f=l,l=u;else f=l,l=u;}else f=l,l=u;else f=l,l=u;}return q[pe]={nextPos:f,result:l},l}function Cc(){var l,h,g,b=f*49+34,S=q[b];return S?(f=S.nextPos,S.result):(l=f,n.charCodeAt(f)===46?(h=$,f++):(h=i,D===0&&H(F)),h!==i?(g=Zr(),g!==i?(Y=l,h=nS(g),l=h):(f=l,l=u)):(f=l,l=u),q[b]={nextPos:f,result:l},l)}function Rc(){var l,h,g,b,S,P,N,K,re,ce,le,pe,ye=f*49+35,Ge=q[ye];return Ge?(f=Ge.nextPos,Ge.result):(l=f,h=f,g=ue(),g!==i?(b=ue(),b!==i?(S=ue(),S!==i?(P=ue(),P!==i?(n.charCodeAt(f)===45?(N=jr,f++):(N=i,D===0&&H(Wr)),N!==i?(K=ue(),K!==i?(re=ue(),re!==i?(n.charCodeAt(f)===45?(ce=jr,f++):(ce=i,D===0&&H(Wr)),ce!==i?(le=ue(),le!==i?(pe=ue(),pe!==i?(g=[g,b,S,P,N,K,re,ce,le,pe],h=g):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(Y=l,h=iS(h)),l=h,q[ye]={nextPos:f,result:l},l)}function QS(){var l,h,g,b,S,P,N,K,re,ce,le,pe=f*49+36,ye=q[pe];return ye?(f=ye.nextPos,ye.result):(l=f,h=f,g=ue(),g!==i?(b=ue(),b!==i?(n.charCodeAt(f)===58?(S=zr,f++):(S=i,D===0&&H(Gr)),S!==i?(P=ue(),P!==i?(N=ue(),N!==i?(n.charCodeAt(f)===58?(K=zr,f++):(K=i,D===0&&H(Gr)),K!==i?(re=ue(),re!==i?(ce=ue(),ce!==i?(le=Cc(),le===i&&(le=X),le!==i?(g=[g,b,S,P,N,K,re,ce,le],h=g):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(Y=l,h=Ju(h)),l=h,q[pe]={nextPos:f,result:l},l)}function eE(){var l,h,g,b,S,P,N,K,re,ce,le,pe,ye,Ge,cr,Ct,Ve,Mc=f*49+37,Ys=q[Mc];return Ys?(f=Ys.nextPos,Ys.result):(l=f,h=f,g=ue(),g!==i?(b=ue(),b!==i?(n.charCodeAt(f)===58?(S=zr,f++):(S=i,D===0&&H(Gr)),S!==i?(P=ue(),P!==i?(N=ue(),N!==i?(n.charCodeAt(f)===58?(K=zr,f++):(K=i,D===0&&H(Gr)),K!==i?(re=ue(),re!==i?(ce=ue(),ce!==i?(le=Cc(),le===i&&(le=X),le!==i?(n.charCodeAt(f)===45?(pe=jr,f++):(pe=i,D===0&&H(Wr)),pe===i&&(n.charCodeAt(f)===43?(pe=Wt,f++):(pe=i,D===0&&H(xt))),pe!==i?(ye=ue(),ye!==i?(Ge=ue(),Ge!==i?(n.charCodeAt(f)===58?(cr=zr,f++):(cr=i,D===0&&H(Gr)),cr!==i?(Ct=ue(),Ct!==i?(Ve=ue(),Ve!==i?(g=[g,b,S,P,N,K,re,ce,le,pe,ye,Ge,cr,Ct,Ve],h=g):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(Y=l,h=Ju(h)),l=h,q[Mc]={nextPos:f,result:l},l)}function tE(){var l,h,g,b,S,P=f*49+38,N=q[P];return N?(f=N.nextPos,N.result):(l=f,h=Rc(),h!==i?(n.charCodeAt(f)===84?(g=Xu,f++):(g=i,D===0&&H(Qu)),g!==i?(b=QS(),b!==i?(n.charCodeAt(f)===90?(S=sS,f++):(S=i,D===0&&H(oS)),S!==i?(Y=l,h=aS(h,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,h=Rc(),h!==i?(n.charCodeAt(f)===84?(g=Xu,f++):(g=i,D===0&&H(Qu)),g!==i?(b=eE(),b!==i?(Y=l,h=lS(h,b),l=h):(f=l,l=u)):(f=l,l=u)):(f=l,l=u)),q[P]={nextPos:f,result:l},l)}function J(){var l,h=f*49+39,g=q[h];return g?(f=g.nextPos,g.result):(uS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(cS)),q[h]={nextPos:f,result:l},l)}function Je(){var l,h,g,b=f*49+40,S=q[b];return S?(f=S.nextPos,S.result):(n.charCodeAt(f)===10?(l=ec,f++):(l=i,D===0&&H(tc)),l===i&&(l=f,n.charCodeAt(f)===13?(h=fS,f++):(h=i,D===0&&H(hS)),h!==i?(n.charCodeAt(f)===10?(g=ec,f++):(g=i,D===0&&H(tc)),g!==i?(h=[h,g],l=h):(f=l,l=u)):(f=l,l=u)),q[b]={nextPos:f,result:l},l)}function Tc(){var l,h=f*49+41,g=q[h];return g?(f=g.nextPos,g.result):(l=Je(),l===i&&(l=J()),q[h]={nextPos:f,result:l},l)}function Un(){var l,h,g=f*49+42,b=q[g];return b?(f=b.nextPos,b.result):(l=f,D++,n.length>f?(h=n.charAt(f),f++):(h=i,D===0&&H(y)),D--,h===i?l=m:(f=l,l=u),q[g]={nextPos:f,result:l},l)}function Xe(){var l,h=f*49+43,g=q[h];return g?(f=g.nextPos,g.result):(dS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(pS)),q[h]={nextPos:f,result:l},l)}function ue(){var l,h,g=f*49+44,b=q[g];return b?(f=b.nextPos,b.result):(mS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(_S)),l===i&&(l=f,n.charCodeAt(f)===95?(h=gS,f++):(h=i,D===0&&H(yS)),h!==i&&(Y=l,h=wS()),l=h),q[g]={nextPos:f,result:l},l)}function Ic(){var l,h=f*49+45,g=q[h];return g?(f=g.nextPos,g.result):(bS.test(n.charAt(f))?(l=n.charAt(f),f++):(l=i,D===0&&H(vS)),q[h]={nextPos:f,result:l},l)}function Zr(){var l,h,g,b=f*49+46,S=q[b];if(S)return f=S.nextPos,S.result;if(l=f,h=[],g=ue(),g!==i)for(;g!==i;)h.push(g),g=ue();else h=u;return h!==i&&(Y=l,h=SS(h)),l=h,q[b]={nextPos:f,result:l},l}function Pc(){var l,h,g=f*49+47,b=q[g];return b?(f=b.nextPos,b.result):(l=f,n.substr(f,2)===rc?(h=rc,f+=2):(h=i,D===0&&H(ES)),h!==i&&(Y=l,h=AS()),l=h,l===i&&(l=f,n.substr(f,2)===nc?(h=nc,f+=2):(h=i,D===0&&H(xS)),h!==i&&(Y=l,h=CS()),l=h,l===i&&(l=f,n.substr(f,2)===ic?(h=ic,f+=2):(h=i,D===0&&H(RS)),h!==i&&(Y=l,h=TS()),l=h,l===i&&(l=f,n.substr(f,2)===sc?(h=sc,f+=2):(h=i,D===0&&H(IS)),h!==i&&(Y=l,h=PS()),l=h,l===i&&(l=f,n.substr(f,2)===oc?(h=oc,f+=2):(h=i,D===0&&H(OS)),h!==i&&(Y=l,h=MS()),l=h,l===i&&(l=f,n.substr(f,2)===ac?(h=ac,f+=2):(h=i,D===0&&H(NS)),h!==i&&(Y=l,h=kS()),l=h,l===i&&(l=f,n.substr(f,2)===lc?(h=lc,f+=2):(h=i,D===0&&H($S)),h!==i&&(Y=l,h=LS()),l=h,l===i&&(l=rE()))))))),q[g]={nextPos:f,result:l},l)}function rE(){var l,h,g,b,S,P,N,K,re,ce,le,pe=f*49+48,ye=q[pe];return ye?(f=ye.nextPos,ye.result):(l=f,n.substr(f,2)===uc?(h=uc,f+=2):(h=i,D===0&&H(DS)),h!==i?(g=f,b=Xe(),b!==i?(S=Xe(),S!==i?(P=Xe(),P!==i?(N=Xe(),N!==i?(K=Xe(),K!==i?(re=Xe(),re!==i?(ce=Xe(),ce!==i?(le=Xe(),le!==i?(b=[b,S,P,N,K,re,ce,le],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=cc(g),l=h):(f=l,l=u)):(f=l,l=u),l===i&&(l=f,n.substr(f,2)===fc?(h=fc,f+=2):(h=i,D===0&&H(qS)),h!==i?(g=f,b=Xe(),b!==i?(S=Xe(),S!==i?(P=Xe(),P!==i?(N=Xe(),N!==i?(b=[b,S,P,N],g=b):(f=g,g=u)):(f=g,g=u)):(f=g,g=u)):(f=g,g=u),g!==i?(Y=l,h=cc(g),l=h):(f=l,l=u)):(f=l,l=u)),q[pe]={nextPos:f,result:l},l)}var Oc=[];function nE(l,h,g){var b=new Error(l);throw b.line=h,b.column=g,b}function Zs(l){Oc.push(l);}function Pe(l,h,g,b,S){var P={type:l,value:h,line:g(),column:b()};return S&&(P.key=S),P}function iE(l,h,g){var b=parseInt("0x"+l);if(!isFinite(b)||Math.floor(b)!=b||b<0||b>1114111||b>55295&&b<57344)nE("Invalid Unicode escape code: "+l,h,g);else return sE(b)}function sE(){var l=16384,h=[],g,b,S=-1,P=arguments.length;if(!P)return "";for(var N="";++S>10)+55296,b=K%1024+56320,h.push(g,b)),(S+1==P||h.length>l)&&(N+=String.fromCharCode.apply(null,h),h.length=0);}return N}if(Dn=a(),Dn!==i&&f===n.length)return Dn;throw Dn!==i&&f{function mk(t){var e=[],r=[],n="",s=Object.create(null),i=s;return a(t);function a(w){for(var x,M=0;M"u"?R===x.length-1?B[z]=M:B[z]=Object.create(null):R!==x.length-1&&r.indexOf($)>-1&&c("Cannot redefine existing key '"+$+"'.",k,j),B=B[z],B instanceof Array&&B.length&&R-1?'"'+w+'"':w}}nv.exports={compile:mk};});var ov=T((wD,sv)=>{var _k=rv(),gk=iv();sv.exports={parse:function(t){var e=_k.parse(t.toString());return gk.compile(e)}};});var yv=T((ar,gv)=>{var Iu=G("crypto");ar=gv.exports=Fn;function Fn(t,e){return e=mv(t,e),vk(t,e)}ar.sha1=function(t){return Fn(t)};ar.keys=function(t){return Fn(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};ar.MD5=function(t){return Fn(t,{algorithm:"md5",encoding:"hex"})};ar.keysMD5=function(t){return Fn(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Br=Iu.getHashes?Iu.getHashes().slice():["sha1","md5"];Br.push("passthrough");var dv=["buffer","hex","binary","base64"];function mv(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n"u"&&(r.write=r.update,r.end=r.update);var n=Pu(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var s=r.read();return e.encoding==="buffer"?s:s.toString(e.encoding)}ar.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=mv(t,e),Pu(e,r).dispatch(t)};function Pu(t,e,r){r=r||[];var n=function(s){return e.update?e.update(s,"utf8"):e.write(s,"utf8")};return {dispatch:function(s){t.replacer&&(s=t.replacer(s));var i=typeof s;return s===null&&(i="null"),this["_"+i](s)},_object:function(s){var i=/\[object (.*)\]/i,o=Object.prototype.toString.call(s),a=i.exec(o);a?a=a[1]:a="unknown:["+o+"]",a=a.toLowerCase();var c=null;if((c=r.indexOf(s))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(s),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return n("buffer:"),n(s);if(a!=="object"&&a!=="function"&&a!=="asyncfunction")if(this["_"+a])this["_"+a](s);else {if(t.ignoreUnknown)return n("["+a+"]");throw new Error('Unknown object type "'+a+'"')}else {var d=Object.keys(s);t.unorderedObjects&&(d=d.sort()),t.respectType!==!1&&!pv(s)&&d.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(d=d.filter(function(p){return !t.excludeKeys(p)})),n("object:"+d.length+":");var u=this;return d.forEach(function(p){u.dispatch(p),n(":"),t.excludeValues||u.dispatch(s[p]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(d){return o.dispatch(d)});var a=[],c=s.map(function(d){var u=new _v,p=r.slice(),_=Pu(t,u,p);return _.dispatch(d),a=a.concat(p.slice(r.length)),u.read().toString()});return r=r.concat(a),c.sort(),this._array(c,!1)},_date:function(s){return n("date:"+s.toJSON())},_symbol:function(s){return n("symbol:"+s.toString())},_error:function(s){return n("error:"+s.toString())},_boolean:function(s){return n("bool:"+s.toString())},_string:function(s){n("string:"+s.length+":"),n(s.toString());},_function:function(s){n("fn:"),pv(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this._object(s);},_number:function(s){return n("number:"+s.toString())},_xml:function(s){return n("xml:"+s.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(s){return n("regex:"+s.toString())},_uint8array:function(s){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint8clampedarray:function(s){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},_int8array:function(s){return n("int8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint16array:function(s){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},_int16array:function(s){return n("int16array:"),this.dispatch(Array.prototype.slice.call(s))},_uint32array:function(s){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},_int32array:function(s){return n("int32array:"),this.dispatch(Array.prototype.slice.call(s))},_float32array:function(s){return n("float32array:"),this.dispatch(Array.prototype.slice.call(s))},_float64array:function(s){return n("float64array:"),this.dispatch(Array.prototype.slice.call(s))},_arraybuffer:function(s){return n("arraybuffer:"),this.dispatch(new Uint8Array(s))},_url:function(s){return n("url:"+s.toString())},_map:function(s){n("map:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_set:function(s){n("set:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_file:function(s){return n("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported (see https://github.com/puleos/object-hash/issues/26) Use "options.replacer" or "options.ignoreUnknown" -`)},_domwindow:function(){return n("domwindow")},_bigint:function(s){return n("bigint:"+s.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function h0(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var $c=R((wB,C0)=>{var Tc=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let s=Math.ceil(1/(r-1)),i=n*s;this._thresh=i,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):ee)return Ri(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}C0.exports={Binning:Tc,shorten:Ri};});var O0=R((SB,R0)=>{var{Binning:gq}=$c(),yq="stats-logscale/univariate@1.0",Oi=class t extends gq{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new Pi(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),s=this.storage.get(n)??0;this.storage.set(n,s+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],s=Number.parseFloat(r[1]);if(Number.isNaN(s))throw new Error("Attempt to provide a non-numeric weight");let i=this.round(n),o=(this.storage.get(i)??0)+s;o<=0?(this.storage.delete(i),this._count+=s-o):(this.storage.set(i,o),this._count+=s);}),this}toJSON(){return {version:yq,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((l,c)=>l[0]-c[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(l=>l[0]>=r&&l[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[l,c]of this._cache.data)l<=s[0]?s[1]+=c:l>=i[0]?i[1]+=c:o.push([l,c]);return i[1]>0&&o.push(i),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),s=0,i=n.length;for(;s+1=r?i=c:s=c;}let o=this.lower(n[s][0]),l=this.upper(n[s][0])-o;return o+l*(r-n[s][1])/(n[s][2]-n[s][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),s=0,i=r.length;for(;s=r.length)return this._count;let o=s>0?r[s-1][2]:0,l=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+l}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,l=(n-r)/s;for(let c=0;c1;)i[c][0]-=i[c-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let c=0;for(let p=0;p{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=Oi.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');Oi.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let s=n.join(":");return this._cache[t][s]===void 0&&(this._cache[t][s]=r.apply(this,n)),this._cache[t][s]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var Pi=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{Pi.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{Pi.prototype[t]=function(e){return this._main[t](e)};});R0.exports={Univariate:Oi};});var P0=R((bB,Ic)=>{(()=>{let{Binning:t}=$c(),{Univariate:e}=O0(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof Ic=="object"&&(Ic.exports=r);})();});var Mi=new Uint8Array(256),Ni=Mi.length;function Ko(){return Ni>Mi.length-16&&(ZE__default.default.randomFillSync(Mi),Ni=0),Mi.slice(Ni,Ni+=16)}var Be=[];for(let t=0;t<256;++t)Be.push((t+256).toString(16).slice(1));function Rf(t,e=0){return Be[t[e+0]]+Be[t[e+1]]+Be[t[e+2]]+Be[t[e+3]]+"-"+Be[t[e+4]]+Be[t[e+5]]+"-"+Be[t[e+6]]+Be[t[e+7]]+"-"+Be[t[e+8]]+Be[t[e+9]]+"-"+Be[t[e+10]]+Be[t[e+11]]+Be[t[e+12]]+Be[t[e+13]]+Be[t[e+14]]+Be[t[e+15]]}var Vo={randomUUID:ZE__default.default.randomUUID};function tA(t,e,r){if(Vo.randomUUID&&!e&&!t)return Vo.randomUUID();t=t||{};let n=t.random||(t.rng||Ko)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let s=0;s<16;++s)e[r+s]=n[s];return e}return Rf(n)}var Ar=tA;var Lc=Nn(wg());var ar={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function OC(t,e){return e}function Sg(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:$C(t)?1:t instanceof Set?3:t instanceof Map?4:5}function PC(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function TC(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Eg(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var bg=new Set(["[object Object]","[object Module]"]);function $C(t){if(!bg.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!bg.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function IC(t,e,r){let n={};for(let s of PC(t)){let i=[];for(let c of t)TC(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),l=xg(i,e,o);l!==ar.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:l,configurable:!0,enumerable:!0,writable:!0}):n[s]=l);}return n}function kC(t){return t.flat()}function LC(t){return new Set(Eg(t))}function FC(t){return new Map(Eg(t))}function Ag(t){return t.at(-1)}var el=Object.freeze({__proto__:null,mergeArrays:kC,mergeMaps:FC,mergeOthers:Ag,mergeRecords:IC,mergeSets:LC});function _g(...t){return qC({})(...t)}function qC(t,e){let r=DC(t,n);function n(...s){return xg(s,r,e)}return n}function DC(t,e){return {defaultMergeFunctions:el,mergeFunctions:{...el,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(el,r)).map(([r,n])=>n===!1?[r,Ag]:[r,n]))},metaDataUpdater:t.metaDataUpdater??OC,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:ar}}function xg(t,e,r){if(t.length===0)return;if(t.length===1)return tl(t,e,r);let n=Sg(t[0]);if(n!==0&&n!==5){for(let s=1;s{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var rl=new Set(["__proto__","prototype","constructor"]),HC=new Set("0123456789");function nl(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(rl.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(rl.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!HC.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i;}}switch(s&&(r+="\\"),n){case"property":{if(rl.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Cg(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function Rg(t,e){if(Cg(t,e))throw new Error("Cannot use string index")}function Og(t,e,r){if(!Kn(t)||typeof e!="string")return r===void 0?t:r;let n=nl(e);if(n.length===0)return r;for(let s=0;s0&&e[e.length-1].endsWith(` -`)&&e.push(""),e}function ge(t){return t.trim().length===0}var Lg=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],Fg=Lg.map(t=>t[0]),ws=Lg.map(t=>t[1]);function Ss(t){let e=[];for(let r of t)[["(",")"],["[","]"],["{","}"]].forEach(n=>{r===n[1]&&(e.length>0&&e[e.length-1]===n[0]?e.pop():e.push(r));}),"([{".includes(r)&&e.push(r),["'",'"',"`"].forEach(n=>{r===n&&(e.length>0&&e.includes(n)?e.splice(e.lastIndexOf(n),e.length-e.lastIndexOf(n)):e.push(r));});return e.join("")}function on(t,e){return qg.get(t,e)}function Yn(t){let e=new AbortController;for(let r of t){if(r?.aborted)return e.abort(r.reason),r;r?.addEventListener("abort",()=>e.abort(r.reason),{signal:e.signal});}return e.signal}var at=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function bs(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof at&&[408,499].indexOf(t.status)!==-1}function an(t){return t instanceof Error&&t.name==="AbortError"}function sl(t){this.message=t;}sl.prototype=new Error,sl.prototype.name="InvalidCharacterError";var Dg=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new sl("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function QC(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(Dg(r).replace(/(.)/g,function(n,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return Dg(e)}}function Es(t){this.message=t;}function ZC(t,e){if(typeof t!="string")throw new Es("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(QC(t.split(".")[r]))}catch(n){throw new Es("Invalid token specified: "+n.message)}}Es.prototype=new Error,Es.prototype.name="InvalidTokenError";var As=ZC;Jn();var Fs=(()=>{let t=z("path").join(z("os").homedir(),".tabby-client","agent","data.json"),e=Al();return {data:{},load:async function(){await this.migrateFrom_0_3_0(),this.data=await e.readJson(t,{throws:!1})||{};},save:async function(){await e.outputJson(t,this.data);},migrateFrom_0_3_0:async function(){let r=z("path").join(z("os").homedir(),".tabby","agent","data.json"),n=z("path").join(z("os").homedir(),".tabby","agent",".data_json_migrated");if(await e.pathExists(r)&&!await e.pathExists(n)){let s=await e.readJson(r);await e.outputJson(t,s),await e.outputFile(n,"");}}}})();Nt();var lt=class lt extends events.EventEmitter{constructor(r){super();this.logger=Ce.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,this.dataStore=r.dataStore||Fs,this.authApi=Or({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static async create(r){let n=new lt(r);return await n.load(),n}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:As(r)};n.payload.exp*1e3-Date.now()"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=null,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error)throw new at(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(lt.authPageUrl);return i.searchParams.append("code",s.data.code),{authUrl:i.toString(),code:s.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((s,i)=>{let o=Yn([AbortSignal.timeout(lt.tokenStrategy.polling.timeout),n?.signal]),l=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new at(c.response);let p=c.data;this.logger.debug({result:p},"Poll jwt response"),this.jwt={token:p.data.jwt,payload:As(p.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(l),s(!0);}catch(c){c instanceof at&&[400,401,403,405].indexOf(c.status)!==-1?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},lt.tokenStrategy.polling.interval);o.aborted?(clearInterval(l),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(l),i(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},s=0){try{this.logger.debug({retry:s},"Start to refresh token");let i=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(i.error)throw new at(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:As(o.data.jwt)}}catch(i){if(i instanceof at&&[400,401,403,405].indexOf(i.status)!==-1)this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),ssetTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw {...i,retry:s}}}scheduleRefreshToken(){this.refreshTokenTimer=setInterval(async()=>{if(!this.jwt)return null;if(this.jwt.payload.exp*1e3-Date.now(){var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize();}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(t,e)=>{throw e},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",scriptDirectory="",read_,readAsync,readBinary;function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}function logExceptionOnExit(t){t instanceof ExitStatus||err("exiting due to exception: "+t);}if(ENVIRONMENT_IS_NODE){var fs=G("fs"),nodePath=G("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(t,e)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFileSync(t,e?void 0:"utf8")),readBinary=t=>{var e=read_(t,!0);return e.buffer||(e=new Uint8Array(e)),e},readAsync=(t,e,r)=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFile(t,function(n,s){n?r(n):e(s.buffer);});},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(t,e)=>{if(keepRuntimeAlive())throw process.exitCode=t,e;logExceptionOnExit(e),process.exit(t);},Module.inspect=function(){return "[Emscripten Module object]"};}else (ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.indexOf("blob:")!==0?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),readAsync=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):r();},n.onerror=r,n.send(null);},t=>document.title=t);Module.print||console.log.bind(console);var err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var STACK_ALIGN=16,dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var noExitRuntime=Module.noExitRuntime||!0,wasmMemory;typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function UTF8ArrayToString(t,e,r){for(var n=e+r,s=e;t[s]&&!(s>=n);)++s;if(s-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,s));for(var i="";e>10,56320|1023&d);}}else i+=String.fromCharCode((31&o)<<6|a);}else i+=String.fromCharCode(o);}return i}function UTF8ToString(t,e){return t?UTF8ArrayToString(HEAPU8,t,e):""}function stringToUTF8Array(t,e,r,n){if(!(n>0))return 0;for(var s=r,i=r+n-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=i)break;e[r++]=a;}else if(a<=2047){if(r+1>=i)break;e[r++]=192|a>>6,e[r++]=128|63&a;}else if(a<=65535){if(r+2>=i)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a;}else {if(r+3>=i)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a;}}return e[r]=0,r-s}function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}function lengthBytesUTF8(t){for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3;}return e}function updateGlobalBufferAndViews(t){buffer=t,Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=new Uint16Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t);}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),wasmMemory&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var wasmTable=new WebAssembly.Table({initial:20,element:"anyfunc"}),__ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(t){__ATPRERUN__.unshift(t);}function addOnInit(t){__ATINIT__.unshift(t);}function addOnPostRun(t){__ATPOSTRUN__.unshift(t);}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies);}function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e();}}function abort(t){throw Module.onAbort&&Module.onAbort(t),err(t="Aborted("+t+")"),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var dataURIPrefix="data:application/octet-stream;base64,",wasmBinaryFile,tempDouble,tempI64;function isDataURI(t){return t.startsWith(dataURIPrefix)}function isFileURI(t){return t.startsWith("file://")}function getBinary(t){try{if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw "both async and sync fetching of the wasm failed"}catch(e){abort(e);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw "failed to load wasm binary file at '"+wasmBinaryFile+"'";return t.arrayBuffer()}).catch(function(){return getBinary(wasmBinaryFile)});if(readAsync)return new Promise(function(t,e){readAsync(wasmBinaryFile,function(r){t(new Uint8Array(r));},e);})}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var t={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg,"GOT.mem":new Proxy(asmLibraryArg,GOTHandler),"GOT.func":new Proxy(asmLibraryArg,GOTHandler)};function e(s,i){var o=s.exports;o=relocateExports(o,1024);var a=getDylinkMetadata(i);a.neededDynlibs&&(dynamicLibraries=a.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(o),Module.asm=o,addOnInit(Module.asm.__wasm_call_ctors),__RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs),removeRunDependency();}function r(s){e(s.instance,s.module);}function n(s){return getBinaryPromise().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(s,function(i){err("failed to asynchronously prepare wasm: "+i),abort(i);})}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(s){return err("Module.instantiateWasm callback failed with error: "+s),!1}return wasmBinary||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(s){return WebAssembly.instantiateStreaming(s,t).then(r,function(i){return err("wasm streaming compile failed: "+i),err("falling back to ArrayBuffer instantiation"),n(r)})}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));function ExitStatus(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t;}var GOT={},CurrentModuleWeakSymbols=new Set([]),GOTHandler={get:function(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),CurrentModuleWeakSymbols.has(e)||(r.required=!0),r}};function callRuntimeCallbacks(t){for(;t.length>0;)t.shift()(Module);}function getDylinkMetadata(t){var e=0,r=0;function n(){for(var A=0,w=1;;){var x=t[e++];if(A+=(127&x)*w,w*=128,!(128&x))break}return A}function s(){var A=n();return UTF8ArrayToString(t,(e+=A)-A,A)}function i(A,w){if(A)throw new Error(w)}var o="dylink.0";if(t instanceof WebAssembly.Module){var a=WebAssembly.Module.customSections(t,o);a.length===0&&(o="dylink",a=WebAssembly.Module.customSections(t,o)),i(a.length===0,"need dylink section"),r=(t=new Uint8Array(a[0])).length;}else {i(new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),i(t[8]!==0,"need the dylink section to be first"),e=9;var c=n();r=e+c,o=s();}var d={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(o=="dylink"){d.memorySize=n(),d.memoryAlign=n(),d.tableSize=n(),d.tableAlign=n();for(var u=n(),p=0;p>0];case"i16":return HEAP16[t>>1];case"i32":case"i64":return HEAP32[t>>2];case"float":return HEAPF32[t>>2];case"double":return HEAPF64[t>>3];case"*":return HEAPU32[t>>2];default:abort("invalid type for getValue: "+e);}return null}function asmjsMangle(t){return t.indexOf("dynCall_")==0||["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"].includes(t)?t:"_"+t}function mergeLibSymbols(t,e){for(var r in t)if(t.hasOwnProperty(r)){asmLibraryArg.hasOwnProperty(r)||(asmLibraryArg[r]=t[r]);var n=asmjsMangle(r);Module.hasOwnProperty(n)||(Module[n]=t[r]),r=="__main_argc_argv"&&(Module._main=t[r]);}}var LDSO={loadedLibsByName:{},loadedLibsByHandle:{}};function dynCallLegacy(t,e,r){var n=Module["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}var wasmTableMirror=[];function getWasmTableEntry(t){var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e}function dynCall(t,e,r){return t.includes("j")?dynCallLegacy(t,e,r):getWasmTableEntry(e).apply(null,r)}function createInvokeFunction(t){return function(){var e=stackSave();try{return dynCall(t,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(e),r!==r+0)throw r;_setThrew(1,0);}}}var ___heap_base=78144;function zeroMemory(t,e){return HEAPU8.fill(0,t,t+e),t}function getMemory(t){if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+t+15&-16;return ___heap_base=r,GOT.__heap_base.value=r,e}function isInternalSym(t){return ["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm"].includes(t)}function uleb128Encode(t,e){t<128?e.push(t):e.push(t%128|128,t>>7);}function sigToWasmTypes(t){for(var e={i:"i32",j:"i32",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign);memAlign=Math.max(memAlign,STACK_ALIGN);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+12>>0]=1,HEAPU32[handle+16>>2]=memoryBase,HEAP32[handle+20>>2]=metadata.memorySize,HEAPU32[handle+24>>2]=tableBase,HEAP32[handle+28>>2]=metadata.tableSize);}else memoryBase=HEAPU32[handle+16>>2],tableBase=HEAPU32[handle+24>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t,!1);return e||(e=moduleExports[t]),e}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get:function(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in asmLibraryArg)return asmLibraryArg[e];var r;return e in t||(t[e]=function(){return r||(r=resolveSymbol(e)),r.apply(null,arguments)}),t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="("+args+" ) => { "+body+"};";eval(func);}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;startd(new Uint8Array(p)),u);});if(!readBinary)throw new Error(a+": file not found, and synchronous loading of external files is not available");return readBinary(a)}function i(){if(typeof preloadedWasm<"u"&&preloadedWasm[t]){var a=preloadedWasm[t];return e.loadAsync?Promise.resolve(a):a}return e.loadAsync?s(t).then(function(c){return loadWebAssemblyModule(c,e,r)}):loadWebAssemblyModule(s(t),e,r)}function o(a){n.global&&mergeLibSymbols(a),n.module=a;}return n={refcount:e.nodelete?1/0:1,name:t,module:"loading",global:e.global},LDSO.loadedLibsByName[t]=n,r&&(LDSO.loadedLibsByHandle[r]=n),e.loadAsync?i().then(function(a){return o(a),!0}):(o(i()),!0)}function reportUndefinedSymbols(){for(var t in GOT)if(GOT[t].value==0){var e=resolveGlobalSymbol(t,!0);if(!e&&!GOT[t].required)continue;if(typeof e=="function")GOT[t].value=addFunction(e,e.sig);else {if(typeof e!="number")throw new Error("bad export type for `"+t+"`: "+typeof e);GOT[t].value=e;}}}function preloadDylibs(){dynamicLibraries.length?(addRunDependency(),dynamicLibraries.reduce(function(t,e){return t.then(function(){return loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})})},Promise.resolve()).then(function(){reportUndefinedSymbols(),removeRunDependency();})):reportUndefinedSymbols();}function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[t>>0]=e;break;case"i16":HEAP16[t>>1]=e;break;case"i32":HEAP32[t>>2]=e;break;case"i64":tempI64=[e>>>0,(tempDouble=e,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case"float":HEAPF32[t>>2]=e;break;case"double":HEAPF64[t>>3]=e;break;case"*":HEAPU32[t>>2]=e;break;default:abort("invalid type for setValue: "+r);}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78144),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=!0,_emscripten_get_now;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function _abort(){abort("");}function _emscripten_memcpy_big(t,e,r){HEAPU8.copyWithin(t,e,e+r);}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(t){try{return wasmMemory.grow(t-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch{}}function _emscripten_resize_heap(t){var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return !1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);if(s=Math.min(s,t+100663296),emscripten_realloc_buffer(Math.min(r,(i=Math.max(t,s))+((o=65536)-i%o)%o)))return !0}var i,o;return !1}__emscripten_get_now_is_monotonic.sig="i",Module._abort=_abort,_abort.sig="v",_emscripten_get_now=ENVIRONMENT_IS_NODE?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),_emscripten_get_now.sig="d",_emscripten_memcpy_big.sig="vppp",_emscripten_resize_heap.sig="ip";var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(PATH.isAbs(e))return e;var n;if(t===-100?n=FS.cwd():n=SYSCALLS.getStreamFromFD(t).path,e.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,e)},doStat:function(t,e,r){try{var n=t(e);}catch(a){if(a&&a.node&&PATH.normalize(e)!==PATH.normalize(FS.getPath(a.node)))return -54;throw a}HEAP32[r>>2]=n.dev,HEAP32[r+8>>2]=n.ino,HEAP32[r+12>>2]=n.mode,HEAPU32[r+16>>2]=n.nlink,HEAP32[r+20>>2]=n.uid,HEAP32[r+24>>2]=n.gid,HEAP32[r+28>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=n.blocks;var s=n.atime.getTime(),i=n.mtime.getTime(),o=n.ctime.getTime();return tempI64=[Math.floor(s/1e3)>>>0,(tempDouble=Math.floor(s/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=s%1e3*1e3,tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=i%1e3*1e3,tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=o%1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(t,e,r,n,s){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);if(2&n)return 0;var i=HEAPU8.slice(t,t+r);FS.msync(e,i,s,r,n);},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(t){return UTF8ToString(t)},getStreamFromFD:function(t){var e=FS.getStream(t);if(!e)throw new FS.ErrnoError(8);return e}};function _proc_exit(t){EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit&&Module.onExit(t),ABORT=!0),quit_(t,new ExitStatus(t));}function exitJS(t,e){EXITSTATUS=t,_proc_exit(t);}_proc_exit.sig="vi";var _exit=exitJS;function _fd_close(t){try{var e=SYSCALLS.getStreamFromFD(t);return FS.close(e),0}catch(r){if(typeof FS>"u"||!(r instanceof FS.ErrnoError))throw r;return r.errno}}function convertI32PairToI53Checked(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}function _fd_seek(t,e,r,n,s){try{var i=convertI32PairToI53Checked(e,r);if(isNaN(i))return 61;var o=SYSCALLS.getStreamFromFD(t);return FS.llseek(o,i,n),tempI64=[o.position>>>0,(tempDouble=o.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[s>>2]=tempI64[0],HEAP32[s+4>>2]=tempI64[1],o.getdents&&i===0&&n===0&&(o.getdents=null),0}catch(a){if(typeof FS>"u"||!(a instanceof FS.ErrnoError))throw a;return a.errno}}function doWritev(t,e,r,n){for(var s=0,i=0;i>2],a=HEAPU32[e+4>>2];e+=8;var c=FS.write(t,HEAP8,o,a,n);if(c<0)return -1;s+=c,n!==void 0&&(n+=c);}return s}function _fd_write(t,e,r,n){try{var s=doWritev(SYSCALLS.getStreamFromFD(t),e,r);return HEAPU32[n>>2]=s,0}catch(i){if(typeof FS>"u"||!(i instanceof FS.ErrnoError))throw i;return i.errno}}function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0);}}function _tree_sitter_parse_callback(t,e,r,n,s){var i=currentParseCallback(e,{row:r,column:n});typeof i=="string"?(setValue(s,i.length,"i32"),stringToUTF16(i,t,10240)):setValue(s,0,"i32");}function handleException(t){if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t);}function allocateUTF8OnStack(t){var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8Array(t,HEAP8,r,e),r}function stringToUTF16(t,e,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=e,s=(r-=2)<2*t.length?r/2:t.length,i=0;i>1]=o,e+=2;}return HEAP16[e>>1]=0,e-n}function AsciiToString(t){for(var e="";;){var r=HEAPU8[t++>>0];if(!r)return e;e+=String.fromCharCode(r);}}_exit.sig="vi",_fd_close.sig="ii",_fd_seek.sig="iijip",_fd_write.sig="iippp";var asmLibraryArg={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,exit:_exit,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback};createWasm();Module.___wasm_call_ctors=function(){return (Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)};Module.___wasm_apply_data_relocs=function(){return (Module.___wasm_apply_data_relocs=Module.asm.__wasm_apply_data_relocs).apply(null,arguments)};var _malloc=Module._malloc=function(){return (_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)};Module._calloc=function(){return (Module._calloc=Module.asm.calloc).apply(null,arguments)};Module._realloc=function(){return (Module._realloc=Module.asm.realloc).apply(null,arguments)};Module._free=function(){return (Module._free=Module.asm.free).apply(null,arguments)};Module._ts_language_symbol_count=function(){return (Module._ts_language_symbol_count=Module.asm.ts_language_symbol_count).apply(null,arguments)};Module._ts_language_version=function(){return (Module._ts_language_version=Module.asm.ts_language_version).apply(null,arguments)};Module._ts_language_field_count=function(){return (Module._ts_language_field_count=Module.asm.ts_language_field_count).apply(null,arguments)};Module._ts_language_symbol_name=function(){return (Module._ts_language_symbol_name=Module.asm.ts_language_symbol_name).apply(null,arguments)};Module._ts_language_symbol_for_name=function(){return (Module._ts_language_symbol_for_name=Module.asm.ts_language_symbol_for_name).apply(null,arguments)};Module._ts_language_symbol_type=function(){return (Module._ts_language_symbol_type=Module.asm.ts_language_symbol_type).apply(null,arguments)};Module._ts_language_field_name_for_id=function(){return (Module._ts_language_field_name_for_id=Module.asm.ts_language_field_name_for_id).apply(null,arguments)};Module._memset=function(){return (Module._memset=Module.asm.memset).apply(null,arguments)};Module._memcpy=function(){return (Module._memcpy=Module.asm.memcpy).apply(null,arguments)};Module._ts_parser_delete=function(){return (Module._ts_parser_delete=Module.asm.ts_parser_delete).apply(null,arguments)};Module._ts_parser_reset=function(){return (Module._ts_parser_reset=Module.asm.ts_parser_reset).apply(null,arguments)};Module._ts_parser_set_language=function(){return (Module._ts_parser_set_language=Module.asm.ts_parser_set_language).apply(null,arguments)};Module._ts_parser_timeout_micros=function(){return (Module._ts_parser_timeout_micros=Module.asm.ts_parser_timeout_micros).apply(null,arguments)};Module._ts_parser_set_timeout_micros=function(){return (Module._ts_parser_set_timeout_micros=Module.asm.ts_parser_set_timeout_micros).apply(null,arguments)};Module._memmove=function(){return (Module._memmove=Module.asm.memmove).apply(null,arguments)};Module._memcmp=function(){return (Module._memcmp=Module.asm.memcmp).apply(null,arguments)};Module._ts_query_new=function(){return (Module._ts_query_new=Module.asm.ts_query_new).apply(null,arguments)};Module._ts_query_delete=function(){return (Module._ts_query_delete=Module.asm.ts_query_delete).apply(null,arguments)};Module._iswspace=function(){return (Module._iswspace=Module.asm.iswspace).apply(null,arguments)};Module._iswalnum=function(){return (Module._iswalnum=Module.asm.iswalnum).apply(null,arguments)};Module._ts_query_pattern_count=function(){return (Module._ts_query_pattern_count=Module.asm.ts_query_pattern_count).apply(null,arguments)};Module._ts_query_capture_count=function(){return (Module._ts_query_capture_count=Module.asm.ts_query_capture_count).apply(null,arguments)};Module._ts_query_string_count=function(){return (Module._ts_query_string_count=Module.asm.ts_query_string_count).apply(null,arguments)};Module._ts_query_capture_name_for_id=function(){return (Module._ts_query_capture_name_for_id=Module.asm.ts_query_capture_name_for_id).apply(null,arguments)};Module._ts_query_string_value_for_id=function(){return (Module._ts_query_string_value_for_id=Module.asm.ts_query_string_value_for_id).apply(null,arguments)};Module._ts_query_predicates_for_pattern=function(){return (Module._ts_query_predicates_for_pattern=Module.asm.ts_query_predicates_for_pattern).apply(null,arguments)};Module._ts_tree_copy=function(){return (Module._ts_tree_copy=Module.asm.ts_tree_copy).apply(null,arguments)};Module._ts_tree_delete=function(){return (Module._ts_tree_delete=Module.asm.ts_tree_delete).apply(null,arguments)};Module._ts_init=function(){return (Module._ts_init=Module.asm.ts_init).apply(null,arguments)};Module._ts_parser_new_wasm=function(){return (Module._ts_parser_new_wasm=Module.asm.ts_parser_new_wasm).apply(null,arguments)};Module._ts_parser_enable_logger_wasm=function(){return (Module._ts_parser_enable_logger_wasm=Module.asm.ts_parser_enable_logger_wasm).apply(null,arguments)};Module._ts_parser_parse_wasm=function(){return (Module._ts_parser_parse_wasm=Module.asm.ts_parser_parse_wasm).apply(null,arguments)};Module._ts_language_type_is_named_wasm=function(){return (Module._ts_language_type_is_named_wasm=Module.asm.ts_language_type_is_named_wasm).apply(null,arguments)};Module._ts_language_type_is_visible_wasm=function(){return (Module._ts_language_type_is_visible_wasm=Module.asm.ts_language_type_is_visible_wasm).apply(null,arguments)};Module._ts_tree_root_node_wasm=function(){return (Module._ts_tree_root_node_wasm=Module.asm.ts_tree_root_node_wasm).apply(null,arguments)};Module._ts_tree_edit_wasm=function(){return (Module._ts_tree_edit_wasm=Module.asm.ts_tree_edit_wasm).apply(null,arguments)};Module._ts_tree_get_changed_ranges_wasm=function(){return (Module._ts_tree_get_changed_ranges_wasm=Module.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)};Module._ts_tree_cursor_new_wasm=function(){return (Module._ts_tree_cursor_new_wasm=Module.asm.ts_tree_cursor_new_wasm).apply(null,arguments)};Module._ts_tree_cursor_delete_wasm=function(){return (Module._ts_tree_cursor_delete_wasm=Module.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)};Module._ts_tree_cursor_reset_wasm=function(){return (Module._ts_tree_cursor_reset_wasm=Module.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_first_child_wasm=function(){return (Module._ts_tree_cursor_goto_first_child_wasm=Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return (Module._ts_tree_cursor_goto_next_sibling_wasm=Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_parent_wasm=function(){return (Module._ts_tree_cursor_goto_parent_wasm=Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_type_id_wasm=function(){return (Module._ts_tree_cursor_current_node_type_id_wasm=Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_named_wasm=function(){return (Module._ts_tree_cursor_current_node_is_named_wasm=Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return (Module._ts_tree_cursor_current_node_is_missing_wasm=Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_id_wasm=function(){return (Module._ts_tree_cursor_current_node_id_wasm=Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_position_wasm=function(){return (Module._ts_tree_cursor_start_position_wasm=Module.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_position_wasm=function(){return (Module._ts_tree_cursor_end_position_wasm=Module.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_index_wasm=function(){return (Module._ts_tree_cursor_start_index_wasm=Module.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_index_wasm=function(){return (Module._ts_tree_cursor_end_index_wasm=Module.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_field_id_wasm=function(){return (Module._ts_tree_cursor_current_field_id_wasm=Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_wasm=function(){return (Module._ts_tree_cursor_current_node_wasm=Module.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)};Module._ts_node_symbol_wasm=function(){return (Module._ts_node_symbol_wasm=Module.asm.ts_node_symbol_wasm).apply(null,arguments)};Module._ts_node_child_count_wasm=function(){return (Module._ts_node_child_count_wasm=Module.asm.ts_node_child_count_wasm).apply(null,arguments)};Module._ts_node_named_child_count_wasm=function(){return (Module._ts_node_named_child_count_wasm=Module.asm.ts_node_named_child_count_wasm).apply(null,arguments)};Module._ts_node_child_wasm=function(){return (Module._ts_node_child_wasm=Module.asm.ts_node_child_wasm).apply(null,arguments)};Module._ts_node_named_child_wasm=function(){return (Module._ts_node_named_child_wasm=Module.asm.ts_node_named_child_wasm).apply(null,arguments)};Module._ts_node_child_by_field_id_wasm=function(){return (Module._ts_node_child_by_field_id_wasm=Module.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)};Module._ts_node_next_sibling_wasm=function(){return (Module._ts_node_next_sibling_wasm=Module.asm.ts_node_next_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_sibling_wasm=function(){return (Module._ts_node_prev_sibling_wasm=Module.asm.ts_node_prev_sibling_wasm).apply(null,arguments)};Module._ts_node_next_named_sibling_wasm=function(){return (Module._ts_node_next_named_sibling_wasm=Module.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_named_sibling_wasm=function(){return (Module._ts_node_prev_named_sibling_wasm=Module.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)};Module._ts_node_parent_wasm=function(){return (Module._ts_node_parent_wasm=Module.asm.ts_node_parent_wasm).apply(null,arguments)};Module._ts_node_descendant_for_index_wasm=function(){return (Module._ts_node_descendant_for_index_wasm=Module.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_index_wasm=function(){return (Module._ts_node_named_descendant_for_index_wasm=Module.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_descendant_for_position_wasm=function(){return (Module._ts_node_descendant_for_position_wasm=Module.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_position_wasm=function(){return (Module._ts_node_named_descendant_for_position_wasm=Module.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_start_point_wasm=function(){return (Module._ts_node_start_point_wasm=Module.asm.ts_node_start_point_wasm).apply(null,arguments)};Module._ts_node_end_point_wasm=function(){return (Module._ts_node_end_point_wasm=Module.asm.ts_node_end_point_wasm).apply(null,arguments)};Module._ts_node_start_index_wasm=function(){return (Module._ts_node_start_index_wasm=Module.asm.ts_node_start_index_wasm).apply(null,arguments)};Module._ts_node_end_index_wasm=function(){return (Module._ts_node_end_index_wasm=Module.asm.ts_node_end_index_wasm).apply(null,arguments)};Module._ts_node_to_string_wasm=function(){return (Module._ts_node_to_string_wasm=Module.asm.ts_node_to_string_wasm).apply(null,arguments)};Module._ts_node_children_wasm=function(){return (Module._ts_node_children_wasm=Module.asm.ts_node_children_wasm).apply(null,arguments)};Module._ts_node_named_children_wasm=function(){return (Module._ts_node_named_children_wasm=Module.asm.ts_node_named_children_wasm).apply(null,arguments)};Module._ts_node_descendants_of_type_wasm=function(){return (Module._ts_node_descendants_of_type_wasm=Module.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)};Module._ts_node_is_named_wasm=function(){return (Module._ts_node_is_named_wasm=Module.asm.ts_node_is_named_wasm).apply(null,arguments)};Module._ts_node_has_changes_wasm=function(){return (Module._ts_node_has_changes_wasm=Module.asm.ts_node_has_changes_wasm).apply(null,arguments)};Module._ts_node_has_error_wasm=function(){return (Module._ts_node_has_error_wasm=Module.asm.ts_node_has_error_wasm).apply(null,arguments)};Module._ts_node_is_missing_wasm=function(){return (Module._ts_node_is_missing_wasm=Module.asm.ts_node_is_missing_wasm).apply(null,arguments)};Module._ts_query_matches_wasm=function(){return (Module._ts_query_matches_wasm=Module.asm.ts_query_matches_wasm).apply(null,arguments)};Module._ts_query_captures_wasm=function(){return (Module._ts_query_captures_wasm=Module.asm.ts_query_captures_wasm).apply(null,arguments)};Module.___cxa_atexit=function(){return (Module.___cxa_atexit=Module.asm.__cxa_atexit).apply(null,arguments)};Module._iswdigit=function(){return (Module._iswdigit=Module.asm.iswdigit).apply(null,arguments)};Module._iswalpha=function(){return (Module._iswalpha=Module.asm.iswalpha).apply(null,arguments)};Module._iswlower=function(){return (Module._iswlower=Module.asm.iswlower).apply(null,arguments)};Module._memchr=function(){return (Module._memchr=Module.asm.memchr).apply(null,arguments)};Module._strlen=function(){return (Module._strlen=Module.asm.strlen).apply(null,arguments)};Module._towupper=function(){return (Module._towupper=Module.asm.towupper).apply(null,arguments)};var _setThrew=Module._setThrew=function(){return (_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return (stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return (stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return (stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)};Module.__Znwm=function(){return (Module.__Znwm=Module.asm._Znwm).apply(null,arguments)};Module.__ZdlPv=function(){return (Module.__ZdlPv=Module.asm._ZdlPv).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)};Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return (Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null,arguments)};Module.dynCall_jiji=function(){return (Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)};Module._orig$ts_parser_timeout_micros=function(){return (Module._orig$ts_parser_timeout_micros=Module.asm.orig$ts_parser_timeout_micros).apply(null,arguments)};Module._orig$ts_parser_set_timeout_micros=function(){return (Module._orig$ts_parser_set_timeout_micros=Module.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)};var calledRun;function callMain(t){var e=Module._main;if(e){(t=t||[]).unshift(thisProgram);var r=t.length,n=stackAlloc(4*(r+1)),s=n>>2;t.forEach(o=>{HEAP32[s++]=allocateUTF8OnStack(o);}),HEAP32[s]=0;try{var i=e(r,n);return exitJS(i),i}catch(o){return handleException(o)}}}Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t);};var dylibsLoaded=!1;function run(t){function e(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(t),postRun()));}t=t||arguments_,runDependencies>0||!dylibsLoaded&&(preloadDylibs(),dylibsLoaded=!0,runDependencies>0)||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("");},1),e();},1)):e()));}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/;var VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0;}setLanguage(e){let r;if(e){if(e.constructor!==Language)throw new Error("Argument must be a Language");{r=e[0];let n=C._ts_language_version(r);if(ne.slice(c,u);else {if(typeof e!="function")throw new Error("Argument must be a string or a function");currentParseCallback=e;}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let s=0,i=0;if(n&&n.includedRanges){s=n.includedRanges.length,i=C._calloc(s,SIZE_OF_RANGE);let c=i;for(let d=0;d0){let i=n;for(let o=0;o0){let n=r;for(let s=0;s0){let n=r;for(let s=0;s0){let u=c;for(let p=0;p0){if(w[0].type!=="string")throw new Error("Predicates must begin with a literal value");let U=w[0].value,$=!0;switch(U){case"not-eq?":$=!1;case"eq?":if(w.length!==3)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(w.length-1));if(w[1].type!=="capture")throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${w[1].value}"`);if(w[2].type==="capture"){let z=w[1].name,V=w[2].name;y[v].push(function(te){let I,O;for(let X of te)X.name===z&&(I=X.node),X.name===V&&(O=X.node);return I===void 0||O===void 0||I.text===O.text===$});}else {let z=w[1].name,V=w[2].value;y[v].push(function(te){for(let I of te)if(I.name===z)return I.node.text===V===$;return !0});}break;case"not-match?":$=!1;case"match?":if(w.length!==3)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${w.length-1}.`);if(w[1].type!=="capture")throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${w[1].value}".`);if(w[2].type!=="string")throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${w[2].value}.`);let F=w[1].name,B=new RegExp(w[2].value);y[v].push(function(z){for(let V of z)if(V.name===F)return B.test(V.node.text)===$;return !0});break;case"set!":if(w.length<2||w.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${w.length-1}.`);if(w.some(z=>z.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');u[v]||(u[v]={}),u[v][w[1].value]=w[2]?w[2].value:null;break;case"is?":case"is-not?":if(w.length<2||w.length>3)throw new Error(`Wrong number of arguments to \`#${U}\` predicate. Expected 1 or 2. Got ${w.length-1}.`);if(w.some(z=>z.type!=="string"))throw new Error(`Arguments to \`#${U}\` predicate must be a strings.".`);let R=U==="is?"?p:_;R[v]||(R[v]={}),R[v][w[1].value]=w[2]?w[2].value:null;break;default:m[v].push({operator:U,operands:w.slice(1)});}w.length=0;}}Object.freeze(u[v]),Object.freeze(p[v]),Object.freeze(_[v]);}return C._free(n),new Query(INTERNAL,s,c,y,m,Object.freeze(u),Object.freeze(p),Object.freeze(_))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else {let s=e;if(typeof process<"u"&&process.versions&&process.versions.node){let i=G("fs");r=Promise.resolve(i.readFileSync(s));}else r=fetch(s).then(i=>i.arrayBuffer().then(o=>{if(i.ok)return new Uint8Array(o);{let a=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${i.status}. -## You can uncomment any block to enable settings. -## Configurations in this file has lower priority than in IDE settings. +${a}`)}}));}let n=typeof loadSideModule=="function"?loadSideModule:loadWebAssemblyModule;return r.then(s=>n(s,{loadAsync:!0})).then(s=>{let i=Object.keys(s),o=i.find(c=>LANGUAGE_FUNCTION_REGEX.test(c)&&!c.includes("external_scanner_"));o||console.log(`Couldn't find language function in WASM file. Symbols: +${JSON.stringify(i,null,2)}`);let a=s[o]();return new Language(INTERNAL,a)})}}class Query{constructor(e,r,n,s,i,o,a,c){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=s,this.predicates=i,this.setProperties=o,this.assertedProperties=a,this.refutedProperties=c,this.exceededMatchLimit=!1;}delete(){C._ts_query_delete(this[0]),this[0]=0;}matches(e,r,n,s){r||(r=ZERO_POINT),n||(n=ZERO_POINT),s||(s={});let i=s.matchLimit;if(i===void 0)i=0;else if(typeof i!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,i);let o=getValue(TRANSFER_BUFFER,"i32"),a=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=new Array(o);this.exceededMatchLimit=!!c;let u=0,p=a;for(let _=0;_E(v))){d[u++]={pattern:m,captures:v};let E=this.setProperties[m];E&&(d[_].setProperties=E);let A=this.assertedProperties[m];A&&(d[_].assertedProperties=A);let w=this.refutedProperties[m];w&&(d[_].refutedProperties=w);}}return d.length=u,C._free(a),d}captures(e,r,n,s){r||(r=ZERO_POINT),n||(n=ZERO_POINT),s||(s={});let i=s.matchLimit;if(i===void 0)i=0;else if(typeof i!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,i);let o=getValue(TRANSFER_BUFFER,"i32"),a=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=[];this.exceededMatchLimit=!!c;let u=[],p=a;for(let _=0;_E(u))){let E=u[v],A=this.setProperties[m];A&&(E.setProperties=A);let w=this.assertedProperties[m];w&&(E.assertedProperties=w);let x=this.refutedProperties[m];x&&(E.refutedProperties=x),d.push(E);}}return C._free(a),d}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,s=t.textCallback(e,null,r);for(e+=s.length;e0))break;e+=i.length,s+=i;}return e>r&&(s=s.slice(0,n)),s}function unmarshalCaptures(t,e,r,n){for(let s=0,i=n.length;s{ParserImpl.init(),resolveInitPromise();};}))}}return Parser}();typeof exports=="object"&&(module.exports=TreeSitter);});var qu=T((rB,Dv)=>{var Du=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let s=Math.ceil(1/(r-1)),i=n*s;this._thresh=i,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):ee)return Nn(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}Dv.exports={Binning:Du,shorten:Nn};});var Bv=T((nB,qv)=>{var{Binning:Ok}=qu(),Mk="stats-logscale/univariate@1.0",kn=class t extends Ok{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new $n(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),s=this.storage.get(n)??0;this.storage.set(n,s+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],s=Number.parseFloat(r[1]);if(Number.isNaN(s))throw new Error("Attempt to provide a non-numeric weight");let i=this.round(n),o=(this.storage.get(i)??0)+s;o<=0?(this.storage.delete(i),this._count+=s-o):(this.storage.set(i,o),this._count+=s);}),this}toJSON(){return {version:Mk,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((a,c)=>a[0]-c[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(a=>a[0]>=r&&a[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[a,c]of this._cache.data)a<=s[0]?s[1]+=c:a>=i[0]?i[1]+=c:o.push([a,c]);return i[1]>0&&o.push(i),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),s=0,i=n.length;for(;s+1=r?i=c:s=c;}let o=this.lower(n[s][0]),a=this.upper(n[s][0])-o;return o+a*(r-n[s][1])/(n[s][2]-n[s][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),s=0,i=r.length;for(;s=r.length)return this._count;let o=s>0?r[s-1][2]:0,a=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+a}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,a=(n-r)/s;for(let c=0;c1;)i[c][0]-=i[c-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let c=0;for(let d=0;d{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=kn.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');kn.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let s=n.join(":");return this._cache[t][s]===void 0&&(this._cache[t][s]=r.apply(this,n)),this._cache[t][s]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var $n=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{$n.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{$n.prototype[t]=function(e){return this._main[t](e)};});qv.exports={Univariate:kn};});var Uv=T((iB,Bu)=>{(()=>{let{Binning:t}=qu(),{Univariate:e}=Bv(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof Bu=="object"&&(Bu.exports=r);})();});var zn=new Uint8Array(256),Wn=zn.length;function Qs(){return Wn>zn.length-16&&(fE__default.default.randomFillSync(zn),Wn=0),zn.slice(Wn,Wn+=16)}var Oe=[];for(let t=0;t<256;++t)Oe.push((t+256).toString(16).slice(1));function Nc(t,e=0){return Oe[t[e+0]]+Oe[t[e+1]]+Oe[t[e+2]]+Oe[t[e+3]]+"-"+Oe[t[e+4]]+Oe[t[e+5]]+"-"+Oe[t[e+6]]+Oe[t[e+7]]+"-"+Oe[t[e+8]]+Oe[t[e+9]]+"-"+Oe[t[e+10]]+Oe[t[e+11]]+Oe[t[e+12]]+Oe[t[e+13]]+Oe[t[e+14]]+Oe[t[e+15]]}var eo={randomUUID:fE__default.default.randomUUID};function dE(t,e,r){if(eo.randomUUID&&!e&&!t)return eo.randomUUID();t=t||{};let n=t.random||(t.rng||Qs)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let s=0;s<16;++s)e[r+s]=n[s];return e}return Nc(n)}var gt=dE;var qs=fr(xi());var Mt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function Bx(t,e){return e}function Rp(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:jx(t)?1:t instanceof Set?3:t instanceof Map?4:5}function Ux(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function Hx(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Ip(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Tp=new Set(["[object Object]","[object Module]"]);function jx(t){if(!Tp.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!Tp.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function Wx(t,e,r){let n={};for(let s of Ux(t)){let i=[];for(let c of t)Hx(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),a=Mp(i,e,o);a!==Mt.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:a,configurable:!0,enumerable:!0,writable:!0}):n[s]=a);}return n}function zx(t){return t.flat()}function Gx(t){return new Set(Ip(t))}function Vx(t){return new Map(Ip(t))}function Pp(t){return t.at(-1)}var aa=Object.freeze({__proto__:null,mergeArrays:zx,mergeMaps:Vx,mergeOthers:Pp,mergeRecords:Wx,mergeSets:Gx});function Op(...t){return Kx({})(...t)}function Kx(t,e){let r=Zx(t,n);function n(...s){return Mp(s,r,e)}return n}function Zx(t,e){return {defaultMergeFunctions:aa,mergeFunctions:{...aa,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(aa,r)).map(([r,n])=>n===!1?[r,Pp]:[r,n]))},metaDataUpdater:t.metaDataUpdater??Bx,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:Mt}}function Mp(t,e,r){if(t.length===0)return;if(t.length===1)return la(t,e,r);let n=Rp(t[0]);if(n!==0&&n!==5){for(let s=1;s{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var ua=new Set(["__proto__","prototype","constructor"]),eC=new Set("0123456789");function ca(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(ua.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(ua.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!eC.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i;}}switch(s&&(r+="\\"),n){case"property":{if(ua.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Fp(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function Np(t,e){if(Fp(t,e))throw new Error("Cannot use string index")}function Ci(t,e,r){if(!sn(t)||typeof e!="string")return r===void 0?t:r;let n=ca(e);if(n.length===0)return r;for(let s=0;s0&&e[e.length-1].endsWith(` +`)&&e.push(""),e}function ae(t){return t.trim().length===0}var qp=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],Bp=qp.map(t=>t[0]),Ti=qp.map(t=>t[1]);function Ii(t){let e=[];for(let r of t)[["(",")"],["[","]"],["{","}"]].forEach(n=>{r===n[1]&&(e.length>0&&e[e.length-1]===n[0]?e.pop():e.push(r));}),"([{".includes(r)&&e.push(r),["'",'"',"`"].forEach(n=>{r===n&&(e.length>0&&e.includes(n)?e.splice(e.lastIndexOf(n),e.length-e.lastIndexOf(n)):e.push(r));});return e.join("")}function Er(t,e){return Up.get(t,e)}function an(t){let e=new AbortController;for(let r of t){if(r?.aborted)return e.abort(r.reason),r;r?.addEventListener("abort",()=>e.abort(r.reason),{signal:e.signal});}return e.signal}var De=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function ln(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof De&&[408,499].includes(t.status)}function Yt(t){return t instanceof Error&&t.name==="AbortError"}function ha(t){let e=t.message||t.toString();return t.cause&&(e+=` +Caused by: `+ha(t.cause)),e}function da(t){this.message=t;}da.prototype=new Error,da.prototype.name="InvalidCharacterError";var Hp=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new da("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function cC(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(Hp(r).replace(/(.)/g,function(n,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return Hp(e)}}function Pi(t){this.message=t;}function fC(t,e){if(typeof t!="string")throw new Pi("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(cC(t.split(".")[r]))}catch(n){throw new Pi("Invalid token specified: "+n.message)}}Pi.prototype=new Error,Pi.prototype.name="InvalidTokenError";var Oi=fC;Ft();var Fr=(()=>{let t=G("events"),e=Oa(),r=xi(),n=Il();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.filepath=c;}async load(){this.data=await e.readJson(i,{throws:!1})||{};}async save(){await e.outputJson(i,this.data);}watch(){this.watcher=n.watch(this.filepath,{interval:1e3});let c=async()=>{let d=this.data;await this.load(),r(d,this.data)||super.emit("updated",this.data);};this.watcher.on("add",c),this.watcher.on("change",c);}}let i=G("path").join(G("os").homedir(),".tabby-client","agent","data.json");return new s(i)})();_t();var Is=class t extends events.EventEmitter{constructor(r){super();this.logger=be.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,r.dataStore?this.dataStore=r.dataStore:(this.dataStore=Fr,Fr.on("updated",async()=>{await this.load(),super.emit("updated",this.jwt);}),Fr.watch()),this.authApi=Zt({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static{this.authPageUrl="https://app.tabbyml.com/account/device-token";}static{this.tokenStrategy={polling:{interval:5e3,timeout:5*60*1e3},refresh:{interval:15*60*1e3,beforeExpire:30*60*1e3,whenLoaded:{maxTry:5,retryDelay:1e3},whenScheduled:{maxTry:60,retryDelay:30*1e3}}};}static async create(r){let n=new t(r);return await n.load(),n}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:Oi(r)};n.payload.exp*1e3-Date.now()"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=null,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error)throw new De(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(t.authPageUrl);return i.searchParams.append("code",s.data.code),{authUrl:i.toString(),code:s.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((s,i)=>{let o=an([AbortSignal.timeout(t.tokenStrategy.polling.timeout),n?.signal]),a=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new De(c.response);let d=c.data;this.logger.debug({result:d},"Poll jwt response"),this.jwt={token:d.data.jwt,payload:Oi(d.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(a),s(!0);}catch(c){c instanceof De&&[400,401,403,405].includes(c.status)?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},t.tokenStrategy.polling.interval);o.aborted?(clearInterval(a),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(a),i(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},s=0){try{this.logger.debug({retry:s},"Start to refresh token");let i=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(i.error)throw new De(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:Oi(o.data.jwt)}}catch(i){if(i instanceof De&&[400,401,403,405].includes(i.status))this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),ssetTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw {...i,retry:s}}}scheduleRefreshToken(){this.refreshTokenTimer=setInterval(async()=>{if(!this.jwt)return null;if(this.jwt.payload.exp*1e3-Date.now(){let t=z("events"),e=Al(),r=sS(),n=n0();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.logger=(Nt(),zo(Zw)).rootLogger.child({component:"ConfigFile"});this.filepath=c;}get config(){return this.data}async load(){try{let c=await e.readFile(this.filepath,"utf8");if(c.trim()===oq.trim())return await this.createTemplate(),await this.load();this.data=r.parse(c),super.emit("updated",this.data);}catch(c){c.code==="ENOENT"?await this.createTemplate():this.logger.error({error:c},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,aq);}catch(c){this.logger.error({error:c},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3}),this.watcher.on("add",this.load.bind(this)),this.watcher.on("change",this.load.bind(this));}}let i=z("path").join(z("os").homedir(),".tabby-client","agent","config.toml");return new s(i)})();var wi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s0=new Set,vc=typeof process=="object"&&process?process:{},o0=(t,e,r,n)=>{typeof vc.emitWarning=="function"?vc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},xo=globalThis.AbortController,i0=globalThis.AbortSignal;if(typeof xo>"u"){i0=class{constructor(){ne(this,"onabort");ne(this,"_onabort",[]);ne(this,"reason");ne(this,"aborted",!1);}addEventListener(n,s){this._onabort.push(s);}},xo=class{constructor(){ne(this,"signal",new i0);e();}abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=vc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,o0("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var lq=t=>!s0.has(t),yr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),a0=t=>yr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?En:null:null,En=class extends Array{constructor(e){super(e),this.fill(0);}},An,Mr=class Mr{constructor(e,r){ne(this,"heap");ne(this,"length");if(!S(Mr,An))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}static create(e){let r=a0(e);if(!r)return [];re(Mr,An,!0);let n=new Mr(e,r);return re(Mr,An,!1),n}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};An=new WeakMap,ae(Mr,An,!1);var wc=Mr,Ct,ft,jt,Rt,_n,Te,Ot,$e,Se,oe,Je,ht,ze,qe,Pt,Ue,Yt,Jt,Tt,Bt,wr,it,bi,Sc,jr,Xt,Ei,pt,Ro,l0,Br,xn,Ai,Ht,mr,Ut,vr,_i,bc,Cn,Ao,Rn,_o,ve,be,xi,Ec,Hr,Si,Ac=class Ac{constructor(e){ae(this,bi);ae(this,Ro);ae(this,Ht);ae(this,Ut);ae(this,_i);ae(this,Cn);ae(this,Rn);ae(this,ve);ae(this,xi);ae(this,Hr);ae(this,Ct,void 0);ae(this,ft,void 0);ae(this,jt,void 0);ae(this,Rt,void 0);ae(this,_n,void 0);ne(this,"ttl");ne(this,"ttlResolution");ne(this,"ttlAutopurge");ne(this,"updateAgeOnGet");ne(this,"updateAgeOnHas");ne(this,"allowStale");ne(this,"noDisposeOnSet");ne(this,"noUpdateTTL");ne(this,"maxEntrySize");ne(this,"sizeCalculation");ne(this,"noDeleteOnFetchRejection");ne(this,"noDeleteOnStaleGet");ne(this,"allowStaleOnFetchAbort");ne(this,"allowStaleOnFetchRejection");ne(this,"ignoreFetchAbort");ae(this,Te,void 0);ae(this,Ot,void 0);ae(this,$e,void 0);ae(this,Se,void 0);ae(this,oe,void 0);ae(this,Je,void 0);ae(this,ht,void 0);ae(this,ze,void 0);ae(this,qe,void 0);ae(this,Pt,void 0);ae(this,Ue,void 0);ae(this,Yt,void 0);ae(this,Jt,void 0);ae(this,Tt,void 0);ae(this,Bt,void 0);ae(this,wr,void 0);ae(this,it,void 0);ae(this,jr,()=>{});ae(this,Xt,()=>{});ae(this,Ei,()=>{});ae(this,pt,()=>!1);ae(this,Br,e=>{});ae(this,xn,(e,r,n)=>{});ae(this,Ai,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:c,dispose:p,disposeAfter:u,noDisposeOnSet:g,noUpdateTTL:y,maxSize:m=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:_,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:I,ignoreFetchAbort:F}=e;if(r!==0&&!yr(r))throw new TypeError("max option must be a nonnegative integer");let U=r?a0(r):Array;if(!U)throw new Error("invalid max value: "+r);if(re(this,Ct,r),re(this,ft,m),this.maxEntrySize=v||S(this,ft),this.sizeCalculation=b,this.sizeCalculation){if(!S(this,ft)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(re(this,_n,_),re(this,wr,!!_),re(this,$e,new Map),re(this,Se,new Array(r).fill(void 0)),re(this,oe,new Array(r).fill(void 0)),re(this,Je,new U(r)),re(this,ht,new U(r)),re(this,ze,0),re(this,qe,0),re(this,Pt,wc.create(r)),re(this,Te,0),re(this,Ot,0),typeof p=="function"&&re(this,jt,p),typeof u=="function"?(re(this,Rt,u),re(this,Ue,[])):(re(this,Rt,void 0),re(this,Ue,void 0)),re(this,Bt,!!S(this,jt)),re(this,it,!!S(this,Rt)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(S(this,ft)!==0&&!yr(S(this,ft)))throw new TypeError("maxSize must be a positive integer if specified");if(!yr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ee(this,Ro,l0).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=yr(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!yr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ee(this,bi,Sc).call(this);}if(S(this,Ct)===0&&this.ttl===0&&S(this,ft)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,Ct)&&!S(this,ft)){let H="LRU_CACHE_UNBOUNDED";lq(H)&&(s0.add(H),o0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Ac));}}static unsafeExposeInternals(e){return {starts:S(e,Jt),ttls:S(e,Tt),sizes:S(e,Yt),keyMap:S(e,$e),keyList:S(e,Se),valList:S(e,oe),next:S(e,Je),prev:S(e,ht),get head(){return S(e,ze)},get tail(){return S(e,qe)},free:S(e,Pt),isBackgroundFetch:r=>{var n;return ee(n=e,ve,be).call(n,r)},backgroundFetch:(r,n,s,i)=>{var o;return ee(o=e,Rn,_o).call(o,r,n,s,i)},moveToTail:r=>{var n;return ee(n=e,Hr,Si).call(n,r)},indexes:r=>{var n;return ee(n=e,Ht,mr).call(n,r)},rindexes:r=>{var n;return ee(n=e,Ut,vr).call(n,r)},isStale:r=>{var n;return S(n=e,pt).call(n,r)}}}get max(){return S(this,Ct)}get maxSize(){return S(this,ft)}get calculatedSize(){return S(this,Ot)}get size(){return S(this,Te)}get fetchMethod(){return S(this,_n)}get dispose(){return S(this,jt)}get disposeAfter(){return S(this,Rt)}getRemainingTTL(e){return S(this,$e).has(e)?1/0:0}*entries(){for(let e of ee(this,Ht,mr).call(this))S(this,oe)[e]!==void 0&&S(this,Se)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield [S(this,Se)[e],S(this,oe)[e]]);}*rentries(){for(let e of ee(this,Ut,vr).call(this))S(this,oe)[e]!==void 0&&S(this,Se)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield [S(this,Se)[e],S(this,oe)[e]]);}*keys(){for(let e of ee(this,Ht,mr).call(this)){let r=S(this,Se)[e];r!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield r);}}*rkeys(){for(let e of ee(this,Ut,vr).call(this)){let r=S(this,Se)[e];r!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield r);}}*values(){for(let e of ee(this,Ht,mr).call(this))S(this,oe)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield S(this,oe)[e]);}*rvalues(){for(let e of ee(this,Ut,vr).call(this))S(this,oe)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield S(this,oe)[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of ee(this,Ht,mr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,S(this,Se)[n],this))return this.get(S(this,Se)[n],r)}}forEach(e,r=this){for(let n of ee(this,Ht,mr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}rforEach(e,r=this){for(let n of ee(this,Ut,vr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}purgeStale(){let e=!1;for(let r of ee(this,Ut,vr).call(this,{allowStale:!0}))S(this,pt).call(this,r)&&(this.delete(S(this,Se)[r]),e=!0);return e}dump(){let e=[];for(let r of ee(this,Ht,mr).call(this,{allowStale:!0})){let n=S(this,Se)[r],s=S(this,oe)[r],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(S(this,Tt)&&S(this,Jt)){o.ttl=S(this,Tt)[r];let l=wi.now()-S(this,Jt)[r];o.start=Math.floor(Date.now()-l);}S(this,Yt)&&(o.size=S(this,Yt)[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=wi.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){var y,m;if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=n,{noUpdateTTL:p=this.noUpdateTTL}=n,u=S(this,Ai).call(this,e,r,n.size||0,l);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let g=S(this,Te)===0?void 0:S(this,$e).get(e);if(g===void 0)g=S(this,Te)===0?S(this,qe):S(this,Pt).length!==0?S(this,Pt).pop():S(this,Te)===S(this,Ct)?ee(this,Cn,Ao).call(this,!1):S(this,Te),S(this,Se)[g]=e,S(this,oe)[g]=r,S(this,$e).set(e,g),S(this,Je)[S(this,qe)]=g,S(this,ht)[g]=S(this,qe),re(this,qe,g),Di(this,Te)._++,S(this,xn).call(this,g,u,c),c&&(c.set="add"),p=!1;else {ee(this,Hr,Si).call(this,g);let v=S(this,oe)[g];if(r!==v){if(S(this,wr)&&ee(this,ve,be).call(this,v)?v.__abortController.abort(new Error("replaced")):o||(S(this,Bt)&&((y=S(this,jt))==null||y.call(this,v,e,"set")),S(this,it)&&S(this,Ue)?.push([v,e,"set"])),S(this,Br).call(this,g),S(this,xn).call(this,g,u,c),S(this,oe)[g]=r,c){c.set="replace";let b=v&&ee(this,ve,be).call(this,v)?v.__staleWhileFetching:v;b!==void 0&&(c.oldValue=b);}}else c&&(c.set="update");}if(s!==0&&!S(this,Tt)&&ee(this,bi,Sc).call(this),S(this,Tt)&&(p||S(this,Ei).call(this,g,s,i),c&&S(this,Xt).call(this,c,g)),!o&&S(this,it)&&S(this,Ue)){let v=S(this,Ue),b;for(;b=v?.shift();)(m=S(this,Rt))==null||m.call(this,...b);}return this}pop(){var e;try{for(;S(this,Te);){let r=S(this,oe)[S(this,ze)];if(ee(this,Cn,Ao).call(this,!0),ee(this,ve,be).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(S(this,it)&&S(this,Ue)){let r=S(this,Ue),n;for(;n=r?.shift();)(e=S(this,Rt))==null||e.call(this,...n);}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=S(this,$e).get(e);if(i!==void 0){let o=S(this,oe)[i];if(ee(this,ve,be).call(this,o)&&o.__staleWhileFetching===void 0)return !1;if(S(this,pt).call(this,i))s&&(s.has="stale",S(this,Xt).call(this,s,i));else return n&&S(this,jr).call(this,i),s&&(s.has="hit",S(this,Xt).call(this,s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=S(this,$e).get(e);if(s!==void 0&&(n||!S(this,pt).call(this,s))){let i=S(this,oe)[s];return ee(this,ve,be).call(this,i)?i.__staleWhileFetching:i}}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:c=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=!1,status:x,signal:A}=r;if(!S(this,wr))return x&&(x.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:x});let O={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:l,size:c,sizeCalculation:p,noUpdateTTL:u,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:v,ignoreFetchAbort:m,status:x,signal:A},I=S(this,$e).get(e);if(I===void 0){x&&(x.fetch="miss");let F=ee(this,Rn,_o).call(this,e,I,O,b);return F.__returned=F}else {let F=S(this,oe)[I];if(ee(this,ve,be).call(this,F)){let j=n&&F.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",j&&(x.returnedStale=!0)),j?F.__staleWhileFetching:F.__returned=F}let U=S(this,pt).call(this,I);if(!_&&!U)return x&&(x.fetch="hit"),ee(this,Hr,Si).call(this,I),s&&S(this,jr).call(this,I),x&&S(this,Xt).call(this,x,I),F;let H=ee(this,Rn,_o).call(this,e,I,O,b),k=H.__staleWhileFetching!==void 0&&n;return x&&(x.fetch=U?"stale":"refresh",k&&U&&(x.returnedStale=!0)),k?H.__staleWhileFetching:H.__returned=H}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,l=S(this,$e).get(e);if(l!==void 0){let c=S(this,oe)[l],p=ee(this,ve,be).call(this,c);return o&&S(this,Xt).call(this,o,l),S(this,pt).call(this,l)?(o&&(o.get="stale"),p?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),p?c.__staleWhileFetching:(ee(this,Hr,Si).call(this,l),s&&S(this,jr).call(this,l),c))}else o&&(o.get="miss");}delete(e){var n,s;let r=!1;if(S(this,Te)!==0){let i=S(this,$e).get(e);if(i!==void 0)if(r=!0,S(this,Te)===1)this.clear();else {S(this,Br).call(this,i);let o=S(this,oe)[i];ee(this,ve,be).call(this,o)?o.__abortController.abort(new Error("deleted")):(S(this,Bt)||S(this,it))&&(S(this,Bt)&&((n=S(this,jt))==null||n.call(this,o,e,"delete")),S(this,it)&&S(this,Ue)?.push([o,e,"delete"])),S(this,$e).delete(e),S(this,Se)[i]=void 0,S(this,oe)[i]=void 0,i===S(this,qe)?re(this,qe,S(this,ht)[i]):i===S(this,ze)?re(this,ze,S(this,Je)[i]):(S(this,Je)[S(this,ht)[i]]=S(this,Je)[i],S(this,ht)[S(this,Je)[i]]=S(this,ht)[i]),Di(this,Te)._--,S(this,Pt).push(i);}}if(S(this,it)&&S(this,Ue)?.length){let i=S(this,Ue),o;for(;o=i?.shift();)(s=S(this,Rt))==null||s.call(this,...o);}return r}clear(){var e,r;for(let n of ee(this,Ut,vr).call(this,{allowStale:!0})){let s=S(this,oe)[n];if(ee(this,ve,be).call(this,s))s.__abortController.abort(new Error("deleted"));else {let i=S(this,Se)[n];S(this,Bt)&&((e=S(this,jt))==null||e.call(this,s,i,"delete")),S(this,it)&&S(this,Ue)?.push([s,i,"delete"]);}}if(S(this,$e).clear(),S(this,oe).fill(void 0),S(this,Se).fill(void 0),S(this,Tt)&&S(this,Jt)&&(S(this,Tt).fill(0),S(this,Jt).fill(0)),S(this,Yt)&&S(this,Yt).fill(0),re(this,ze,0),re(this,qe,0),S(this,Pt).length=0,re(this,Ot,0),re(this,Te,0),S(this,it)&&S(this,Ue)){let n=S(this,Ue),s;for(;s=n?.shift();)(r=S(this,Rt))==null||r.call(this,...s);}}};Ct=new WeakMap,ft=new WeakMap,jt=new WeakMap,Rt=new WeakMap,_n=new WeakMap,Te=new WeakMap,Ot=new WeakMap,$e=new WeakMap,Se=new WeakMap,oe=new WeakMap,Je=new WeakMap,ht=new WeakMap,ze=new WeakMap,qe=new WeakMap,Pt=new WeakMap,Ue=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Tt=new WeakMap,Bt=new WeakMap,wr=new WeakMap,it=new WeakMap,bi=new WeakSet,Sc=function(){let e=new En(S(this,Ct)),r=new En(S(this,Ct));re(this,Tt,e),re(this,Jt,r),re(this,Ei,(i,o,l=wi.now())=>{if(r[i]=o!==0?l:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{S(this,pt).call(this,i)&&this.delete(S(this,Se)[i]);},o+1);c.unref&&c.unref();}}),re(this,jr,i=>{r[i]=e[i]!==0?wi.now():0;}),re(this,Xt,(i,o)=>{if(e[o]){let l=e[o],c=r[o];i.ttl=l,i.start=c,i.now=n||s();let p=i.now-c;i.remainingTTL=l-p;}});let n=0,s=()=>{let i=wi.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=S(this,$e).get(i);if(o===void 0)return 0;let l=e[o],c=r[o];if(l===0||c===0)return 1/0;let p=(n||s())-c;return l-p},re(this,pt,i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i]);},jr=new WeakMap,Xt=new WeakMap,Ei=new WeakMap,pt=new WeakMap,Ro=new WeakSet,l0=function(){let e=new En(S(this,Ct));re(this,Ot,0),re(this,Yt,e),re(this,Br,r=>{re(this,Ot,S(this,Ot)-e[r]),e[r]=0;}),re(this,Ai,(r,n,s,i)=>{if(ee(this,ve,be).call(this,n))return 0;if(!yr(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!yr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),re(this,xn,(r,n,s)=>{if(e[r]=n,S(this,ft)){let i=S(this,ft)-e[r];for(;S(this,Ot)>i;)ee(this,Cn,Ao).call(this,!0);}re(this,Ot,S(this,Ot)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=S(this,Ot));});},Br=new WeakMap,xn=new WeakMap,Ai=new WeakMap,Ht=new WeakSet,mr=function*({allowStale:e=this.allowStale}={}){if(S(this,Te))for(let r=S(this,qe);!(!ee(this,_i,bc).call(this,r)||((e||!S(this,pt).call(this,r))&&(yield r),r===S(this,ze)));)r=S(this,ht)[r];},Ut=new WeakSet,vr=function*({allowStale:e=this.allowStale}={}){if(S(this,Te))for(let r=S(this,ze);!(!ee(this,_i,bc).call(this,r)||((e||!S(this,pt).call(this,r))&&(yield r),r===S(this,qe)));)r=S(this,Je)[r];},_i=new WeakSet,bc=function(e){return e!==void 0&&S(this,$e).get(S(this,Se)[e])===e},Cn=new WeakSet,Ao=function(e){var i;let r=S(this,ze),n=S(this,Se)[r],s=S(this,oe)[r];return S(this,wr)&&ee(this,ve,be).call(this,s)?s.__abortController.abort(new Error("evicted")):(S(this,Bt)||S(this,it))&&(S(this,Bt)&&((i=S(this,jt))==null||i.call(this,s,n,"evict")),S(this,it)&&S(this,Ue)?.push([s,n,"evict"])),S(this,Br).call(this,r),e&&(S(this,Se)[r]=void 0,S(this,oe)[r]=void 0,S(this,Pt).push(r)),S(this,Te)===1?(re(this,ze,re(this,qe,0)),S(this,Pt).length=0):re(this,ze,S(this,Je)[r]),S(this,$e).delete(n),Di(this,Te)._--,r},Rn=new WeakSet,_o=function(e,r,n,s){let i=r===void 0?void 0:S(this,oe)[r];if(ee(this,ve,be).call(this,i))return i;let o=new xo,{signal:l}=n;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},p=(b,_=!1)=>{let{aborted:x}=o.signal,A=n.ignoreFetchAbort&&b!==void 0;if(n.status&&(x&&!_?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,A&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),x&&!A&&!_)return g(o.signal.reason);let O=m;return S(this,oe)[r]===m&&(b===void 0?O.__staleWhileFetching?S(this,oe)[r]=O.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=b),g(b)),g=b=>{let{aborted:_}=o.signal,x=_&&n.allowStaleOnFetchAbort,A=x||n.allowStaleOnFetchRejection,O=A||n.noDeleteOnFetchRejection,I=m;if(S(this,oe)[r]===m&&(!O||I.__staleWhileFetching===void 0?this.delete(e):x||(S(this,oe)[r]=I.__staleWhileFetching)),A)return n.status&&I.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw b},y=(b,_)=>{var A;let x=(A=S(this,_n))==null?void 0:A.call(this,e,i,c);x&&x instanceof Promise&&x.then(O=>b(O),_),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(b(),n.allowStaleOnFetchAbort&&(b=O=>p(O,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(y).then(p,u),v=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,v,{...c.options,status:void 0}),r=S(this,$e).get(e)):S(this,oe)[r]=v,v},ve=new WeakSet,be=function(e){if(!S(this,wr))return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xo},xi=new WeakSet,Ec=function(e,r){S(this,ht)[r]=e,S(this,Je)[e]=r;},Hr=new WeakSet,Si=function(e){e!==S(this,qe)&&(e===S(this,ze)?re(this,ze,S(this,Je)[e]):ee(this,xi,Ec).call(this,S(this,ht)[e],S(this,Je)[e]),ee(this,xi,Ec).call(this,S(this,qe),e),re(this,qe,e));};var Co=Ac;var g0=Nn(d0());function cq(t){return t.trimEnd().split("").every(e=>ws.includes(e))}var Sr=class{constructor(e){this.filepath=e.filepath,this.language=e.language,this.text=e.text,this.position=e.position,this.prefix=e.text.slice(0,e.position),this.suffix=e.text.slice(e.position),this.prefixLines=Pe(this.prefix),this.suffixLines=Pe(this.suffix);let r=cq(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, g0.default)({filepath:e.filepath,language:e.language,text:e.text,position:e.position});}};var y0=["statusChanged","configUpdated","authRequired","issuesUpdated"];Nt();var Oo=class{constructor(){this.logger=Ce.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new Co({max:this.options.maxCount});}has(e){return this.cache.has(e.hash)}buildCache(e,r){this.logger.debug({key:e,value:r},"Starting to build cache");let n=this.createCacheEntries(e,r);n.forEach(s=>{this.cache.set(s.key.hash,{value:s.value,rebuildFlag:s.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(e){let r=this.cache.get(e.hash);return r?.rebuildFlag&&this.buildCache(e,r?.value),r?.value}createCacheEntries(e,r){let n=[{key:e,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let i of r.choices){let o=i.text.slice(e.position-i.replaceRange.start),l=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:l},"Calculate per-line cache positions");for(let p of l){let u=o.slice(0,p),g=this.generateAutoClosedPrefixes(u);for(let y of [u,...g]){let m={key:new Sr({...e,text:e.text.slice(0,e.position)+y+e.text.slice(e.position),position:e.position+p}),value:{...r,choices:[{index:i.index,text:o.slice(p),replaceRange:{start:e.position+p,end:e.position+p}}]},rebuildFlag:!0};this.logger.trace({prefix:y,entry:m},"Build per-line cache entry"),n.push(m);}}let c=this.getPerCharacterPositions(o);this.logger.trace({completionText:o,perCharacterPositions:c},"Calculate per-character cache positions");for(let p of c){let u=p;for(;u>0&&o[u-1]!==` -`;)u--;let g=o.slice(0,p),y=this.generateAutoClosedPrefixes(g);for(let m of [g,...y]){let v={key:new Sr({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+p}),value:{...r,choices:[{index:i.index,text:o.slice(u),replaceRange:{start:e.position+u,end:e.position+p}}]},rebuildFlag:!1};this.logger.trace({prefix:m,entry:v},"Build per-character cache entry"),n.push(v);}}}return n.reduce((i,o)=>{let l=i.find(c=>c.key.hash===o.key.hash);return l?(l.value.choices.push(...o.value.choices),l.rebuildFlag=l.rebuildFlag||o.rebuildFlag):i.push(o),i},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,s=Pe(e),i=0,o=0;for(;is;s++){let o=Fg.indexOf(n[n.length-1-s]);if(o<0)break;i=i+ws[o],r.push(e+i);}return r}};Nt();function Cc(t,e,r){return Math.max(t,Math.min(e,r))}var Po=class{constructor(){this.logger=Ce.child({component:"CompletionDebounce"});this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:s,responseTime:i}=e;if(n.manually)return this.sleep(0,r);if(s.mode==="fixed")return this.sleep(s.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let l=this.calcContextScore(n),p=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*l)*this.baseInterval,u=Cc(this.options.requestDelay.min,this.options.requestDelay.max,p-i);return this.sleep(u,r)}async sleep(e,r){return new Promise((n,s)=>{let i=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(i),s(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(i),s(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,s)=>n+s,0)/this.calledIntervalHistory.length;this.baseInterval=Cc(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=Pe(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Cc(0,1,r),r}};Nt();var $t=Ce.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function It(t,e){return async r=>(r.choices=(await Promise.all(r.choices.map(async n=>{let s=e.position-n.replaceRange.start,i=await t(n.text.slice(s));return n.text=n.text.slice(0,s)+(i??""),n}))).filter(n=>!!n.text).distinct(n=>n.text),r)}function fq(t){return /\n(\s*)\n/g}var m0=t=>e=>{let r=e.split(fq()),n=0,s=2,i=r.length-2;for(;i>=1;){if(ge(r[i])){i--;continue}let o=i-1;for(;o>=0&&ge(r[o]);)o--;if(o<0)break;let l=r[i].trim(),c=r[o].trim(),p=Math.max(.1*l.length,.1*c.length);if(on(l,c)<=p)n++,i--;else break}return n>=s?($t.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var v0=()=>t=>{let e=Pe(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(ge(e[s])){s--;continue}let i=s-1;for(;i>=0&&ge(e[i]);)i--;if(i<0)break;let o=e[s].trim(),l=e[i].trim(),c=Math.max(.1*o.length,.1*l.length);if(on(o,l)<=c)r++,s=i;else break}return r>=n?($t.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var hq=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],w0=()=>t=>{let e=Pe(t),r=e.length-1;for(;r>=0&&ge(e[r]);)r--;if(r<0)return t;for(let n of hq){let s=e[r].match(n);if(s)return $t.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};function br(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function pq(t,e){return e>=t.length-1?!1:br(t[e])n};if(t.length==0||e.length==0)return s;let i=e[e.length-1],o=ge(i),l=e.length-1;for(;l>=0&&ge(e[l]);)l--;if(l<0)return s;let c=e[l],p=br(c),u=t[0],g=ge(u),y=0;for(;y=t.length)return s;let m=t[y],v;g?v=br(m):v=br(i+m),!g&&!o?(s.indentLevelLimit=p+1,n=!!t[1]&&br(t[1])>p):v>p?(s.indentLevelLimit=p+1,n=!0):(s.indentLevelLimit=p,n=!0);let b=1;for(;b{let x=_.startsWith(r[b])||r[b].startsWith(_);return n&&!x}),s}var S0=t=>e=>{let{prefix:r,suffix:n,prefixLines:s,suffixLines:i}=t,o=Pe(e);if(t.mode==="fill-in-line"&&o.length>1)return $t.debug({input:e,prefix:r,suffix:n},"Drop content with multiple lines"),null;let l=dq(o,s,i),c;for(c=1;ce=>{let {prefixLines:r,suffixLines:n}=t;Pe(e);let i=e,o=r[r.length-1]??"",l=n[0]??"";return !ge(o)&&o.match(/\s$/)&&(i=i.trimStart()),(ge(l)||!ge(l)&&l.match(/^\s/))&&(i=i.trimEnd()),i};var Oc=t=>e=>{let{suffixLines:r}=t,n=Pe(e),s=0;for(;st=>ge(t)?null:t;async function b0(t,e){return Promise.resolve(e).then(It(w0(),t)).then(It(Oc(t),t)).then(It(Rc(t),t)).then(It(Pc(),t))}async function E0(t,e){return Promise.resolve(e).then(It(m0(),t)).then(It(v0(),t)).then(It(S0(t),t)).then(It(Oc(t),t)).then(It(Rc(t),t)).then(It(Pc(),t))}Nt();var _0="tabby-agent",x0="1.0.0";Jn();Nt();var To=class t{constructor(){this.anonymousUsageTrackingApi=Or({baseUrl:"https://app.tabbyml.com/api"});this.logger=Ce.child({component:"AnonymousUsage"});this.systemData={agent:`${_0}, ${x0}`,browser:void 0,node:`${process.version} ${process.platform} ${z("os").arch()} ${z("os").release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.dataStore=null;}static async create(e){let r=new t;return r.dataStore=e.dataStore||Fs,await r.checkAnonymousId(),r}async checkAnonymousId(){if(this.dataStore){try{await this.dataStore.load();}catch(e){this.logger.debug({error:e},"Error when loading anonymousId");}if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=Ar(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(e){this.logger.debug({error:e},"Error when saving anonymousId");}}}else this.anonymousId=Ar();}setSessionProperties(e,r){sn(this.sessionProperties,e,r);}setUserProperties(e,r){sn(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||n&&this.emittedUniqueEvent.indexOf(e)>=0)return;n&&this.emittedUniqueEvent.push(e);let s={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(s.$set=this.userProperties,this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:s}});}catch(i){this.logger.error({error:i},"Error when sending anonymous usage data");}}};var kc=Nn(P0());Nt();var $o=class{constructor(){this.sum=0;this.quantity=0;}add(e){this.sum+=e,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},Io=class{constructor(e){this.values=[];this.maxSize=e;}add(e){this.values.push(e),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Ti=class{constructor(){this.logger=Ce.child({component:"CompletionProviderStats"});this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new kc.Univariate;this.completionRequestCanceledStats=new $o;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Io(10);}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:l,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(l?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),l||this.recentCompletionRequestLatencies.add(o));}addEvent(e){let r=this.eventMap.get(e)||0;this.eventMap.set(e,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new kc.Univariate,this.completionRequestCanceledStats=new $o,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Io(10);}stats(){let e=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...e},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(i=>Number.isNaN(i)),n=e.filter(i=>!Number.isNaN(i)),s=n.reduce((i,o)=>i+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:s}}}static check(e){let{values:r,stats:{total:n,timeouts:s,responses:i,averageResponseTime:o}}=e;return r.slice(-3).every(l=>l<3e3)?"healthy":s/n>.5&&s>=3?"highTimeoutRate":i>=3&&o>4e3?"slowResponseTime":null}};var Wr=class Wr extends events.EventEmitter{constructor(){super();this.logger=Ce.child({component:"TabbyAgent"});this.config=mc;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.dataStore=null;this.completionCache=new Oo;this.completionDebounce=new Po;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new Ti;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},Wr.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},Wr.submitStatsInterval);}static async create(r){let n=new Wr;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await To.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=_g(mc,this.userConfig,this.clientConfig),gn.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await ro.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,await this.setupApi(),(0, Lc.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired());let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){this.api=Or({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:this.auth?.token?`Bearer ${this.auth.token}`:void 0,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats}}}pushIssue(r){this.issues.indexOf(r)===-1&&(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}async post(r,n,s){let i=Ar();this.logger.debug({requestId:i,path:r,requestOptions:n,abortOptions:s},"API request");try{let o=Math.min(2147483647,s?.timeout||this.config.server.requestTimeout),l=Yn([AbortSignal.timeout(o),s?.signal]),c=await this.api.POST(r,{...n,signal:l});if(c.error)throw new at(c.response);return this.logger.debug({requestId:i,path:r,response:c.data},"API response"),this.changeStatus("ready"),c.data}catch(o){throw bs(o)?this.logger.debug({requestId:i,path:r,error:o},"API request timeout"):an(o)?this.logger.debug({requestId:i,path:r,error:o},"API request canceled"):o instanceof at&&[401,403,405].indexOf(o.status)!==-1&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:i,path:r,error:o},"API unauthorized"),this.changeStatus("unauthorized")):o instanceof at?(this.logger.error({requestId:i,path:r,error:o},"API error"),this.changeStatus("disconnected")):(this.logger.error({requestId:i,path:r,error:o},"API request failed with unknown error"),this.changeStatus("disconnected")),o}}async healthCheck(r){try{let n=await this.post("/v1/health",{},r);typeof n=="object"&&n.model!==void 0&&n.device!==void 0&&(this.serverHealthState=n,this.status==="ready"&&this.anonymousUsageLogger.uniqueEvent("AgentConnected",n));}catch{this.changeStatus("disconnected"),this.serverHealthState=null;}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,{prefixLines:i,suffixLines:o}=r;return {prefix:i.slice(Math.max(i.length-n,0)).join(""),suffix:o.slice(0,s).join("")}}calculateReplaceRange(r,n){let{suffixLines:s}=n,i=s[0]?.trimEnd()||"";if(ge(i))return r;for(let o of r.choices){let l=o.text.slice(n.position-o.replaceRange.start),c=Ss(l);ge(c)||(i.startsWith(c)?(o.replaceRange.end=n.position+c.length,this.logger.trace({context:n,completion:o.text,range:o.replaceRange,unpaired:c},"Adjust replace range")):c.startsWith(i)&&(o.replaceRange.end=n.position+i.length,this.logger.trace({context:n,completion:o.text,range:o.replaceRange,unpaired:c},"Adjust replace range")));}return r}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;gn.forEach(i=>i.setBindings?.({...s})),s&&Object.entries(s).forEach(([i,o])=>{this.anonymousUsageLogger.setSessionProperties(i,o);}),n&&Object.entries(n).forEach(([i,o])=>{this.anonymousUsageLogger.setUserProperties(i,o);});}return bn&&(await bn.load(),this.userConfig=bn.config,bn.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),bn.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&(clearInterval(this.tryingConnectTimer),this.tryingConnectTimer=null),this.submitStatsTimer&&(clearInterval(this.submitStatsTimer),this.submitStatsTimer=null),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,s){switch(r){case"session":let i={};sn(i,n,s),gn.forEach(o=>o.setBindings?.(i)),this.anonymousUsageLogger.setSessionProperties(n,s);break;case"user":this.anonymousUsageLogger.setUserProperties(n,s);break}return !0}async updateConfig(r,n){let s=Og(this.clientConfig,r);return (0, Lc.default)(s,n)||(n===void 0?Pg(this.clientConfig,r):sn(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){return r.index!==void 0?this.issueFromName(this.issues[r.index]):r.name!==void 0&&this.issues.indexOf(r.name)!==-1?this.issueFromName(r.name):null}getServerHealthState(){return this.serverHealthState}async requestAuthUrl(r){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.healthCheck(r),this.status!=="unauthorized"?null:await this.auth.requestAuthUrl(r)}async waitForAuthToken(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");await this.auth.pollingToken(r,n),await this.setupApi();}async provideCompletions(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.logger.trace({request:r},"Call provideCompletions"),this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let s=Yn([this.nonParallelProvideCompletionAbortController.signal,n?.signal]),i=null,o={triggerMode:r.manually?"manual":"auto",cacheHit:!1,aborted:!1,requestSent:!1,requestLatency:0,requestCanceled:!1,requestTimeout:!1},l=null,c=new Sr(r);try{if(this.completionCache.has(c))o.cacheHit=!0,this.logger.debug({context:c},"Completion cache hit"),await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:0},{signal:s}),i=this.completionCache.get(c);else {o.cacheHit=!1;let p=this.createSegments(c);if(ge(p.prefix))o=null,this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+Ar(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.stats().averageResponseTime},n),o.requestSent=!0,l=performance.now();try{let u=await this.post("/v1/completions",{body:{language:r.language,segments:p,user:this.auth?.user}},{signal:s,timeout:r.manually?this.config.completion.timeout.manually:this.config.completion.timeout.auto});o.requestLatency=performance.now()-l,i={id:u.id,choices:u.choices.map(g=>({index:g.index,text:g.text,replaceRange:{start:r.position,end:r.position}}))};}catch(u){throw an(u)&&(o.requestCanceled=!0,o.requestLatency=performance.now()-l),bs(u)&&(o.requestTimeout=!0,o.requestLatency=NaN),u}if(i=await b0(c,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.buildCache(c,i);}}if(i=await E0(c,i),n?.signal?.aborted)throw n.signal.reason;i=this.calculateReplaceRange(i,c);}catch(p){throw an(p)||bs(p)?o&&(o.aborted=!0):o=null,p}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let p=this.completionProviderStats.windowed();switch(Ti.check(p)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return this.logger.trace({context:c,completionResponse:i},"Return from provideCompletions"),i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return this.completionProviderStats.addEvent(r.type),await this.post("/v1/events",{body:r,params:{query:{select_kind:r.select_kind}},parseAs:"text"},n),!0}};Wr.tryConnectInterval=1e3*30,Wr.submitStatsInterval=1e3*60*60*24;var ko=Wr;Nt();var Lo=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=Ce.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=Pe(this.buffer);if(!(n.length<1)){n[n.length-1].endsWith(` -`)?this.buffer="":this.buffer=n.pop();for(let s of n){let i=null;try{i=JSON.parse(s);}catch(l){this.logger.error({error:l},`Failed to parse request: ${s}`);continue}this.logger.debug({request:i},"Received request");let o=await this.handleRequest(i);this.sendResponse(o),this.logger.debug({response:o},"Sent response");}}}async handleRequest(e){let r=0,n=[0,null],s=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound. -`);r=e[0],n[0]=r;let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[i];if(!o)throw new Error(`Unknown function: ${i}`);let l=e[1].args;l.length>0&&typeof l[l.length-1]=="object"&&l[l.length-1].signal&&(this.abortControllers[r]=s,l[l.length-1].signal=s.signal),n[1]=await o.apply(this.agent,l);}}catch(i){an(i)?this.logger.debug({error:i,request:e},"Request canceled"):this.logger.error({error:i,request:e},"Failed to handle request");}finally{return this.abortControllers[r]&&delete this.abortControllers[r],n}}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+` -`);}bind(e){this.agent=e;for(let r of y0)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this)),["SIGTERM","SIGINT"].forEach(e=>{this.process.on(e,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var T0=new Lo;ko.create().then(t=>{T0.bind(t),T0.listen();}); +`,lv={server:"object","server.endpoint":"string","server.token":"string","server.requestHeaders":"object","server.requestTimeout":"number",completion:"object","completion.prompt":"object","completion.prompt.experimentalStripAutoClosingCharacters":"boolean","completion.prompt.maxPrefixLines":"number","completion.prompt.maxSuffixLines":"number","completion.debounce":"object","completion.debounce.mode":"string","completion.debounce.interval":"number","completion.timeout":"number",postprocess:"object","postprocess.limitScopeByIndentation":"object","postprocess.limitScopeByIndentation.experimentalKeepBlockScopeWhenCompletingLine":"boolean",logs:"object","logs.level":"string",anonymousUsageTracking:"object","anonymousUsageTracking.disable":"boolean"};function yk(t,e,r){typeof Ci(t,e)!==r&&Ri(t,e);}function wk(t){let e={...t};for(let r in lv)yk(e,r,lv[r]);return e}var Dr=(()=>{let t=G("events"),e=Oa(),r=ov(),n=Il(),s=xi();class i extends t{constructor(d){super();this.data={};this.watcher=null;this.logger=(_t(),Xs(ev)).rootLogger.child({component:"ConfigFile"});this.filepath=d;}get config(){return this.data}async load(){try{let d=await e.readFile(this.filepath,"utf8"),u=r.parse(d);if(Object.keys(u).length===0&&d.trim()!==av.trim()){await this.createTemplate();return}this.data=wk(u);}catch(d){d.code==="ENOENT"?await this.createTemplate():this.logger.error({error:d},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,av);}catch(d){this.logger.error({error:d},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3});let d=async()=>{let u=this.data;await this.load(),s(u,this.data)||super.emit("updated",this.data);};this.watcher.on("add",d),this.watcher.on("change",d);}}let o=G("path").join(G("os").homedir(),".tabby-client","agent","config.toml");return new i(o)})();var Mn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,cv=new Set,Ru=typeof process=="object"&&process?process:{},fv=(t,e,r,n)=>{typeof Ru.emitWarning=="function"?Ru.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Ps=globalThis.AbortController,uv=globalThis.AbortSignal;if(typeof Ps>"u"){uv=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s);}},Ps=class{constructor(){e();}signal=new uv;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=Ru.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,fv("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var bk=t=>!cv.has(t),Ut=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),hv=t=>Ut(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?qr:null:null,qr=class extends Array{constructor(e){super(e),this.fill(0);}},Tu=class t{heap;length;static#l=!1;static create(e){let r=hv(e);if(!r)return [];t.#l=!0;let n=new t(e,r);return t.#l=!1,n}constructor(e,r){if(!t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Os=class t{#l;#f;#y;#p;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#m;#i;#r;#e;#u;#h;#a;#s;#_;#o;#S;#E;#g;#w;#x;#c;static unsafeExposeInternals(e){return {starts:e.#E,ttls:e.#g,sizes:e.#S,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#h,get head(){return e.#a},get tail(){return e.#s},free:e.#_,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,s,i)=>e.#M(r,n,s,i),moveToTail:r=>e.#T(r),indexes:r=>e.#b(r),rindexes:r=>e.#v(r),isStale:r=>e.#d(r)}}get max(){return this.#l}get maxSize(){return this.#f}get calculatedSize(){return this.#m}get size(){return this.#n}get fetchMethod(){return this.#I}get dispose(){return this.#y}get disposeAfter(){return this.#p}constructor(e){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:d,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:_,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:v,fetchMethod:E,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:M,ignoreFetchAbort:k}=e;if(r!==0&&!Ut(r))throw new TypeError("max option must be a nonnegative integer");let j=r?hv(r):Array;if(!j)throw new Error("invalid max value: "+r);if(this.#l=r,this.#f=m,this.maxEntrySize=y||this.#f,this.sizeCalculation=v,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=E,this.#x=!!E,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new j(r),this.#h=new j(r),this.#a=0,this.#s=0,this.#_=Tu.create(r),this.#n=0,this.#m=0,typeof d=="function"&&(this.#y=d),typeof u=="function"?(this.#p=u,this.#o=[]):(this.#p=void 0,this.#o=void 0),this.#w=!!this.#y,this.#c=!!this.#p,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(this.#f!==0&&!Ut(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!Ut(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D();}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ut(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Ut(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F();}if(this.#l===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#f){let U="LRU_CACHE_UNBOUNDED";bk(U)&&(cv.add(U),fv("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,t));}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#F(){let e=new qr(this.#l),r=new qr(this.#l);this.#g=e,this.#E=r,this.#N=(i,o,a=Mn.now())=>{if(r[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#d(i)&&this.delete(this.#r[i]);},o+1);c.unref&&c.unref();}},this.#C=i=>{r[i]=e[i]!==0?Mn.now():0;},this.#A=(i,o)=>{if(e[o]){let a=e[o],c=r[o];i.ttl=a,i.start=c,i.now=n||s();let d=i.now-c;i.remainingTTL=a-d;}};let n=0,s=()=>{let i=Mn.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=this.#i.get(i);if(o===void 0)return 0;let a=e[o],c=r[o];if(a===0||c===0)return 1/0;let d=(n||s())-c;return a-d},this.#d=i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i];}#C=()=>{};#A=()=>{};#N=()=>{};#d=()=>!1;#D(){let e=new qr(this.#l);this.#m=0,this.#S=e,this.#R=r=>{this.#m-=e[r],e[r]=0;},this.#k=(r,n,s,i)=>{if(this.#t(n))return 0;if(!Ut(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!Ut(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#P=(r,n,s)=>{if(e[r]=n,this.#f){let i=this.#f-e[r];for(;this.#m>i;)this.#O(!0);}this.#m+=e[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#m);};}#R=e=>{};#P=(e,r,n)=>{};#k=(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#b({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#$(r)||((e||!this.#d(r))&&(yield r),r===this.#a));)r=this.#h[r];}*#v({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#a;!(!this.#$(r)||((e||!this.#d(r))&&(yield r),r===this.#s));)r=this.#u[r];}#$(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#b())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#b()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#v()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*values(){for(let e of this.#b())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.#b()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#b()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#r[n],this);}}rforEach(e,r=this){for(let n of this.#v()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#r[n],this);}}purgeStale(){let e=!1;for(let r of this.#v({allowStale:!0}))this.#d(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#b({allowStale:!0})){let n=this.#r[r],s=this.#e[r],i=this.#t(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#g&&this.#E){o.ttl=this.#g[r];let a=Mn.now()-this.#E[r];o.start=Math.floor(Date.now()-a);}this.#S&&(o.size=this.#S[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Mn.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,u=this.#k(e,r,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#n===0?void 0:this.#i.get(e);if(p===void 0)p=this.#n===0?this.#s:this.#_.length!==0?this.#_.pop():this.#n===this.#l?this.#O(!1):this.#n,this.#r[p]=e,this.#e[p]=r,this.#i.set(e,p),this.#u[this.#s]=p,this.#h[p]=this.#s,this.#s=p,this.#n++,this.#P(p,u,c),c&&(c.set="add"),d=!1;else {this.#T(p);let _=this.#e[p];if(r!==_){if(this.#x&&this.#t(_)?_.__abortController.abort(new Error("replaced")):o||(this.#w&&this.#y?.(_,e,"set"),this.#c&&this.#o?.push([_,e,"set"])),this.#R(p),this.#P(p,u,c),this.#e[p]=r,c){c.set="replace";let m=_&&this.#t(_)?_.__staleWhileFetching:_;m!==void 0&&(c.oldValue=m);}}else c&&(c.set="update");}if(s!==0&&!this.#g&&this.#F(),this.#g&&(d||this.#N(p,s,i),c&&this.#A(c,p)),!o&&this.#c&&this.#o){let _=this.#o,m;for(;m=_?.shift();)this.#p?.(...m);}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}}#O(e){let r=this.#a,n=this.#r[r],s=this.#e[r];return this.#x&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#w||this.#c)&&(this.#w&&this.#y?.(s,n,"evict"),this.#c&&this.#o?.push([s,n,"evict"])),this.#R(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#_.push(r)),this.#n===1?(this.#a=this.#s=0,this.#_.length=0):this.#a=this.#u[r],this.#i.delete(n),this.#n--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=this.#i.get(e);if(i!==void 0){let o=this.#e[i];if(this.#t(o)&&o.__staleWhileFetching===void 0)return !1;if(this.#d(i))s&&(s.has="stale",this.#A(s,i));else return n&&this.#C(i),s&&(s.has="hit",this.#A(s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=this.#i.get(e);if(s!==void 0&&(n||!this.#d(s))){let i=this.#e[s];return this.#t(i)?i.__staleWhileFetching:i}}#M(e,r,n,s){let i=r===void 0?void 0:this.#e[r];if(this.#t(i))return i;let o=new Ps,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},d=(v,E=!1)=>{let{aborted:A}=o.signal,w=n.ignoreFetchAbort&&v!==void 0;if(n.status&&(A&&!E?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),A&&!w&&!E)return p(o.signal.reason);let x=m;return this.#e[r]===m&&(v===void 0?x.__staleWhileFetching?this.#e[r]=x.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,v,c.options))),v},u=v=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=v),p(v)),p=v=>{let{aborted:E}=o.signal,A=E&&n.allowStaleOnFetchAbort,w=A||n.allowStaleOnFetchRejection,x=w||n.noDeleteOnFetchRejection,M=m;if(this.#e[r]===m&&(!x||M.__staleWhileFetching===void 0?this.delete(e):A||(this.#e[r]=M.__staleWhileFetching)),w)return n.status&&M.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw v},_=(v,E)=>{let A=this.#I?.(e,i,c);A&&A instanceof Promise&&A.then(w=>v(w),E),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(v(),n.allowStaleOnFetchAbort&&(v=w=>d(w,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(_).then(d,u),y=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,y,{...c.options,status:void 0}),r=this.#i.get(e)):this.#e[r]=y,y}#t(e){if(!this.#x)return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ps}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=!1,status:A,signal:w}=r;if(!this.#x)return A&&(A.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:A});let x={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:d,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:A,signal:w},M=this.#i.get(e);if(M===void 0){A&&(A.fetch="miss");let k=this.#M(e,M,x,v);return k.__returned=k}else {let k=this.#e[M];if(this.#t(k)){let B=n&&k.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",B&&(A.returnedStale=!0)),B?k.__staleWhileFetching:k.__returned=k}let j=this.#d(M);if(!E&&!j)return A&&(A.fetch="hit"),this.#T(M),s&&this.#C(M),A&&this.#A(A,M),k;let U=this.#M(e,M,x,v),F=U.__staleWhileFetching!==void 0&&n;return A&&(A.fetch=j?"stale":"refresh",F&&j&&(A.returnedStale=!0)),F?U.__staleWhileFetching:U.__returned=U}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,a=this.#i.get(e);if(a!==void 0){let c=this.#e[a],d=this.#t(c);return o&&this.#A(o,a),this.#d(a)?(o&&(o.get="stale"),d?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),d?c.__staleWhileFetching:(this.#T(a),s&&this.#C(a),c))}else o&&(o.get="miss");}#L(e,r){this.#h[r]=e,this.#u[e]=r;}#T(e){e!==this.#s&&(e===this.#a?this.#a=this.#u[e]:this.#L(this.#h[e],this.#u[e]),this.#L(this.#s,e),this.#s=e);}delete(e){let r=!1;if(this.#n!==0){let n=this.#i.get(e);if(n!==void 0)if(r=!0,this.#n===1)this.clear();else {this.#R(n);let s=this.#e[n];this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#c)&&(this.#w&&this.#y?.(s,e,"delete"),this.#c&&this.#o?.push([s,e,"delete"])),this.#i.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s?this.#s=this.#h[n]:n===this.#a?this.#a=this.#u[n]:(this.#u[this.#h[n]]=this.#u[n],this.#h[this.#u[n]]=this.#h[n]),this.#n--,this.#_.push(n);}}if(this.#c&&this.#o?.length){let n=this.#o,s;for(;s=n?.shift();)this.#p?.(...s);}return r}clear(){for(let e of this.#v({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else {let n=this.#r[e];this.#w&&this.#y?.(r,n,"delete"),this.#c&&this.#o?.push([r,n,"delete"]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#g&&this.#E&&(this.#g.fill(0),this.#E.fill(0)),this.#S&&this.#S.fill(0),this.#a=0,this.#s=0,this.#_.length=0,this.#m=0,this.#n=0,this.#c&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}};var wv=fr(yv());function Sk(t){return t.trimEnd().split("").every(e=>Ti.includes(e))}var Ht=class{constructor(e){this.filepath=e.filepath,this.language=e.language,this.text=e.text,this.position=e.position,this.prefix=e.text.slice(0,e.position),this.suffix=e.text.slice(e.position),this.prefixLines=_e(this.prefix),this.suffixLines=_e(this.suffix);let r=Sk(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, wv.default)({filepath:e.filepath,language:e.language,text:e.text,position:e.position});}};var bv=["statusChanged","configUpdated","authRequired","issuesUpdated"];_t();var Ms=class{constructor(){this.logger=be.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new Os({max:this.options.maxCount});}has(e){return this.cache.has(e.hash)}buildCache(e,r){this.logger.debug({key:e,value:r},"Starting to build cache");let n=this.createCacheEntries(e,r);n.forEach(s=>{this.cache.set(s.key.hash,{value:s.value,rebuildFlag:s.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(e){let r=this.cache.get(e.hash);return r?.rebuildFlag&&this.buildCache(e,r?.value),r?.value}createCacheEntries(e,r){let n=[{key:e,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let i of r.choices){let o=i.text.slice(e.position-i.replaceRange.start),a=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:a},"Calculate per-line cache positions");for(let d of a){let u=o.slice(0,d),p=this.generateAutoClosedPrefixes(u);for(let _ of [u,...p]){let m={key:new Ht({...e,text:e.text.slice(0,e.position)+_+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:i.index,text:o.slice(d),replaceRange:{start:e.position+d,end:e.position+d}}]},rebuildFlag:!0};this.logger.trace({prefix:_,entry:m},"Build per-line cache entry"),n.push(m);}}let c=this.getPerCharacterPositions(o);this.logger.trace({completionText:o,perCharacterPositions:c},"Calculate per-character cache positions");for(let d of c){let u=d;for(;u>0&&o[u-1]!==` +`;)u--;let p=o.slice(0,d),_=this.generateAutoClosedPrefixes(p);for(let m of [p,..._]){let y={key:new Ht({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:i.index,text:o.slice(u),replaceRange:{start:e.position+u,end:e.position+d}}]},rebuildFlag:!1};this.logger.trace({prefix:m,entry:y},"Build per-character cache entry"),n.push(y);}}}return n.reduce((i,o)=>{let a=i.find(c=>c.key.hash===o.key.hash);return a?(a.value.choices.push(...o.value.choices),a.rebuildFlag=a.rebuildFlag||o.rebuildFlag):i.push(o),i},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,s=_e(e),i=0,o=0;for(;is;s++){let o=Bp.indexOf(n[n.length-1-s]);if(o<0)break;i=i+Ti[o],r.push(e+i);}return r}};_t();function Ou(t,e,r){return Math.max(t,Math.min(e,r))}var Fs=class{constructor(){this.logger=be.child({component:"CompletionDebounce"});this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:s,responseTime:i}=e;if(n.manually)return this.sleep(0,r);if(s.mode==="fixed")return this.sleep(s.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let a=this.calcContextScore(n),d=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*a)*this.baseInterval,u=Ou(this.options.requestDelay.min,this.options.requestDelay.max,d-i);return this.sleep(u,r)}async sleep(e,r){return new Promise((n,s)=>{let i=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(i),s(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(i),s(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,s)=>n+s,0)/this.calledIntervalHistory.length;this.baseInterval=Ou(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=_e(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Ou(0,1,r),r}};Ft();_t();var Ce=be.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function ut(t,e){return async r=>(r.choices=(await Promise.all(r.choices.map(async n=>{let s=e.position-n.replaceRange.start,i=await t(n.text.slice(s));return n.text=n.text.slice(0,s)+(i??""),n}))).filter(n=>!!n.text).distinct(n=>n.text),r)}function Ek(t){return /\n(\s*)\n/g}var vv=t=>e=>{let r=e.split(Ek()),n=0,s=2,i=r.length-2;for(;i>=1;){if(ae(r[i])){i--;continue}let o=i-1;for(;o>=0&&ae(r[o]);)o--;if(o<0)break;let a=r[i].trim(),c=r[o].trim(),d=Math.max(.1*a.length,.1*c.length);if(Er(a,c)<=d)n++,i--;else break}return n>=s?(Ce.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var Sv=()=>t=>{let e=_e(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(ae(e[s])){s--;continue}let i=s-1;for(;i>=0&&ae(e[i]);)i--;if(i<0)break;let o=e[s].trim(),a=e[i].trim(),c=Math.max(.1*o.length,.1*a.length);if(Er(o,a)<=c)r++,s=i;else break}return r>=n?(Ce.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var Ak=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],Ev=()=>t=>{let e=_e(t),r=e.length-1;for(;r>=0&&ae(e[r]);)r--;if(r<0)return t;for(let n of Ak){let s=e[r].match(n);if(s)return Ce.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};Ft();function jt(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function xk(t,e){return e>=t.length-1?!1:jt(t[e])s};if(t.length==0||e.length==0)return i;let o=e[e.length-1],a=ae(o),c=e.length-1;for(;c>=0&&ae(e[c]);)c--;if(c<0)return i;let d=e[c],u=jt(d),p=t[0],_=ae(p),m=0;for(;m=t.length)return i;let y=t[m],v;_?v=jt(y):v=jt(o+y),!_&&!a?(n.experimentalKeepBlockScopeWhenCompletingLine?i.indentLevelLimit=u:i.indentLevelLimit=u+1,s=!!t[1]&&jt(t[1])>u):v>u?(i.indentLevelLimit=u+1,s=!0):(i.indentLevelLimit=u,s=!0);let E=1;for(;E{let w=A.startsWith(r[E])||r[E].startsWith(A);return s&&!w}),i}function Mu(t,e){return r=>{let{prefixLines:n,suffixLines:s}=t,i=_e(r);if(t.mode==="fill-in-line"&&i.length>1)return Ce.debug({inputLines:i,prefixLines:n,suffixLines:s},"Drop content with multiple lines"),null;let o=Ck(i,n,s,e),a;for(a=1;a=0&&t[r].match(/\s/);)r--;if(r<0)return 0;let n=t.lastIndexOf(` +`,r);if(n<0)return 0;let i=t.slice(n+1,e).search(/\S/);return n+1+i}function Ik(t,e){let r=e;for(;r=t.length)return t.length;let n=t.indexOf(` +`,r);return n<0?t.length:n}function Pk(t,e){for(let r of e){let n=t;for(;n;){if(r.includes(n.type))return n;n=n.parent;}}return t}function Tv(t){return async e=>{let{position:r,text:n,language:s,prefix:i,suffix:o}=t;if(!Fu.includes(s))return e;let a=Ur[s],c=await ks(a),d=i+e+o,u=c.parse(d),p=Tk(d,r),_=Ik(d,r),m=Pk(u.rootNode.namedDescendantForIndex(p,_),Rv[a]);return m.endIndexe.experimentalSyntax&&Fu.includes(t.language)?Tv(t)(r):Mu(t,e.indentation)(r)}var Nu=t=>e=>{let {prefixLines:r,suffixLines:n}=t;_e(e);let i=e,o=r[r.length-1]??"",a=n[0]??"";return !ae(o)&&o.match(/\s$/)&&(i=i.trimStart()),(ae(a)||!ae(a)&&a.match(/^\s/))&&(i=i.trimEnd()),i};var ku=t=>e=>{let{suffixLines:r}=t,n=_e(e),s=0;for(;st=>ae(t)?null:t;function Pv(t,e){let{suffixLines:r}=e,n=r[0]?.trimEnd()||"";if(ae(n))return t;for(let s of t.choices){let i=s.text.slice(e.position-s.replaceRange.start),o=Ii(i);ae(o)||(n.startsWith(o)?(s.replaceRange.end=e.position+o.length,Ce.trace({context:e,completion:s.text,range:s.replaceRange,unpaired:o},"Adjust replace range by bracket stack")):o.startsWith(n)&&(s.replaceRange.end=e.position+n.length,Ce.trace({context:e,completion:s.text,range:s.replaceRange,unpaired:o},"Adjust replace range by bracket stack")));}return t}var Lu=Object.keys(Ur);async function Ov(t,e){let{position:r,prefix:n,suffix:s,prefixLines:i,suffixLines:o,language:a}=e;if(!Lu.includes(a))return t;let c=Ur[a],d=await ks(c),p=o[0]?.trimEnd()||"";if(ae(p))return t;for(let _ of t.choices){let m=_.text.slice(r-_.replaceRange.start),y=_e(m),v=0,E=d.parse(n+m+s),A=E.rootNode.namedDescendantForIndex(n.length+m.length);for(;A.hasError()&&vthis.maxSize&&this.values.shift();}getValues(){return this.values}},Ds=class{constructor(){this.logger=be.child({component:"CompletionProviderStats"});this.config={windowSize:10,checks:{disable:!1,healthy:{windowSize:3,latency:2400},slowResponseTime:{latency:3200,count:3},highTimeoutRate:{rate:.5,count:3}}};this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new Uu.Univariate;this.completionRequestCanceledStats=new Ls;this.completionRequestTimeoutCount=0;}updateConfigByRequestTimeout(e){this.config.checks.healthy.latency=e*.6,this.config.checks.slowResponseTime.latency=e*.8,this.resetWindowed();}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:a,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(a?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),a||this.recentCompletionRequestLatencies.add(o));}addEvent(e){let r=this.eventMap.get(e)||0;this.eventMap.set(e,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new Uu.Univariate,this.completionRequestCanceledStats=new Ls,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Hu(this.config.windowSize);}stats(){let e=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...e},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(i=>Number.isNaN(i)),n=e.filter(i=>!Number.isNaN(i)),s=n.reduce((i,o)=>i+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:s}}}check(e){if(this.config.checks.disable)return null;let r=this.config.checks,{values:n,stats:{total:s,timeouts:i,responses:o,averageResponseTime:a}}=e;return n.slice(-Math.max(this.config.windowSize,r.healthy.windowSize)).every(c=>cr.highTimeoutRate.rate&&i>=r.highTimeoutRate.count?"highTimeoutRate":a>r.slowResponseTime.latency&&o>=r.slowResponseTime.count?"slowResponseTime":null}};var Bs=class t extends events.EventEmitter{constructor(){super();this.logger=be.child({component:"TabbyAgent"});this.config=Cu;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.connectionErrorMessage=null;this.dataStore=null;this.completionCache=new Ms;this.completionDebounce=new Fs;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new Ds;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},t.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},t.submitStatsInterval);}static{this.tryConnectInterval=1e3*30;}static{this.submitStatsInterval=1e3*60*60*24;}static async create(r){let n=new t;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await $s.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=Op(Cu,this.userConfig,this.clientConfig),Lr.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,ae(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await Is.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,(0, qs.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),this.popIssue("connectionFailed"),this.connectionErrorMessage=null),await this.setupApi(),(0, qs.default)(r.server,this.config.server)||n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired(),r.completion.timeout!==this.config.completion.timeout&&(this.completionProviderStats.updateConfigByRequestTimeout(this.config.completion.timeout),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"));let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){let r=ae(this.config.server.token)?this.auth?.token?`Bearer ${this.auth.token}`:void 0:`Bearer ${this.config.server.token}`;this.api=Zt({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:r,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats};case"connectionFailed":return {name:"connectionFailed",message:this.connectionErrorMessage}}}pushIssue(r){this.issues.includes(r)||(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}createAbortSignal(r){let n=Math.min(2147483647,r?.timeout||this.config.server.requestTimeout);return an([AbortSignal.timeout(n),r?.signal])}async healthCheck(r){let n=gt(),s="/v1/health",i=this.config.server.endpoint+s,o={signal:this.createAbortSignal(r)};try{this.logger.debug({requestId:n,requestOptions:o,url:i},"Health check request");let a=await this.api.GET(s,o);if(a.error)throw new De(a.response);this.logger.debug({requestId:n,response:a},"Health check response"),this.changeStatus("ready"),this.popIssue("connectionFailed"),this.connectionErrorMessage=null;let c=a.data;typeof c=="object"&&c.model!==void 0&&c.device!==void 0&&(this.serverHealthState=c,this.anonymousUsageLogger.uniqueEvent("AgentConnected",c));}catch(a){this.serverHealthState=null,a instanceof De&&[401,403,405].includes(a.status)&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&ae(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:n,error:a},"Health check error: unauthorized"),this.changeStatus("unauthorized")):(ln(a)?(this.logger.debug({requestId:n,error:a},"Health check error: timeout"),this.connectionErrorMessage=`GET ${i}: Timed out.`):Yt(a)?(this.logger.debug({requestId:n,error:a},"Health check error: canceled"),this.connectionErrorMessage=`GET ${i}: Canceled.`):(this.logger.error({requestId:n,error:a},"Health check error: unknown error"),this.connectionErrorMessage=`GET ${i}: Request failed: +${ha(a)}`),this.pushIssue("connectionFailed"),this.changeStatus("disconnected"));}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,{prefixLines:i,suffixLines:o}=r,a=i.slice(Math.max(i.length-n,0)).join(""),c;return this.config.completion.prompt.experimentalStripAutoClosingCharacters&&r.mode!=="fill-in-line"?c=` +`+o.slice(1,s).join(""):c=o.slice(0,s).join(""),{prefix:a,suffix:c}}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;Lr.forEach(i=>i.setBindings?.({...s})),s&&Object.entries(s).forEach(([i,o])=>{this.anonymousUsageLogger.setSessionProperties(i,o);}),n&&Object.entries(n).forEach(([i,o])=>{this.anonymousUsageLogger.setUserProperties(i,o);});}return Dr&&(await Dr.load(),this.userConfig=Dr.config,Dr.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Dr.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&(clearInterval(this.tryingConnectTimer),this.tryingConnectTimer=null),this.submitStatsTimer&&(clearInterval(this.submitStatsTimer),this.submitStatsTimer=null),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,s){switch(r){case"session":let i={};Sr(i,n,s),Lr.forEach(o=>o.setBindings?.(i)),this.anonymousUsageLogger.setSessionProperties(n,s);break;case"user":this.anonymousUsageLogger.setUserProperties(n,s);break}return !0}async updateConfig(r,n){let s=Ci(this.clientConfig,r);return (0, qs.default)(s,n)||(n===void 0?Ri(this.clientConfig,r):Sr(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){return r.index!==void 0&&r.index({index:v.index,text:v.text,replaceRange:{start:r.position,end:r.position}}))};}catch(p){throw Yt(p)?(this.logger.debug({requestId:u,error:p},"Completion request canceled"),o.requestCanceled=!0,o.requestLatency=performance.now()-a):ln(p)?(this.logger.debug({requestId:u,error:p},"Completion request timeout"),o.requestTimeout=!0,o.requestLatency=NaN):(this.logger.error({requestId:u,error:p},"Completion request failed with unknown error"),this.healthCheck()),p}if(i=await Mv(c,this.config.postprocess,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.buildCache(c,JSON.parse(JSON.stringify(i)));}}if(i=await Fv(c,this.config.postprocess,i),n?.signal?.aborted||(i=await Nv(c,this.config.postprocess,i),n?.signal?.aborted))throw n.signal.reason}catch(d){throw Yt(d)||ln(d)?o&&(o.aborted=!0):o=null,d}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let d=this.completionProviderStats.windowed();switch(this.completionProviderStats.check(d)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return this.logger.trace({context:c,completionResponse:i},"Return from provideCompletions"),i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.completionProviderStats.addEvent(r.type);let s=gt();try{let i="/v1/events",o={body:r,params:{query:{select_kind:r.select_kind}},signal:this.createAbortSignal(n),parseAs:"text"};this.logger.debug({requestId:s,requestOptions:o,url:this.config.server.endpoint+i},"Event request");let a=await this.api.POST(i,o);if(a.error)throw new De(a.response);return this.logger.debug({requestId:s,response:a},"Event response"),!0}catch(i){return ln(i)?this.logger.debug({requestId:s,error:i},"Event request timeout"):Yt(i)?this.logger.debug({requestId:s,error:i},"Event request canceled"):this.logger.error({requestId:s,error:i},"Event request failed with unknown error"),!1}}};_t();var Us=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=be.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=_e(this.buffer);if(!(n.length<1)){n[n.length-1].endsWith(` +`)?this.buffer="":this.buffer=n.pop();for(let s of n){let i=null;try{i=JSON.parse(s);}catch(a){this.logger.error({error:a},`Failed to parse request: ${s}`);continue}this.logger.debug({request:i},"Received request");let o=await this.handleRequest(i);this.sendResponse(o),this.logger.debug({response:o},"Sent response");}}}async handleRequest(e){let r=0,n=[0,null],s=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound. +`);r=e[0],n[0]=r;let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[i];if(!o)throw new Error(`Unknown function: ${i}`);let a=e[1].args;a.length>0&&typeof a[a.length-1]=="object"&&a[a.length-1].signal&&(this.abortControllers[r]=s,a[a.length-1].signal=s.signal),n[1]=await o.apply(this.agent,a);}}catch(i){Yt(i)?this.logger.debug({error:i,request:e},"Request canceled"):this.logger.error({error:i,request:e},"Failed to handle request");}finally{return this.abortControllers[r]&&delete this.abortControllers[r],n}}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+` +`);}bind(e){this.agent=e;for(let r of bv)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this)),["SIGTERM","SIGINT"].forEach(e=>{this.process.on(e,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var Hv=new Us;Bs.create().then(t=>{Hv.bind(t),Hv.listen();}); /*! Bundled license information: normalize-path/index.js: diff --git a/clients/vim/node_scripts/wasm/tree-sitter-go.wasm b/clients/vim/node_scripts/wasm/tree-sitter-go.wasm new file mode 100644 index 000000000000..719ebf62b746 --- /dev/null +++ b/clients/vim/node_scripts/wasm/tree-sitter-go.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b69c5af834fd23053238e484c7fe9ed2f121d5b1fe32242af78576d67e49f1e +size 240169 diff --git a/clients/vim/node_scripts/wasm/tree-sitter-python.wasm b/clients/vim/node_scripts/wasm/tree-sitter-python.wasm new file mode 100644 index 000000000000..ae2cce790da4 --- /dev/null +++ b/clients/vim/node_scripts/wasm/tree-sitter-python.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72d0f97ba6c3134d7873ec5c9d0fd3c1f5137f4eac4dda0709993d92809e62b6 +size 474189 diff --git a/clients/vim/node_scripts/wasm/tree-sitter-ruby.wasm b/clients/vim/node_scripts/wasm/tree-sitter-ruby.wasm new file mode 100644 index 000000000000..f0e02da9bd52 --- /dev/null +++ b/clients/vim/node_scripts/wasm/tree-sitter-ruby.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1190cddd839b78c2aec737573399a71c23fe9a546d3543f86304c4c68ca73852 +size 990787 diff --git a/clients/vim/node_scripts/wasm/tree-sitter-rust.wasm b/clients/vim/node_scripts/wasm/tree-sitter-rust.wasm new file mode 100644 index 000000000000..d608d6cda48b --- /dev/null +++ b/clients/vim/node_scripts/wasm/tree-sitter-rust.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:273f9ce6f2c595ad4e63b3195513b61974ae1ec513efcce39da1afa90574ef38 +size 844087 diff --git a/clients/vim/node_scripts/wasm/tree-sitter-tsx.wasm b/clients/vim/node_scripts/wasm/tree-sitter-tsx.wasm new file mode 100644 index 000000000000..76509d0553d4 --- /dev/null +++ b/clients/vim/node_scripts/wasm/tree-sitter-tsx.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:060422a330f9c819a10e7310788d336dbcb53cc6a4be0e91d40f644564080f97 +size 1182114 diff --git a/clients/vim/node_scripts/wasm/tree-sitter.wasm b/clients/vim/node_scripts/wasm/tree-sitter.wasm new file mode 100644 index 000000000000..81dd1588401a --- /dev/null +++ b/clients/vim/node_scripts/wasm/tree-sitter.wasm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17382e1a69bd628107e8dfe37d31d57f7ba948e5f2da77e56a8aa010488dc5ae +size 186526 diff --git a/clients/vim/package.json b/clients/vim/package.json index 3d17dd49c37a..b49d41fed772 100644 --- a/clients/vim/package.json +++ b/clients/vim/package.json @@ -5,7 +5,7 @@ "repository": "https://github.com/TabbyML/tabby", "scripts": { "preupgrade-agent": "cd ../tabby-agent && yarn build", - "upgrade-agent": "rimraf ./node_scripts && cpy ../tabby-agent/dist/cli.js ./node_scripts/ --flat --rename=tabby-agent.js" + "upgrade-agent": "rimraf ./node_scripts && cpy ../tabby-agent/dist/cli.js ./node_scripts/ --flat --rename=tabby-agent.js && cpy ../tabby-agent/dist/wasm/* ./node_scripts/wasm/ --flat" }, "devDependencies": { "cpy-cli": "^4.2.0", From 79a41c9cab73f94b665160c837d02ec7f4c4c405 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Sat, 18 Nov 2023 16:03:24 +0800 Subject: [PATCH 15/24] feat(intellij): Add dont-show-again for warnings. Add more online help links. (#823) --- .../intellijtabby/actions/CheckIssueDetail.kt | 78 +++++++++++++++++-- .../actions/JoinTabbySlackCommunity.kt | 11 +++ ...OpenOnlineDocs.kt => OpenModelRegistry.kt} | 4 +- .../actions/OpenOnlineDocumentation.kt | 11 +++ .../actions/OpenTabbyGithubRepo.kt | 11 +++ .../intellijtabby/agent/AgentService.kt | 26 ++++++- .../settings/ApplicationSettingsPanel.kt | 19 +++++ .../settings/ApplicationSettingsState.kt | 14 +++- .../status/StatusBarWidgetFactory.kt | 8 +- .../src/main/resources/META-INF/plugin.xml | 30 +++++-- 10 files changed, 191 insertions(+), 21 deletions(-) create mode 100644 clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/JoinTabbySlackCommunity.kt rename clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/{OpenOnlineDocs.kt => OpenModelRegistry.kt} (69%) create mode 100644 clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocumentation.kt create mode 100644 clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenTabbyGithubRepo.kt diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt index 200a62f40815..f50477b7a373 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt @@ -1,21 +1,23 @@ package com.tabbyml.intellijtabby.actions -import com.intellij.openapi.actionSystem.ActionUpdateThread -import com.intellij.openapi.actionSystem.AnAction -import com.intellij.openapi.actionSystem.AnActionEvent +import com.intellij.openapi.actionSystem.* import com.intellij.openapi.application.invokeLater import com.intellij.openapi.components.service import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.ui.Messages +import com.intellij.openapi.ui.popup.JBPopupFactory import com.tabbyml.intellijtabby.agent.Agent import com.tabbyml.intellijtabby.agent.AgentService +import com.tabbyml.intellijtabby.settings.ApplicationSettingsState import kotlinx.coroutines.launch import java.net.URL + class CheckIssueDetail : AnAction() { private val logger = Logger.getInstance(CheckIssueDetail::class.java) override fun actionPerformed(e: AnActionEvent) { + val settings = service() val agentService = service() agentService.issueNotification?.expire() @@ -24,7 +26,23 @@ class CheckIssueDetail : AnAction() { if (detail["name"] == "connectionFailed") { invokeLater { val messages = "" + (detail["message"] as String?)?.replace("\n", "
") + "" - Messages.showErrorDialog(messages, "Cannot Connect to Tabby Server") + val selected = Messages.showDialog( + messages, + "Cannot Connect to Tabby Server", + arrayOf("OK", "Online Help"), + 0, + Messages.getErrorIcon(), + ) + when (selected) { + 0 -> { + // OK + } + + 1 -> { + // Online Help + showOnlineHelp(e) + } + } } return@launch } else { @@ -38,12 +56,51 @@ class CheckIssueDetail : AnAction() { } val message = buildDetailMessage(detail, serverHealthState, agentConfig) invokeLater { - Messages.showInfoMessage(message, title) + val selected = Messages.showDialog( + message, + title, + arrayOf("OK", "Online Help", "Don't Show Again"), + 0, + Messages.getWarningIcon(), + ) + when (selected) { + 0 -> { + // OK + } + + 1 -> { + // Online Help + showOnlineHelp(e) + } + + 2 -> { + // Don't Show Again + settings.notificationsMuted += listOf("completionResponseTimeIssues") + } + } } } } } + private fun showOnlineHelp(e: AnActionEvent) { + e.project?.let { + invokeLater { + val actionManager = ActionManager.getInstance() + val actionGroup = actionManager.getAction("Tabby.OpenOnlineHelp") as? ActionGroup ?: return@invokeLater + val popup = JBPopupFactory.getInstance().createActionGroupPopup( + "Online Help", + actionGroup, + e.dataContext, + false, + null, + 10, + ) + popup.showCenteredInCurrentWindow(it) + } + } + } + private fun buildDetailMessage( detail: Map, serverHealthState: Map?, @@ -76,7 +133,7 @@ class CheckIssueDetail : AnAction() { """ Your Tabby server is running model $model on CPU. This model may be performing poorly due to its large parameter size, please consider trying smaller models or switch to GPU. - You can find a list of supported models in the model directory. + You can find a list of recommend models in the model registry. """.trimIndent() } else { "" @@ -85,7 +142,7 @@ class CheckIssueDetail : AnAction() { val host = URL(agentConfig.server?.endpoint).host if (helpMessageForRunningLargeModelOnCPU.isEmpty()) { commonHelpMessage += "
  • The running model $model may be performing poorly due to its large parameter size.
    " - commonHelpMessage += "Please consider trying smaller models. You can find a list of supported models in the model directory.
  • " + commonHelpMessage += "Please consider trying smaller models. You can find a list of recommend models in the model registry." } if (!(host.startsWith("localhost") || host.startsWith("127.0.0.1"))) { commonHelpMessage += "
  • A poor network connection. Please check your network and proxy settings.
  • " @@ -106,8 +163,13 @@ class CheckIssueDetail : AnAction() { } override fun update(e: AnActionEvent) { + val settings = service() val agentService = service() - e.presentation.isVisible = agentService.currentIssue.value != null + val muted = mutableListOf() + if (settings.notificationsMuted.contains("completionResponseTimeIssues")) { + muted += listOf("slowCompletionResponseTime", "highCompletionTimeoutRate") + } + e.presentation.isVisible = agentService.currentIssue.value != null && agentService.currentIssue.value !in muted } override fun getActionUpdateThread(): ActionUpdateThread { diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/JoinTabbySlackCommunity.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/JoinTabbySlackCommunity.kt new file mode 100644 index 000000000000..73dd3e4b5854 --- /dev/null +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/JoinTabbySlackCommunity.kt @@ -0,0 +1,11 @@ +package com.tabbyml.intellijtabby.actions + +import com.intellij.ide.BrowserUtil +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.AnActionEvent + +class JoinTabbySlackCommunity: AnAction() { + override fun actionPerformed(e: AnActionEvent) { + BrowserUtil.browse("https://join.slack.com/t/tabbycommunity/shared_invite/zt-1xeiddizp-bciR2RtFTaJ37RBxr8VxpA") + } +} \ No newline at end of file diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocs.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenModelRegistry.kt similarity index 69% rename from clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocs.kt rename to clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenModelRegistry.kt index acfacb5f4ec1..9c3d43346f8a 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocs.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenModelRegistry.kt @@ -4,8 +4,8 @@ import com.intellij.ide.BrowserUtil import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent -class OpenOnlineDocs: AnAction() { +class OpenModelRegistry: AnAction() { override fun actionPerformed(e: AnActionEvent) { - BrowserUtil.browse("https://tabby.tabbyml.com/docs/extensions/") + BrowserUtil.browse("https://tabby.tabbyml.com/docs/models/") } } \ No newline at end of file diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocumentation.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocumentation.kt new file mode 100644 index 000000000000..cb794d27f2ce --- /dev/null +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenOnlineDocumentation.kt @@ -0,0 +1,11 @@ +package com.tabbyml.intellijtabby.actions + +import com.intellij.ide.BrowserUtil +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.AnActionEvent + +class OpenOnlineDocumentation: AnAction() { + override fun actionPerformed(e: AnActionEvent) { + BrowserUtil.browse("https://tabby.tabbyml.com/") + } +} \ No newline at end of file diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenTabbyGithubRepo.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenTabbyGithubRepo.kt new file mode 100644 index 000000000000..60eb49bebfba --- /dev/null +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/OpenTabbyGithubRepo.kt @@ -0,0 +1,11 @@ +package com.tabbyml.intellijtabby.actions + +import com.intellij.ide.BrowserUtil +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.AnActionEvent + +class OpenTabbyGithubRepo : AnAction() { + override fun actionPerformed(e: AnActionEvent) { + BrowserUtil.browse("https://github.com/tabbyml/tabby") + } +} \ No newline at end of file diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt index 3322a3a10e12..c9f2ae6f05d9 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt @@ -8,6 +8,8 @@ import com.intellij.notification.NotificationType import com.intellij.notification.Notifications import com.intellij.openapi.Disposable import com.intellij.openapi.actionSystem.ActionManager +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.application.ApplicationInfo import com.intellij.openapi.application.ReadAction import com.intellij.openapi.application.invokeLater @@ -76,7 +78,13 @@ class AgentService : Disposable { "${e.message}", NotificationType.ERROR, ) - notification.addAction(ActionManager.getInstance().getAction("Tabby.OpenOnlineDocs")) + notification.addAction( + object : AnAction("Open Online Documentation") { + override fun actionPerformed(e: AnActionEvent) { + BrowserUtil.browse("https://tabby.tabbyml.com/docs/extensions/troubleshooting/#tabby-initialization-failed") + } + } + ) invokeLater { initFailedNotification?.expire() initFailedNotification = notification @@ -131,16 +139,18 @@ class AgentService : Disposable { scope.launch { agent.currentIssue.collect { issueName -> + val showCompletionResponseWarnings = !completionResponseWarningShown && + !settings.notificationsMuted.contains("completionResponseTimeIssues") val message = when (issueName) { "connectionFailed" -> "Cannot connect to Tabby server" - "slowCompletionResponseTime" -> if (!completionResponseWarningShown) { + "slowCompletionResponseTime" -> if (showCompletionResponseWarnings) { completionResponseWarningShown = true "Completion requests appear to take too much time" } else { return@collect } - "highCompletionTimeoutRate" -> if (!completionResponseWarningShown) { + "highCompletionTimeoutRate" -> if (showCompletionResponseWarnings) { completionResponseWarningShown = true "Most completion requests timed out" } else { @@ -160,6 +170,16 @@ class AgentService : Disposable { NotificationType.WARNING, ) notification.addAction(ActionManager.getInstance().getAction("Tabby.CheckIssueDetail")) + if (issueName in listOf("slowCompletionResponseTime", "highCompletionTimeoutRate")) { + notification.addAction( + object : AnAction("Don't Show Again") { + override fun actionPerformed(e: AnActionEvent) { + issueNotification?.expire() + settings.notificationsMuted += listOf("completionResponseTimeIssues") + } + } + ) + } invokeLater { issueNotification?.expire() issueNotification = notification diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsPanel.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsPanel.kt index fdd5b5031f6c..cf550395b566 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsPanel.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsPanel.kt @@ -168,6 +168,19 @@ class ApplicationSettingsPanel { ) .panel + private val resetMutedNotificationsButton = JButton("Reset \"Don't Show Again\" Notifications").apply { + addActionListener { + val settings = service() + settings.notificationsMuted = listOf() + invokeLater(ModalityState.stateForComponent(this@ApplicationSettingsPanel.mainPanel)) { + Messages.showInfoMessage("Reset \"Don't Show Again\" notifications successfully.", "Reset Notifications") + } + } + } + private val resetMutedNotificationsPanel: JPanel = FormBuilder.createFormBuilder() + .addComponent(resetMutedNotificationsButton) + .panel + val mainPanel: JPanel = FormBuilder.createFormBuilder() .addLabeledComponent("Server endpoint", serverEndpointPanel, 5, false) .addSeparator(5) @@ -176,6 +189,12 @@ class ApplicationSettingsPanel { .addLabeledComponent("Node binary
    (Requires restart IDE)", nodeBinaryPanel, 5, false) .addSeparator(5) .addLabeledComponent("Anonymous usage tracking", isAnonymousUsageTrackingPanel, 5, false) + .apply { + if (service().notificationsMuted.isNotEmpty()) { + addSeparator(5) + addLabeledComponent("Notifications", resetMutedNotificationsPanel, 5, false) + } + } .addComponentFillVertically(JPanel(), 0) .panel diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsState.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsState.kt index 157b64b25187..e6d53aa463c0 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsState.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/settings/ApplicationSettingsState.kt @@ -56,11 +56,20 @@ class ApplicationSettingsState : PersistentStateComponent()) + val notificationsMutedState = notificationsMutedFlow.asStateFlow() + var notificationsMuted: List = listOf() + set(value) { + field = value + notificationsMutedFlow.value = value + } + data class State( val completionTriggerMode: TriggerMode, val serverEndpoint: String, val nodeBinary: String, val isAnonymousUsageTrackingDisabled: Boolean, + val notificationsMuted: List, ) val data: State @@ -69,6 +78,7 @@ class ApplicationSettingsState : PersistentStateComponent + notificationsMutedState, + ) { completionTriggerMode, serverEndpoint, nodeBinary, isAnonymousUsageTrackingDisabled, notificationsMuted -> State( completionTriggerMode = completionTriggerMode, serverEndpoint = serverEndpoint, nodeBinary = nodeBinary, isAnonymousUsageTrackingDisabled = isAnonymousUsageTrackingDisabled, + notificationsMuted = notificationsMuted, ) }.stateIn(CoroutineScope(Dispatchers.IO), SharingStarted.Eagerly, this.data) diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/status/StatusBarWidgetFactory.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/status/StatusBarWidgetFactory.kt index af2aef7fc2cf..8a621bfa7a0d 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/status/StatusBarWidgetFactory.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/status/StatusBarWidgetFactory.kt @@ -87,7 +87,7 @@ class StatusBarWidgetFactory : StatusBarEditorBasedWidgetFactory() { actionManager.getAction("Tabby.CheckIssueDetail"), actionManager.getAction("Tabby.ToggleInlineCompletionTriggerMode"), actionManager.getAction("Tabby.OpenSettings"), - actionManager.getAction("Tabby.OpenOnlineDocs"), + actionManager.getAction("Tabby.OpenOnlineHelp"), ) } }, @@ -109,7 +109,11 @@ class StatusBarWidgetFactory : StatusBarEditorBasedWidgetFactory() { tooltip = "Tabby: Initialization failed" } Agent.Status.READY -> { - if (state.currentIssue != null) { + val muted = mutableListOf() + if (state.settings.notificationsMuted.contains("completionResponseTimeIssues")) { + muted += listOf("slowCompletionResponseTime", "highCompletionTimeoutRate") + } + if (state.currentIssue != null && state.currentIssue !in muted) { icon = AllIcons.General.Warning tooltip = when(state.currentIssue) { "slowCompletionResponseTime" -> "Tabby: Completion requests appear to take too much time" diff --git a/clients/intellij/src/main/resources/META-INF/plugin.xml b/clients/intellij/src/main/resources/META-INF/plugin.xml index e62399bf66e0..8d0b427763df 100644 --- a/clients/intellij/src/main/resources/META-INF/plugin.xml +++ b/clients/intellij/src/main/resources/META-INF/plugin.xml @@ -93,11 +93,31 @@ text="Open Settings..." description="Show settings for Tabby."> - - + + + + + + + + + + \ No newline at end of file From fa7e56581c5df1c72881e9596f049f5d84e79e9d Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sat, 18 Nov 2023 00:05:48 -0800 Subject: [PATCH 16/24] feat: implement basic dependency detection for python / rust (#825) * refactor: extract tags mod for dataset.rs * feat: implement basic dependency detection for python / rust --- Cargo.lock | 77 ++++++++++++ crates/tabby-common/src/lib.rs | 13 +++ crates/tabby-common/src/path.rs | 4 + crates/tabby-scheduler/Cargo.toml | 3 + crates/tabby-scheduler/src/dataset.rs | 130 ++------------------- crates/tabby-scheduler/src/dataset/deps.rs | 86 ++++++++++++++ crates/tabby-scheduler/src/dataset/tags.rs | 111 ++++++++++++++++++ 7 files changed, 304 insertions(+), 120 deletions(-) create mode 100644 crates/tabby-scheduler/src/dataset/deps.rs create mode 100644 crates/tabby-scheduler/src/dataset/tags.rs diff --git a/Cargo.lock b/Cargo.lock index 45da1b2da2ac..1f9e608de8d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1723,6 +1723,16 @@ dependencies = [ "regex", ] +[[package]] +name = "globwalk" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9db17aec586697a93219b19726b5b68307eba92898c34b170857343fe67c99d" +dependencies = [ + "ignore", + "walkdir", +] + [[package]] name = "gloo-timers" version = "0.2.6" @@ -3029,6 +3039,51 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pest" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "pest_meta" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.6.3" @@ -3444,6 +3499,19 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" +[[package]] +name = "requirements" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2643e903f79d8e6bc310ee0def974d12a33561d14e0728511b6ba5e8be0791c3" +dependencies = [ + "globwalk", + "pest", + "pest_derive", + "regex", + "walkdir", +] + [[package]] name = "reqwest" version = "0.11.22" @@ -4441,8 +4509,11 @@ dependencies = [ "job_scheduler", "kdam", "lazy_static", + "requirements", + "serde", "serde-jsonlines", "serde_json", + "serdeconv", "tabby-common", "tantivy", "temp_testdir", @@ -5411,6 +5482,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "unicase" version = "2.7.0" diff --git a/crates/tabby-common/src/lib.rs b/crates/tabby-common/src/lib.rs index ec17a4287e75..c2028337dc5f 100644 --- a/crates/tabby-common/src/lib.rs +++ b/crates/tabby-common/src/lib.rs @@ -49,3 +49,16 @@ pub struct Tag { pub is_definition: bool, pub syntax_type_name: String, } + +#[derive(Default, Serialize, Deserialize, Clone)] +pub struct Dependency { + pub language: String, + pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +#[derive(Default, Serialize, Deserialize)] +pub struct DependencyFile { + pub deps: Vec, +} diff --git a/crates/tabby-common/src/path.rs b/crates/tabby-common/src/path.rs index 55f757e6fc5e..aaec53add627 100644 --- a/crates/tabby-common/src/path.rs +++ b/crates/tabby-common/src/path.rs @@ -35,6 +35,10 @@ pub fn repositories_dir() -> PathBuf { tabby_root().join("repositories") } +pub fn dependency_file() -> PathBuf { + repositories_dir().join("deps.json") +} + pub fn index_dir() -> PathBuf { tabby_root().join("index") } diff --git a/crates/tabby-scheduler/Cargo.toml b/crates/tabby-scheduler/Cargo.toml index c4e407f875a5..2178e5a58152 100644 --- a/crates/tabby-scheduler/Cargo.toml +++ b/crates/tabby-scheduler/Cargo.toml @@ -24,6 +24,9 @@ tree-sitter-go = "0.20.0" tree-sitter-ruby= "0.20.0" ignore = "0.4.20" kdam = { version = "0.5.0" } +requirements = "0.3.0" +serde.workspace = true +serdeconv.workspace = true [dev-dependencies] temp_testdir = "0.2" diff --git a/crates/tabby-scheduler/src/dataset.rs b/crates/tabby-scheduler/src/dataset.rs index 513a9dea024d..77f9f7d955ae 100644 --- a/crates/tabby-scheduler/src/dataset.rs +++ b/crates/tabby-scheduler/src/dataset.rs @@ -1,3 +1,6 @@ +mod deps; +mod tags; + use std::{ collections::HashMap, ffi::OsStr, @@ -13,11 +16,11 @@ use lazy_static::lazy_static; use serde_jsonlines::WriteExt; use tabby_common::{ config::{Config, RepositoryConfig}, - path::dataset_dir, - SourceFile, + path::{dataset_dir, dependency_file}, + DependencyFile, SourceFile, }; use tracing::error; -use tree_sitter_tags::{TagsConfiguration, TagsContext}; +use tree_sitter_tags::TagsContext; use crate::utils::tqdm; @@ -92,10 +95,14 @@ pub fn create_dataset(config: &Config) -> Result<()> { None, ); + let mut deps = DependencyFile::default(); for repository in config.repositories.as_slice() { + deps::collect(repository.dir().as_path(), &mut deps); repository.create_dataset(&mut writer)?; } + serdeconv::to_json_file(&deps, dependency_file())?; + writer.flush()?; Ok(()) } @@ -135,47 +142,6 @@ mod metrics { } } -mod tags { - use tabby_common::Tag; - use tree_sitter_tags::TagsContext; - - use super::LANGUAGE_TAGS; - - pub fn collect(context: &mut TagsContext, language: &str, content: &str) -> Vec { - let config = LANGUAGE_TAGS.get(language); - let empty = Vec::new(); - - let Some(config) = config else { - return empty; - }; - - let Ok((tags, has_error)) = context.generate_tags(&config.0, content.as_bytes(), None) - else { - return empty; - }; - - if has_error { - return empty; - } - - tags.filter_map(|x| x.ok()) - .map(|x| Tag { - range: x.range, - name_range: x.name_range, - line_range: x.line_range, - docs: x.docs, - is_definition: x.is_definition, - syntax_type_name: config.0.syntax_type_name(x.syntax_type_id).to_owned(), - }) - .collect() - } -} - -// Mark TagsConfiguration as thread sync / safe. -struct TagsConfigurationSync(TagsConfiguration); -unsafe impl Send for TagsConfigurationSync {} -unsafe impl Sync for TagsConfigurationSync {} - lazy_static! { static ref LANGUAGE_EXTENSION: HashMap<&'static str, Vec<&'static str>> = { HashMap::from([ @@ -223,80 +189,4 @@ lazy_static! { map }; - static ref LANGUAGE_TAGS: HashMap<&'static str, TagsConfigurationSync> = { - HashMap::from([ - ( - "python", - TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_python::language(), - tree_sitter_python::TAGGING_QUERY, - "", - ) - .unwrap(), - ), - ), - ( - "rust", - TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_rust::language(), - tree_sitter_rust::TAGGING_QUERY, - "", - ) - .unwrap(), - ), - ), - ( - "java", - TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_java::language(), - tree_sitter_java::TAGGING_QUERY, - "", - ) - .unwrap(), - ), - ), - ( - "kotlin", - TagsConfigurationSync( - TagsConfiguration::new(tree_sitter_kotlin::language(), "", "").unwrap(), - ), - ), - ( - "javascript-typescript", - TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_typescript::language_tsx(), - include_str!("../queries/tsx.scm"), - "", - ) - .unwrap(), - ), - ), - ( - "go", - TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_go::language(), - include_str!("../queries/go.scm"), - "", - ) - .unwrap(), - ), - ), - ( - "ruby", - TagsConfigurationSync( - TagsConfiguration::new( - tree_sitter_ruby::language(), - tree_sitter_ruby::TAGGING_QUERY, - "", - ) - .unwrap(), - ), - ), - ]) - }; } diff --git a/crates/tabby-scheduler/src/dataset/deps.rs b/crates/tabby-scheduler/src/dataset/deps.rs new file mode 100644 index 000000000000..a8d4eb062224 --- /dev/null +++ b/crates/tabby-scheduler/src/dataset/deps.rs @@ -0,0 +1,86 @@ +use std::{collections::HashSet, path::Path}; + +use anyhow::Result; +use serde::Deserialize; +use tabby_common::{Dependency, DependencyFile}; +use tracing::warn; + +pub fn collect(path: &Path, file: &mut DependencyFile) { + if let Ok(mut deps) = process_requirements_txt(path) { + file.deps.append(&mut deps); + } + + if let Ok(mut deps) = process_lock_file(path, "poetry.lock", "python") { + file.deps.append(&mut deps); + } + + if let Ok(mut deps) = process_lock_file(path, "Cargo.lock", "rust") { + file.deps.append(&mut deps); + } + + remove_duplicates(file); +} + +fn process_requirements_txt(path: &Path) -> Result> { + let requirements_txt = path.join("requirements.txt"); + let content = std::fs::read_to_string(requirements_txt)?; + + let mut deps = vec![]; + match requirements::parse_str(&content) { + Ok(requirements) => { + for requirement in requirements { + if let Some(name) = requirement.name { + deps.push(Dependency { + language: "python".to_owned(), + name, + version: None, // requirements.txt doesn't come with accurate version information. + }); + } + } + } + Err(err) => { + warn!("Failed to parse requirements.txt: {}", err); + } + } + + Ok(deps) +} + +#[derive(Deserialize)] +struct LockFileDependency { + name: String, + version: String, +} + +#[derive(Deserialize)] +struct LockFile { + package: Vec, +} + +fn process_lock_file(path: &Path, filename: &str, language: &str) -> Result> { + let poetry_lock = path.join(filename); + let deps: LockFile = serdeconv::from_toml_file(poetry_lock)?; + Ok(deps + .package + .into_iter() + .map(|x| Dependency { + language: language.to_string(), + name: x.name, + version: Some(x.version), + }) + .collect()) +} + +fn remove_duplicates(file: &mut DependencyFile) { + let mut keys: HashSet<(String, String)> = HashSet::default(); + let mut deps = vec![]; + for x in &file.deps { + let key = (x.language.clone(), x.name.clone()); + if !keys.contains(&key) { + keys.insert(key); + deps.push(x.clone()); + } + } + + file.deps = deps; +} diff --git a/crates/tabby-scheduler/src/dataset/tags.rs b/crates/tabby-scheduler/src/dataset/tags.rs new file mode 100644 index 000000000000..7fbf87da68d5 --- /dev/null +++ b/crates/tabby-scheduler/src/dataset/tags.rs @@ -0,0 +1,111 @@ +use std::collections::HashMap; + +use lazy_static::lazy_static; +use tabby_common::Tag; +use tree_sitter_tags::{TagsConfiguration, TagsContext}; + +pub fn collect(context: &mut TagsContext, language: &str, content: &str) -> Vec { + let config = LANGUAGE_TAGS.get(language); + let empty = Vec::new(); + + let Some(config) = config else { + return empty; + }; + + let Ok((tags, has_error)) = context.generate_tags(&config.0, content.as_bytes(), None) else { + return empty; + }; + + if has_error { + return empty; + } + + tags.filter_map(|x| x.ok()) + .map(|x| Tag { + range: x.range, + name_range: x.name_range, + line_range: x.line_range, + docs: x.docs, + is_definition: x.is_definition, + syntax_type_name: config.0.syntax_type_name(x.syntax_type_id).to_owned(), + }) + .collect() +} + +// Mark TagsConfiguration as thread sync / safe. +struct TagsConfigurationSync(TagsConfiguration); +unsafe impl Send for TagsConfigurationSync {} +unsafe impl Sync for TagsConfigurationSync {} + +lazy_static! { + static ref LANGUAGE_TAGS: HashMap<&'static str, TagsConfigurationSync> = { + HashMap::from([ + ( + "python", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_python::language(), + tree_sitter_python::TAGGING_QUERY, + "", + ) + .unwrap(), + ), + ), + ( + "rust", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_rust::language(), + tree_sitter_rust::TAGGING_QUERY, + "", + ) + .unwrap(), + ), + ), + ( + "java", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_java::language(), + tree_sitter_java::TAGGING_QUERY, + "", + ) + .unwrap(), + ), + ), + ( + "javascript-typescript", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_typescript::language_tsx(), + include_str!("../../queries/tsx.scm"), + "", + ) + .unwrap(), + ), + ), + ( + "go", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_go::language(), + include_str!("../../queries/go.scm"), + "", + ) + .unwrap(), + ), + ), + ( + "ruby", + TagsConfigurationSync( + TagsConfiguration::new( + tree_sitter_ruby::language(), + tree_sitter_ruby::TAGGING_QUERY, + "", + ) + .unwrap(), + ), + ), + ]) + }; +} From a17258ea4665f78b832eb017cf268061bf5c69ac Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Sat, 18 Nov 2023 00:50:16 -0800 Subject: [PATCH 17/24] fix: keep only direct dependency, clean up path (#827) --- .github/workflows/autofix.yml | 9 ++++-- Cargo.lock | 8 ++++- Makefile | 2 +- crates/tabby-common/Cargo.toml | 1 + crates/tabby-common/src/lib.rs | 9 ++++-- crates/tabby-common/src/path.rs | 2 +- crates/tabby-scheduler/Cargo.toml | 1 - crates/tabby-scheduler/src/dataset.rs | 2 +- crates/tabby-scheduler/src/dataset/deps.rs | 34 ---------------------- 9 files changed, 24 insertions(+), 44 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 3489a7f35a7e..57177616e2cd 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -32,6 +32,12 @@ jobs: toolchain: nightly components: rustfmt, clippy + - name: Install cargo-machete + uses: actions-rs/cargo@v1 + with: + command: install + args: cargo-machete + - name: Sccache cache uses: mozilla-actions/sccache-action@v0.0.3 with: @@ -48,9 +54,6 @@ jobs: ~/.cargo/registry ~/.cargo/git - - name: Cargo Machete - uses: bnjbvr/cargo-machete@main - - run: bash ./ci/prepare_build_environment.sh - run: make fix diff --git a/Cargo.lock b/Cargo.lock index 1f9e608de8d4..7814df8c20be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1710,6 +1710,12 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "globset" version = "0.4.13" @@ -4464,6 +4470,7 @@ version = "0.6.0-dev" dependencies = [ "anyhow", "filenamify", + "glob", "lazy_static", "reqwest", "serde", @@ -4510,7 +4517,6 @@ dependencies = [ "kdam", "lazy_static", "requirements", - "serde", "serde-jsonlines", "serde_json", "serdeconv", diff --git a/Makefile b/Makefile index 9c56e955dc9c..3447eeff423b 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ else endif fix: - cargo machete --fix + cargo machete --fix || true cargo +nightly fmt cargo +nightly clippy --fix --allow-dirty --allow-staged diff --git a/crates/tabby-common/Cargo.toml b/crates/tabby-common/Cargo.toml index c2223700e79a..9ef3e337a757 100644 --- a/crates/tabby-common/Cargo.toml +++ b/crates/tabby-common/Cargo.toml @@ -13,6 +13,7 @@ reqwest = { workspace = true, features = [ "json" ] } uuid = { version = "1.4.1", features = ["v4"] } tantivy.workspace = true anyhow.workspace = true +glob = "0.3.1" [features] testutils = [] diff --git a/crates/tabby-common/src/lib.rs b/crates/tabby-common/src/lib.rs index c2028337dc5f..cce151dcf37d 100644 --- a/crates/tabby-common/src/lib.rs +++ b/crates/tabby-common/src/lib.rs @@ -9,6 +9,7 @@ use std::{ fs::File, io::{BufReader, Error}, ops::Range, + path::PathBuf, }; use path::dataset_dir; @@ -28,9 +29,13 @@ pub struct SourceFile { } impl SourceFile { + pub fn files_jsonl() -> PathBuf { + dataset_dir().join("files.jsonl") + } + pub fn all() -> Result, Error> { - let iter = dataset_dir().read_dir()?.flat_map(|path| { - let path = path.unwrap().path(); + let files = glob::glob(format!("{}*", Self::files_jsonl().display()).as_str()).unwrap(); + let iter = files.filter_map(|x| x.ok()).flat_map(|path| { let fp = BufReader::new(File::open(path).unwrap()); let reader = JsonLinesReader::new(fp); reader.read_all::().map(|x| x.unwrap()) diff --git a/crates/tabby-common/src/path.rs b/crates/tabby-common/src/path.rs index aaec53add627..44a1cab80f79 100644 --- a/crates/tabby-common/src/path.rs +++ b/crates/tabby-common/src/path.rs @@ -36,7 +36,7 @@ pub fn repositories_dir() -> PathBuf { } pub fn dependency_file() -> PathBuf { - repositories_dir().join("deps.json") + dataset_dir().join("deps.json") } pub fn index_dir() -> PathBuf { diff --git a/crates/tabby-scheduler/Cargo.toml b/crates/tabby-scheduler/Cargo.toml index 2178e5a58152..0d2c99e4425f 100644 --- a/crates/tabby-scheduler/Cargo.toml +++ b/crates/tabby-scheduler/Cargo.toml @@ -25,7 +25,6 @@ tree-sitter-ruby= "0.20.0" ignore = "0.4.20" kdam = { version = "0.5.0" } requirements = "0.3.0" -serde.workspace = true serdeconv.workspace = true [dev-dependencies] diff --git a/crates/tabby-scheduler/src/dataset.rs b/crates/tabby-scheduler/src/dataset.rs index 77f9f7d955ae..e2c61a6ab9c3 100644 --- a/crates/tabby-scheduler/src/dataset.rs +++ b/crates/tabby-scheduler/src/dataset.rs @@ -87,7 +87,7 @@ pub fn create_dataset(config: &Config) -> Result<()> { fs::remove_dir_all(dataset_dir()).ok(); fs::create_dir_all(dataset_dir())?; let mut writer = FileRotate::new( - dataset_dir().join("data.jsonl"), + SourceFile::files_jsonl(), AppendCount::new(usize::max_value()), ContentLimit::Lines(1000), Compression::None, diff --git a/crates/tabby-scheduler/src/dataset/deps.rs b/crates/tabby-scheduler/src/dataset/deps.rs index a8d4eb062224..521b21f4c77c 100644 --- a/crates/tabby-scheduler/src/dataset/deps.rs +++ b/crates/tabby-scheduler/src/dataset/deps.rs @@ -1,7 +1,6 @@ use std::{collections::HashSet, path::Path}; use anyhow::Result; -use serde::Deserialize; use tabby_common::{Dependency, DependencyFile}; use tracing::warn; @@ -10,14 +9,6 @@ pub fn collect(path: &Path, file: &mut DependencyFile) { file.deps.append(&mut deps); } - if let Ok(mut deps) = process_lock_file(path, "poetry.lock", "python") { - file.deps.append(&mut deps); - } - - if let Ok(mut deps) = process_lock_file(path, "Cargo.lock", "rust") { - file.deps.append(&mut deps); - } - remove_duplicates(file); } @@ -46,31 +37,6 @@ fn process_requirements_txt(path: &Path) -> Result> { Ok(deps) } -#[derive(Deserialize)] -struct LockFileDependency { - name: String, - version: String, -} - -#[derive(Deserialize)] -struct LockFile { - package: Vec, -} - -fn process_lock_file(path: &Path, filename: &str, language: &str) -> Result> { - let poetry_lock = path.join(filename); - let deps: LockFile = serdeconv::from_toml_file(poetry_lock)?; - Ok(deps - .package - .into_iter() - .map(|x| Dependency { - language: language.to_string(), - name: x.name, - version: Some(x.version), - }) - .collect()) -} - fn remove_duplicates(file: &mut DependencyFile) { let mut keys: HashSet<(String, String)> = HashSet::default(); let mut deps = vec![]; From df86b0c8997b672ee0bbf66e98686e3dcecbaad6 Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Fri, 17 Nov 2023 21:36:54 +1100 Subject: [PATCH 18/24] feat: add support for Kotlin --- crates/tabby-common/Cargo.toml | 1 + website/docs/programming-languages.md | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/tabby-common/Cargo.toml b/crates/tabby-common/Cargo.toml index 9ef3e337a757..ed6ceeb8b9bd 100644 --- a/crates/tabby-common/Cargo.toml +++ b/crates/tabby-common/Cargo.toml @@ -14,6 +14,7 @@ uuid = { version = "1.4.1", features = ["v4"] } tantivy.workspace = true anyhow.workspace = true glob = "0.3.1" +tree-sitter-kotlin = "0.3.1" [features] testutils = [] diff --git a/website/docs/programming-languages.md b/website/docs/programming-languages.md index c9ebbdc436f3..4c9586b94f09 100644 --- a/website/docs/programming-languages.md +++ b/website/docs/programming-languages.md @@ -43,3 +43,4 @@ For an actual example of an issue or pull request adding the above support, plea | PHP | 🚫 | 🚫 | | Perl | 🚫 | 🚫 | | Scala | 🚫 | 🚫 | +| Kotlin | 🚫 | 🚫 | From 444eee5306ce44f86abbdb3af96fb8208bf69f11 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Fri, 17 Nov 2023 22:08:49 -0800 Subject: [PATCH 19/24] Update Cargo.toml --- crates/tabby-common/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/tabby-common/Cargo.toml b/crates/tabby-common/Cargo.toml index ed6ceeb8b9bd..c2223700e79a 100644 --- a/crates/tabby-common/Cargo.toml +++ b/crates/tabby-common/Cargo.toml @@ -13,8 +13,6 @@ reqwest = { workspace = true, features = [ "json" ] } uuid = { version = "1.4.1", features = ["v4"] } tantivy.workspace = true anyhow.workspace = true -glob = "0.3.1" -tree-sitter-kotlin = "0.3.1" [features] testutils = [] From 4acf2f3d50dde595b7076a68fd054322c4ef0c0d Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Sat, 18 Nov 2023 22:29:36 +1100 Subject: [PATCH 20/24] fix: adjustment post rebase --- Cargo.lock | 1 - crates/tabby-common/Cargo.toml | 1 + crates/tabby-scheduler/src/dataset/tags.rs | 6 ++++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 7814df8c20be..52d052ea17fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4477,7 +4477,6 @@ dependencies = [ "serde-jsonlines", "serdeconv", "tantivy", - "tree-sitter-kotlin", "uuid 1.4.1", ] diff --git a/crates/tabby-common/Cargo.toml b/crates/tabby-common/Cargo.toml index c2223700e79a..9ef3e337a757 100644 --- a/crates/tabby-common/Cargo.toml +++ b/crates/tabby-common/Cargo.toml @@ -13,6 +13,7 @@ reqwest = { workspace = true, features = [ "json" ] } uuid = { version = "1.4.1", features = ["v4"] } tantivy.workspace = true anyhow.workspace = true +glob = "0.3.1" [features] testutils = [] diff --git a/crates/tabby-scheduler/src/dataset/tags.rs b/crates/tabby-scheduler/src/dataset/tags.rs index 7fbf87da68d5..d1e32ad13a86 100644 --- a/crates/tabby-scheduler/src/dataset/tags.rs +++ b/crates/tabby-scheduler/src/dataset/tags.rs @@ -73,6 +73,12 @@ lazy_static! { .unwrap(), ), ), + ( + "kotlin", + TagsConfigurationSync( + TagsConfiguration::new(tree_sitter_kotlin::language(), "", "").unwrap(), + ), + ), ( "javascript-typescript", TagsConfigurationSync( From 9d144f2e3be426ac57f825e42cdb1b1ae87dc11a Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Sun, 19 Nov 2023 15:16:25 +1100 Subject: [PATCH 21/24] fix: added kotlin.scm to cover query tags --- crates/tabby-scheduler/queries/kotlin.scm | 37 ++++++++++++++++++++++ crates/tabby-scheduler/src/dataset/tags.rs | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 crates/tabby-scheduler/queries/kotlin.scm diff --git a/crates/tabby-scheduler/queries/kotlin.scm b/crates/tabby-scheduler/queries/kotlin.scm new file mode 100644 index 000000000000..791e0ecd1dd5 --- /dev/null +++ b/crates/tabby-scheduler/queries/kotlin.scm @@ -0,0 +1,37 @@ +( + (comment)* @doc + . + (function_declaration + name: (identifier) @name) @definition.function + (#strip! @doc "^//\\s*") + (#set-adjacent! @doc @definition.function) +) + +( + (comment)* @doc + . + (class_declaration + name: (identifier) @name) @definition.class + (#strip! @doc "^//\\s*") + (#set-adjacent! @doc @definition.class) +) + +( + (comment)* @doc + . + (interface_declaration + name: (identifier) @name) @definition.interface + (#strip! @doc "^//\\s*") + (#set-adjacent! @doc @definition.interface) +) + +( + (comment)* @doc + . + (object_declaration + type: (type_identifier) @name) @reference.class + (#strip! @doc "^//\\s*") + (#set-adjacent! @doc @reference.class) +) + +(type_declaration (type_spec name: (type_identifier) @name)) @definition.type \ No newline at end of file diff --git a/crates/tabby-scheduler/src/dataset/tags.rs b/crates/tabby-scheduler/src/dataset/tags.rs index d1e32ad13a86..305d8cb00c38 100644 --- a/crates/tabby-scheduler/src/dataset/tags.rs +++ b/crates/tabby-scheduler/src/dataset/tags.rs @@ -76,7 +76,12 @@ lazy_static! { ( "kotlin", TagsConfigurationSync( - TagsConfiguration::new(tree_sitter_kotlin::language(), "", "").unwrap(), + TagsConfiguration::new( + tree_sitter_kotlin::language(), + include_str!("../../queries/kotlin.scm"), + "", + ) + .unwrap(), ), ), ( From a3f6a04abc51faace197a5ef2fbd938e4c4aaf08 Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Tue, 21 Nov 2023 16:26:25 +1100 Subject: [PATCH 22/24] fix: updated kotlin.scm --- crates/tabby-scheduler/queries/kotlin.scm | 32 +++++------------------ 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/crates/tabby-scheduler/queries/kotlin.scm b/crates/tabby-scheduler/queries/kotlin.scm index 791e0ecd1dd5..551f548d2232 100644 --- a/crates/tabby-scheduler/queries/kotlin.scm +++ b/crates/tabby-scheduler/queries/kotlin.scm @@ -1,37 +1,19 @@ ( - (comment)* @doc - . - (function_declaration - name: (identifier) @name) @definition.function - (#strip! @doc "^//\\s*") - (#set-adjacent! @doc @definition.function) + (function_declaration (simple_identifier) @name) @definition.function ) ( - (comment)* @doc - . - (class_declaration - name: (identifier) @name) @definition.class - (#strip! @doc "^//\\s*") - (#set-adjacent! @doc @definition.class) + (class_declaration (type_identifier) @name) @definition.class ) ( - (comment)* @doc - . - (interface_declaration - name: (identifier) @name) @definition.interface - (#strip! @doc "^//\\s*") - (#set-adjacent! @doc @definition.interface) + (object_literal (delegation_specifier) @name) @definition.object ) ( - (comment)* @doc - . - (object_declaration - type: (type_identifier) @name) @reference.class - (#strip! @doc "^//\\s*") - (#set-adjacent! @doc @reference.class) + (type_alias (type_identifier) @name) @definition.type ) -(type_declaration (type_spec name: (type_identifier) @name)) @definition.type \ No newline at end of file +( + (import_header (identifier) @name) @definition.import +) \ No newline at end of file From 648b06e93282679138e62876e44a58ef70ce4a32 Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Thu, 23 Nov 2023 08:24:35 +1100 Subject: [PATCH 23/24] remove definition import Co-authored-by: Meng Zhang --- crates/tabby-scheduler/queries/kotlin.scm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crates/tabby-scheduler/queries/kotlin.scm b/crates/tabby-scheduler/queries/kotlin.scm index 551f548d2232..86798efbf5fe 100644 --- a/crates/tabby-scheduler/queries/kotlin.scm +++ b/crates/tabby-scheduler/queries/kotlin.scm @@ -13,7 +13,3 @@ ( (type_alias (type_identifier) @name) @definition.type ) - -( - (import_header (identifier) @name) @definition.import -) \ No newline at end of file From d79b60784a73f37925457a81c2e98ed090e23d4e Mon Sep 17 00:00:00 2001 From: sonique6784 Date: Thu, 23 Nov 2023 08:24:50 +1100 Subject: [PATCH 24/24] remove typealias Co-authored-by: Meng Zhang --- crates/tabby-scheduler/queries/kotlin.scm | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/tabby-scheduler/queries/kotlin.scm b/crates/tabby-scheduler/queries/kotlin.scm index 86798efbf5fe..cb8c933bb05a 100644 --- a/crates/tabby-scheduler/queries/kotlin.scm +++ b/crates/tabby-scheduler/queries/kotlin.scm @@ -10,6 +10,3 @@ (object_literal (delegation_specifier) @name) @definition.object ) -( - (type_alias (type_identifier) @name) @definition.type -)