diff --git a/aiscan.yaml b/aiscan.yaml index d8c189c3..cd076903 100644 --- a/aiscan.yaml +++ b/aiscan.yaml @@ -37,6 +37,9 @@ llm: model: "" # Proxy for LLM API requests proxy: "" + # Custom HTTP headers for LLM API requests + # headers: + # User-Agent: "Version: 5.10.0 openwarp" # Additional LLM providers for fallback or multi-model routing # providers: # - provider: "" @@ -44,6 +47,7 @@ llm: # api_key: "" # model: "" # proxy: "" + # headers: {} # timeout: 0 # images: "" diff --git a/cmd/aiscan/cli.go b/cmd/aiscan/cli.go index 0fad0c0d..208beff4 100644 --- a/cmd/aiscan/cli.go +++ b/cmd/aiscan/cli.go @@ -201,12 +201,12 @@ func parseCLI(args []string) (parsedCLI, error) { option := cli.Option if cli.Version { - return parsedCLI{Option: option, Mode: cfg.RunModeNoCommand}, nil + return finalizeParsedCLI(parsedCLI{Option: option, Mode: cfg.RunModeNoCommand}) } mode := selectedMode(parser) if mode == cfg.RunModeNoCommand { - return parsedCLI{Option: option, Mode: cfg.RunModeNoCommand}, nil + return finalizeParsedCLI(parsedCLI{Option: option, Mode: cfg.RunModeNoCommand}) } if mode == cfg.RunModeScanner { @@ -217,15 +217,15 @@ func parseCLI(args []string) (parsedCLI, error) { return parsedCLI{}, err } scannerArgs := append([]string{scannerName}, scannerRest...) - return parsedCLI{Option: option, Mode: mode, ScannerArgs: scannerArgs}, nil + return finalizeParsedCLI(parsedCLI{Option: option, Mode: mode, ScannerArgs: scannerArgs}) } if mode == runModeWeb { - return parsedCLI{Option: option, Mode: runModeWeb, WebOpts: cli.Web}, nil + return finalizeParsedCLI(parsedCLI{Option: option, Mode: runModeWeb, WebOpts: cli.Web}) } ioaArgs := extractIOAArgs(&cli, mode) - return parsedCLI{Option: option, Mode: mode, IOAArgs: ioaArgs}, nil + return finalizeParsedCLI(parsedCLI{Option: option, Mode: mode, IOAArgs: ioaArgs}) } func parseScannerCLI(scannerName string, rootArgs, scannerRest []string) (parsedCLI, error) { @@ -250,7 +250,7 @@ func parseScannerCLI(scannerName string, rootArgs, scannerRest []string) (parsed option := cli.Option mergeManualScannerOptions(&option, manual) if cli.Version { - return parsedCLI{Option: option, Mode: cfg.RunModeNoCommand}, nil + return finalizeParsedCLI(parsedCLI{Option: option, Mode: cfg.RunModeNoCommand}) } option.Timeout = 3600 @@ -264,11 +264,35 @@ func parseScannerCLI(scannerName string, rootArgs, scannerRest []string) (parsed if boolFlagEnabled(scannerArgs, "--debug") { option.Debug = true } - return parsedCLI{ + return finalizeParsedCLI(parsedCLI{ Option: option, Mode: cfg.RunModeScanner, ScannerArgs: append([]string{scannerName}, scannerArgs...), - }, nil + }) +} + +func finalizeParsedCLI(parsed parsedCLI) (parsedCLI, error) { + headers, err := cfg.ParseHeaderFlags(parsed.Option.LLMHeaderFlags) + if err != nil { + return parsedCLI{}, err + } + parsed.Option.Headers = cfgMergeHeaders(parsed.Option.Headers, headers) + parsed.Option.LLMHeaderFlags = nil + return parsed, nil +} + +func cfgMergeHeaders(base, override map[string]string) map[string]string { + if len(base) == 0 && len(override) == 0 { + return nil + } + out := make(map[string]string, len(base)+len(override)) + for key, value := range base { + out[key] = value + } + for key, value := range override { + out[key] = value + } + return out } func mergeManualScannerOptions(option *cfg.Option, manual cfg.Option) { @@ -277,6 +301,9 @@ func mergeManualScannerOptions(option *cfg.Option, manual cfg.Option) { option.APIKey = cfg.ResolveString(manual.APIKey, option.APIKey) option.Model = cfg.ResolveString(manual.Model, option.Model) option.LLMProxy = cfg.ResolveString(manual.LLMProxy, option.LLMProxy) + if len(manual.LLMHeaderFlags) > 0 { + option.LLMHeaderFlags = append(option.LLMHeaderFlags, manual.LLMHeaderFlags...) + } if manual.AI { option.AI = true } @@ -413,6 +440,7 @@ var scannerKnownFlags = []knownFlag{ {names: []string{"--model"}, arity: 1, apply: func(o *cfg.Option, v string) { o.Model = v }}, {names: []string{"--proxy"}, arity: 1, apply: func(o *cfg.Option, v string) { o.Proxy = v }}, {names: []string{"--llm-proxy"}, arity: 1, apply: func(o *cfg.Option, v string) { o.LLMProxy = v }}, + {names: []string{"--llm-header"}, arity: 1, apply: func(o *cfg.Option, v string) { o.LLMHeaderFlags = append(o.LLMHeaderFlags, v) }}, {names: []string{"--fofa-email"}, arity: 1, apply: func(o *cfg.Option, v string) { o.FofaEmail = v }}, {names: []string{"--fofa-key"}, arity: 1, apply: func(o *cfg.Option, v string) { o.FofaKey = v }}, {names: []string{"--hunter-token"}, arity: 1, apply: func(o *cfg.Option, v string) { o.HunterToken = v }}, diff --git a/cmd/aiscan/cli_test.go b/cmd/aiscan/cli_test.go index 6e145727..5cf79d0c 100644 --- a/cmd/aiscan/cli_test.go +++ b/cmd/aiscan/cli_test.go @@ -138,6 +138,48 @@ func TestParseCLIAgentAcceptsLLMFlags(t *testing.T) { } } +func TestParseCLIAcceptsLLMHeaderFlags(t *testing.T) { + parsed, err := parseCLI([]string{ + "agent", + "--llm-header", "User-Agent=Version: 5.10.0 openwarp", + "--llm-header", "X-Test=yes", + }) + if err != nil { + t.Fatalf("parseCLI() error = %v", err) + } + if got := parsed.Option.Headers["User-Agent"]; got != "Version: 5.10.0 openwarp" { + t.Fatalf("User-Agent header = %q", got) + } + if got := parsed.Option.Headers["X-Test"]; got != "yes" { + t.Fatalf("X-Test header = %q", got) + } +} + +func TestParseCLIScanExtractsLLMHeaderFlag(t *testing.T) { + parsed, err := parseCLI([]string{ + "scan", + "-i", "127.0.0.1", + "--llm-header", "User-Agent=Version: 5.10.0 openwarp", + "--verify=high", + }) + if err != nil { + t.Fatalf("parseCLI() error = %v", err) + } + wantArgs := []string{"scan", "-i", "127.0.0.1", "--verify=high"} + if !reflect.DeepEqual(parsed.ScannerArgs, wantArgs) { + t.Fatalf("scanner args = %#v, want %#v", parsed.ScannerArgs, wantArgs) + } + if got := parsed.Option.Headers["User-Agent"]; got != "Version: 5.10.0 openwarp" { + t.Fatalf("User-Agent header = %q", got) + } +} + +func TestParseCLIRejectsInvalidLLMHeaderFlag(t *testing.T) { + if _, err := parseCLI([]string{"agent", "--llm-header", "User Agent=value"}); err == nil { + t.Fatal("parseCLI() error = nil, want invalid header error") + } +} + func TestParseCLIScanExtractsLLMFlags(t *testing.T) { parsed, err := parseCLI([]string{ "scan", diff --git a/cmd/aiscan/web_full.go b/cmd/aiscan/web_full.go index f6dfa3d0..2b77f745 100644 --- a/cmd/aiscan/web_full.go +++ b/cmd/aiscan/web_full.go @@ -155,11 +155,12 @@ func initWebApp(ctx context.Context, configFile string, logger telemetry.Logger) type webYAMLConfig struct { LLM struct { - Provider string `yaml:"provider"` - BaseURL string `yaml:"base_url"` - APIKey string `yaml:"api_key"` - Model string `yaml:"model"` - Proxy string `yaml:"proxy"` + Provider string `yaml:"provider"` + BaseURL string `yaml:"base_url"` + APIKey string `yaml:"api_key"` + Model string `yaml:"model"` + Proxy string `yaml:"proxy"` + Headers map[string]string `yaml:"headers,omitempty"` } `yaml:"llm"` Cyberhub struct { URL string `yaml:"url"` @@ -198,6 +199,7 @@ func (s *webConfigStore) GetLLMConfig(ctx context.Context) (web.LLMConfig, error APIKeyConfigured: strings.TrimSpace(c.LLM.APIKey) != "", Model: c.LLM.Model, Proxy: c.LLM.Proxy, + Headers: c.LLM.Headers, }, nil } @@ -226,12 +228,21 @@ func (s *webConfigStore) SaveLLMConfig(ctx context.Context, llmCfg web.LLMConfig if apiKey == "" { apiKey = current.LLM.APIKey } + headers := current.LLM.Headers + if llmCfg.Headers != nil { + var err error + headers, err = cfg.NormalizeHeaderMap(llmCfg.Headers) + if err != nil { + return web.LLMConfig{}, err + } + } current.LLM.Provider = strings.TrimSpace(llmCfg.Provider) current.LLM.BaseURL = strings.TrimSpace(llmCfg.BaseURL) current.LLM.APIKey = apiKey current.LLM.Model = strings.TrimSpace(llmCfg.Model) current.LLM.Proxy = strings.TrimSpace(llmCfg.Proxy) + current.LLM.Headers = headers next, _ := yaml.Marshal(¤t) if dir := filepath.Dir(p); dir != "." && dir != "" { if err := os.MkdirAll(dir, 0755); err != nil { @@ -250,6 +261,7 @@ func (s *webConfigStore) SaveLLMConfig(ctx context.Context, llmCfg web.LLMConfig APIKeyConfigured: strings.TrimSpace(saved.LLM.APIKey) != "", Model: saved.LLM.Model, Proxy: saved.LLM.Proxy, + Headers: saved.LLM.Headers, }, nil } diff --git a/core/config/config_gen.go b/core/config/config_gen.go index e882b031..d4f8aea0 100644 --- a/core/config/config_gen.go +++ b/core/config/config_gen.go @@ -100,6 +100,9 @@ func generateFromStruct(t reflect.Type, v reflect.Value, indent int) string { case fieldType.Kind() == reflect.Slice: b.WriteString(generateSliceComment(prefix, configTag, descTag, fieldType)) + case fieldType.Kind() == reflect.Map: + b.WriteString(generateMapComment(prefix, configTag, descTag)) + default: if descTag != "" { b.WriteString(fmt.Sprintf("%s# %s\n", prefix, descTag)) @@ -146,6 +149,15 @@ func generateSliceComment(prefix, configTag, descTag string, t reflect.Type) str return b.String() } +func generateMapComment(prefix, configTag, descTag string) string { + var b strings.Builder + if descTag != "" { + b.WriteString(fmt.Sprintf("%s# %s\n", prefix, descTag)) + } + b.WriteString(fmt.Sprintf("%s# %s: {}\n", prefix, configTag)) + return b.String() +} + func formatValue(kind reflect.Kind, defaultVal string) string { if defaultVal != "" { switch kind { @@ -164,6 +176,8 @@ func formatValue(kind reflect.Kind, defaultVal string) string { return "0.0" case reflect.String: return `""` + case reflect.Map: + return `{}` default: return `""` } diff --git a/core/config/config_test.go b/core/config/config_test.go index 14485425..3a37266f 100644 --- a/core/config/config_test.go +++ b/core/config/config_test.go @@ -110,6 +110,64 @@ ioa: } } +func TestLoadConfigLLMHeaders(t *testing.T) { + dir := t.TempDir() + writeTestConfig(t, dir, ` +llm: + headers: + User-Agent: "Version: 5.10.0 openwarp" + providers: + - provider: deepseek + api_key: dk-111 + model: deepseek-chat + headers: + X-Primary: primary + - provider: openai + api_key: sk-222 + model: gpt-4o + headers: + X-Fallback: fallback +`) + + var opt Option + if err := LoadConfig(filepath.Join(dir, "aiscan.yaml"), &opt); err != nil { + t.Fatal(err) + } + if got := opt.Headers["User-Agent"]; got != "Version: 5.10.0 openwarp" { + t.Fatalf("top-level User-Agent header = %q", got) + } + if len(opt.Providers) != 2 { + t.Fatalf("providers = %d, want 2", len(opt.Providers)) + } + if got := opt.Providers[0].Headers["X-Primary"]; got != "primary" { + t.Fatalf("primary header = %q", got) + } + if got := opt.Providers[1].Headers["X-Fallback"]; got != "fallback" { + t.Fatalf("fallback header = %q", got) + } +} + +func TestMergeOptionHeadersCLIWins(t *testing.T) { + dst := Option{LLMOptions: LLMOptions{ + Headers: map[string]string{"User-Agent": "cli-agent"}, + }} + src := Option{LLMOptions: LLMOptions{ + Headers: map[string]string{"user-agent": "config-agent", "X-Config": "yes"}, + }} + + mergeOption(&dst, &src) + + if got := dst.Headers["User-Agent"]; got != "cli-agent" { + t.Fatalf("User-Agent = %q, want CLI value", got) + } + if got := dst.Headers["X-Config"]; got != "yes" { + t.Fatalf("X-Config = %q, want config value", got) + } + if _, ok := dst.Headers["user-agent"]; ok { + t.Fatalf("config user-agent key should be replaced by CLI override: %#v", dst.Headers) + } +} + func TestLoadConfigReconNumericZeroIsExplicit(t *testing.T) { dir := t.TempDir() writeTestConfig(t, dir, ` @@ -620,6 +678,31 @@ func TestProvidersListOnly(t *testing.T) { } } +func TestProvidersListPrimaryUsesTopLevelHeaders(t *testing.T) { + option := Option{} + option.Headers = map[string]string{"User-Agent": "top-agent"} + option.Providers = []LLMProviderEntry{ + {Provider: "deepseek", APIKey: "key1", Model: "deepseek-chat", Headers: map[string]string{"X-Primary": "yes"}}, + {Provider: "openai", APIKey: "key2", Model: "gpt-4o", Headers: map[string]string{"X-Fallback": "yes"}}, + } + + primary := ProviderConfig(&option) + if primary.Headers["User-Agent"] != "top-agent" || primary.Headers["X-Primary"] != "yes" { + t.Fatalf("primary headers = %#v, want top-level and primary entry headers", primary.Headers) + } + + fallbacks := FallbackProviderConfigs(&option) + if len(fallbacks) != 1 { + t.Fatalf("fallbacks = %d, want 1", len(fallbacks)) + } + if _, ok := fallbacks[0].Headers["User-Agent"]; ok { + t.Fatalf("fallback should not inherit top-level headers: %#v", fallbacks[0].Headers) + } + if got := fallbacks[0].Headers["X-Fallback"]; got != "yes" { + t.Fatalf("fallback X-Fallback = %q", got) + } +} + func TestProvidersListWithSingleFields(t *testing.T) { option := Option{} option.Provider = "anthropic" diff --git a/core/config/headers.go b/core/config/headers.go new file mode 100644 index 00000000..9c1d6252 --- /dev/null +++ b/core/config/headers.go @@ -0,0 +1,133 @@ +package config + +import ( + "fmt" + "net/http" + "strings" +) + +type HeaderFlags []string + +func (h *HeaderFlags) UnmarshalFlag(value string) error { + if _, _, ok, err := parseHeaderAssignment(value); err != nil { + return err + } else if ok { + *h = append(*h, value) + } + return nil +} + +func ParseHeaderFlags(values HeaderFlags) (map[string]string, error) { + out := make(map[string]string) + for _, raw := range values { + key, value, ok, err := parseHeaderAssignment(raw) + if err != nil { + return nil, err + } + if !ok { + continue + } + if _, exists := out[key]; exists { + return nil, fmt.Errorf("duplicate LLM header %q", key) + } + out[key] = value + } + if len(out) == 0 { + return nil, nil + } + return out, nil +} + +func NormalizeHeaderMap(headers map[string]string) (map[string]string, error) { + out := make(map[string]string, len(headers)) + for key, value := range headers { + key = strings.TrimSpace(key) + value = strings.TrimSpace(value) + if key == "" || value == "" { + continue + } + if !validHeaderName(key) { + return nil, fmt.Errorf("invalid LLM header name %q", key) + } + if strings.ContainsAny(value, "\r\n") { + return nil, fmt.Errorf("invalid LLM header %q: value must not contain CR or LF", key) + } + canonical := http.CanonicalHeaderKey(key) + if _, exists := out[canonical]; exists { + return nil, fmt.Errorf("duplicate LLM header %q", canonical) + } + out[canonical] = value + } + if len(out) == 0 { + return nil, nil + } + return out, nil +} + +func parseHeaderAssignment(raw string) (string, string, bool, error) { + key, value, ok := strings.Cut(raw, "=") + if !ok { + return "", "", false, fmt.Errorf("invalid LLM header %q: expected KEY=VALUE", raw) + } + key = strings.TrimSpace(key) + value = strings.TrimSpace(value) + if key == "" || value == "" { + return "", "", false, nil + } + if !validHeaderName(key) { + return "", "", false, fmt.Errorf("invalid LLM header name %q", key) + } + if strings.ContainsAny(value, "\r\n") { + return "", "", false, fmt.Errorf("invalid LLM header %q: value must not contain CR or LF", key) + } + return http.CanonicalHeaderKey(key), value, true, nil +} + +func validHeaderName(name string) bool { + if name == "" { + return false + } + for i := 0; i < len(name); i++ { + c := name[i] + if (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') { + continue + } + switch c { + case '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~': + continue + default: + return false + } + } + return true +} + +func mergeHeaderMaps(fallback, override map[string]string) map[string]string { + if len(fallback) == 0 && len(override) == 0 { + return nil + } + out := make(map[string]string, len(fallback)+len(override)) + for key, value := range fallback { + out[key] = value + } + for key, value := range override { + canonical := http.CanonicalHeaderKey(strings.TrimSpace(key)) + for existing := range out { + if http.CanonicalHeaderKey(strings.TrimSpace(existing)) == canonical { + delete(out, existing) + } + } + out[key] = value + } + if len(out) == 0 { + return nil + } + return out +} + +func mergeOptionHeaders(dst, src *Option) { + if len(src.Headers) == 0 { + return + } + dst.Headers = mergeHeaderMaps(src.Headers, dst.Headers) +} diff --git a/core/config/loader.go b/core/config/loader.go index 59707854..6aa7021b 100644 --- a/core/config/loader.go +++ b/core/config/loader.go @@ -116,6 +116,7 @@ func mergeOption(dst, src *Option) { dst.APIKey = ResolveString(dst.APIKey, src.APIKey) dst.Model = ResolveString(dst.Model, src.Model) dst.LLMProxy = ResolveString(dst.LLMProxy, src.LLMProxy) + mergeOptionHeaders(dst, src) dst.CyberhubURL = ResolveString(dst.CyberhubURL, src.CyberhubURL) dst.CyberhubKey = ResolveString(dst.CyberhubKey, src.CyberhubKey) dst.CyberhubMode = ResolveString(dst.CyberhubMode, src.CyberhubMode) diff --git a/core/config/options.go b/core/config/options.go index 32aceac2..8d02778f 100644 --- a/core/config/options.go +++ b/core/config/options.go @@ -27,23 +27,26 @@ type ScanConfigOptions struct { } type LLMOptions struct { - Provider string `long:"provider" config:"provider" description:"LLM provider: openai (default), anthropic, deepseek, openrouter, ollama, groq, moonshot"` - BaseURL string `long:"base-url" config:"base_url" description:"LLM API base URL (leave empty to use provider default)"` - APIKey string `long:"api-key" config:"api_key" description:"LLM API key (or env: OPENAI_API_KEY, ANTHROPIC_API_KEY, AISCAN_API_KEY)"` - Model string `long:"model" config:"model" description:"LLM model name"` - LLMProxy string `long:"llm-proxy" config:"proxy" description:"Proxy for LLM API requests"` - Providers []LLMProviderEntry `no-flag:"true" config:"providers" description:"Additional LLM providers for fallback or multi-model routing"` - AI bool `long:"ai" description:"Analyze direct scanner output with an LLM"` + Provider string `long:"provider" config:"provider" description:"LLM provider: openai (default), anthropic, deepseek, openrouter, ollama, groq, moonshot"` + BaseURL string `long:"base-url" config:"base_url" description:"LLM API base URL (leave empty to use provider default)"` + APIKey string `long:"api-key" config:"api_key" description:"LLM API key (or env: OPENAI_API_KEY, ANTHROPIC_API_KEY, AISCAN_API_KEY)"` + Model string `long:"model" config:"model" description:"LLM model name"` + LLMProxy string `long:"llm-proxy" config:"proxy" description:"Proxy for LLM API requests"` + Headers map[string]string `no-flag:"true" config:"headers" description:"Custom HTTP headers for LLM API requests"` + LLMHeaderFlags HeaderFlags `long:"llm-header" description:"Custom LLM HTTP header in KEY=VALUE format. Can be specified multiple times"` + Providers []LLMProviderEntry `no-flag:"true" config:"providers" description:"Additional LLM providers for fallback or multi-model routing"` + AI bool `long:"ai" description:"Analyze direct scanner output with an LLM"` } type LLMProviderEntry struct { - Provider string `config:"provider" yaml:"provider"` - BaseURL string `config:"base_url" yaml:"base_url"` - APIKey string `config:"api_key" yaml:"api_key"` - Model string `config:"model" yaml:"model"` - Proxy string `config:"proxy" yaml:"proxy"` - Timeout int `config:"timeout" yaml:"timeout"` - Images *bool `config:"images" yaml:"images,omitempty"` + Provider string `config:"provider" yaml:"provider"` + BaseURL string `config:"base_url" yaml:"base_url"` + APIKey string `config:"api_key" yaml:"api_key"` + Model string `config:"model" yaml:"model"` + Proxy string `config:"proxy" yaml:"proxy"` + Headers map[string]string `config:"headers" yaml:"headers,omitempty"` + Timeout int `config:"timeout" yaml:"timeout"` + Images *bool `config:"images" yaml:"images,omitempty"` } type ScannerOptions struct { diff --git a/core/config/provider.go b/core/config/provider.go index ab805c05..82633c5b 100644 --- a/core/config/provider.go +++ b/core/config/provider.go @@ -45,6 +45,7 @@ func entryToProviderConfig(entry LLMProviderEntry) agent.ProviderConfig { APIKey: entry.APIKey, Model: entry.Model, Proxy: entry.Proxy, + Headers: entry.Headers, Timeout: entry.Timeout, Images: entry.Images, } @@ -55,8 +56,11 @@ func entryToProviderConfig(entry LLMProviderEntry) agent.ProviderConfig { } func ProviderConfig(option *Option) agent.ProviderConfig { + topLevelHeaders := option.Headers if !hasSingleProviderFields(option) && len(option.Providers) > 0 { - return entryToProviderConfig(option.Providers[0]) + cfg := entryToProviderConfig(option.Providers[0]) + cfg.Headers = mergeHeaderMaps(cfg.Headers, topLevelHeaders) + return cfg } cfg := defaultProviderConfig() if option.Provider != "" { @@ -77,6 +81,7 @@ func ProviderConfig(option *Option) agent.ProviderConfig { if option.LLMProxy != "" { cfg.Proxy = option.LLMProxy } + cfg.Headers = topLevelHeaders cfg.Timeout = 120 return cfg } @@ -101,4 +106,5 @@ func ApplyResolvedProviderOptions(option *Option, cfg agent.ProviderConfig) { option.BaseURL = cfg.BaseURL option.APIKey = cfg.APIKey option.Model = cfg.Model + option.Headers = cfg.Headers } diff --git a/pkg/agent/provider/anthropic.go b/pkg/agent/provider/anthropic.go index 42135e2c..808aa05d 100644 --- a/pkg/agent/provider/anthropic.go +++ b/pkg/agent/provider/anthropic.go @@ -21,6 +21,10 @@ type AnthropicProvider struct { } func NewAnthropicProvider(cfg *ProviderConfig) (*AnthropicProvider, error) { + cfg, err := cloneConfigWithNormalizedHeaders(cfg) + if err != nil { + return nil, err + } client, err := newHTTPClient(cfg) if err != nil { return nil, err @@ -106,6 +110,11 @@ func (p *AnthropicProvider) completionEndpoint() string { } func (p *AnthropicProvider) setAuthHeaders(req *http.Request) { + p.setProviderHeaders(req) + applyCustomHeaders(req, p.config.Headers) +} + +func (p *AnthropicProvider) setProviderHeaders(req *http.Request) { if p.config.APIKey != "" { req.Header.Set("x-api-key", p.config.APIKey) } @@ -638,8 +647,9 @@ func (p *AnthropicProvider) WebSearch(ctx context.Context, query string, maxResu "messages": []map[string]string{{"role": "user", "content": "Search the web for: " + query}}, }, func(req *http.Request) { - p.setAuthHeaders(req) + p.setProviderHeaders(req) req.Header.Set("anthropic-beta", "web-search-2025-03-05") + applyCustomHeaders(req, p.config.Headers) }, ) if err != nil { diff --git a/pkg/agent/provider/headers.go b/pkg/agent/provider/headers.go new file mode 100644 index 00000000..e9d30f4e --- /dev/null +++ b/pkg/agent/provider/headers.go @@ -0,0 +1,74 @@ +package provider + +import ( + "fmt" + "net/http" + "strings" +) + +func normalizeHeaders(headers map[string]string) (map[string]string, error) { + if len(headers) == 0 { + return nil, nil + } + out := make(map[string]string, len(headers)) + for key, value := range headers { + key = strings.TrimSpace(key) + value = strings.TrimSpace(value) + if key == "" || value == "" { + continue + } + if !validHeaderName(key) { + return nil, fmt.Errorf("invalid LLM header name %q", key) + } + if strings.ContainsAny(value, "\r\n") { + return nil, fmt.Errorf("invalid LLM header %q: value must not contain CR or LF", key) + } + canonical := http.CanonicalHeaderKey(key) + if _, exists := out[canonical]; exists { + return nil, fmt.Errorf("duplicate LLM header %q", canonical) + } + out[canonical] = value + } + if len(out) == 0 { + return nil, nil + } + return out, nil +} + +func applyCustomHeaders(req *http.Request, headers map[string]string) { + for key, value := range headers { + req.Header.Set(key, value) + } +} + +func cloneConfigWithNormalizedHeaders(cfg *ProviderConfig) (*ProviderConfig, error) { + if cfg == nil { + return nil, fmt.Errorf("provider config is nil") + } + clone := *cfg + headers, err := normalizeHeaders(clone.Headers) + if err != nil { + return nil, err + } + clone.Headers = headers + return &clone, nil +} + +func validHeaderName(name string) bool { + if name == "" { + return false + } + for i := 0; i < len(name); i++ { + c := name[i] + if (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') { + continue + } + switch c { + case '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~': + continue + default: + return false + } + } + return true +} diff --git a/pkg/agent/provider/openai.go b/pkg/agent/provider/openai.go index 19419f5a..eb8ec66a 100644 --- a/pkg/agent/provider/openai.go +++ b/pkg/agent/provider/openai.go @@ -15,6 +15,10 @@ type OpenAIProvider struct { } func NewOpenAIProvider(cfg *ProviderConfig) (*OpenAIProvider, error) { + cfg, err := cloneConfigWithNormalizedHeaders(cfg) + if err != nil { + return nil, err + } client, err := newHTTPClient(cfg) if err != nil { return nil, err @@ -100,6 +104,7 @@ func (p *OpenAIProvider) setAuthHeaders(req *http.Request) { if p.config.APIKey != "" { req.Header.Set("Authorization", "Bearer "+p.config.APIKey) } + applyCustomHeaders(req, p.config.Headers) } func marshalOpenAIRequest(req *ChatCompletionRequest) ([]byte, error) { diff --git a/pkg/agent/provider/provider.go b/pkg/agent/provider/provider.go index 123d4a92..e8c3313c 100644 --- a/pkg/agent/provider/provider.go +++ b/pkg/agent/provider/provider.go @@ -31,13 +31,14 @@ type WebSearchResponse struct { } type ProviderConfig struct { - Provider string `yaml:"provider" config:"provider"` - BaseURL string `yaml:"base_url" config:"base_url"` - APIKey string `yaml:"api_key" config:"api_key"` - Model string `yaml:"model" config:"model"` - Proxy string `yaml:"proxy" config:"proxy"` - Timeout int `yaml:"timeout" config:"timeout"` - Images *bool `yaml:"images,omitempty" config:"images"` + Provider string `yaml:"provider" config:"provider"` + BaseURL string `yaml:"base_url" config:"base_url"` + APIKey string `yaml:"api_key" config:"api_key"` + Model string `yaml:"model" config:"model"` + Proxy string `yaml:"proxy" config:"proxy"` + Headers map[string]string `yaml:"headers,omitempty" config:"headers"` + Timeout int `yaml:"timeout" config:"timeout"` + Images *bool `yaml:"images,omitempty" config:"images"` } func NormalizeProvider(name string) string { @@ -76,6 +77,12 @@ func Resolve(cfg *ProviderConfig) (*ProviderConfig, error) { resolved.Timeout = 120 } + headers, err := normalizeHeaders(resolved.Headers) + if err != nil { + return nil, err + } + resolved.Headers = headers + if resolved.Images == nil { v := inferImageSupport(resolved.Provider, resolved.Model) resolved.Images = &v diff --git a/pkg/agent/provider/provider_test.go b/pkg/agent/provider/provider_test.go index 2b43a5c7..bcfb2de1 100644 --- a/pkg/agent/provider/provider_test.go +++ b/pkg/agent/provider/provider_test.go @@ -39,6 +39,39 @@ func TestResolvePreservesExplicitBaseURL(t *testing.T) { } } +func TestResolveNormalizesCustomHeaders(t *testing.T) { + cfg, err := Resolve(&ProviderConfig{ + Provider: "openai", + APIKey: "test-key", + Headers: map[string]string{ + "user-agent": "Version: 5.10.0 openwarp", + "X-Empty": "", + }, + }) + if err != nil { + t.Fatalf("Resolve() error = %v", err) + } + if got := cfg.Headers["User-Agent"]; got != "Version: 5.10.0 openwarp" { + t.Fatalf("User-Agent = %q", got) + } + if _, ok := cfg.Headers["X-Empty"]; ok { + t.Fatalf("empty header should be ignored: %#v", cfg.Headers) + } +} + +func TestResolveRejectsInvalidCustomHeaders(t *testing.T) { + tests := []map[string]string{ + {"User Agent": "bad"}, + {"X-Test": "bad\nvalue"}, + {"User-Agent": "one", "user-agent": "two"}, + } + for _, headers := range tests { + if _, err := Resolve(&ProviderConfig{Provider: "openai", APIKey: "test-key", Headers: headers}); err == nil { + t.Fatalf("Resolve() error = nil for headers %#v", headers) + } + } +} + func TestInferFromBaseURLDefaultsToOpenAI(t *testing.T) { for _, baseURL := range []string{ "https://api.openai.com/v1", @@ -269,6 +302,72 @@ func TestOpenAIProviderChatCompletionStream(t *testing.T) { } } +func TestOpenAIProviderCustomHeadersForAllRequests(t *testing.T) { + const userAgent = "Version: 5.10.0 openwarp" + seen := map[string]bool{} + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if got := r.Header.Get("User-Agent"); got != userAgent { + t.Fatalf("User-Agent = %q, want %q", got, userAgent) + } + if got := r.Header.Get("X-Test"); got != "yes" { + t.Fatalf("X-Test = %q, want yes", got) + } + + switch { + case r.URL.Path == "/v1/chat/completions" && r.Header.Get("Accept") == "text/event-stream": + seen["stream"] = true + w.Header().Set("Content-Type", "text/event-stream") + fmt.Fprintln(w, `data: {"choices":[{"delta":{"content":"ok"},"finish_reason":"stop"}]}`) + fmt.Fprintln(w, `data: [DONE]`) + case r.URL.Path == "/v1/chat/completions": + seen["chat"] = true + w.Header().Set("Content-Type", "application/json") + fmt.Fprint(w, `{"choices":[{"message":{"role":"assistant","content":"ok"}}]}`) + case r.URL.Path == "/v1/responses": + seen["websearch"] = true + w.Header().Set("Content-Type", "application/json") + fmt.Fprint(w, `{"output":[{"type":"message","content":[{"type":"output_text","text":"ok"}]}]}`) + default: + t.Fatalf("unexpected request path %q", r.URL.Path) + } + })) + defer server.Close() + + p, err := NewOpenAIProvider(&ProviderConfig{ + Provider: "openai", + BaseURL: server.URL + "/v1", + Headers: map[string]string{ + "User-Agent": userAgent, + "X-Test": "yes", + }, + Timeout: 5, + }) + if err != nil { + t.Fatalf("NewOpenAIProvider() error = %v", err) + } + + if _, err := p.ChatCompletion(context.Background(), &ChatCompletionRequest{Model: "test"}); err != nil { + t.Fatalf("ChatCompletion() error = %v", err) + } + ch, err := p.ChatCompletionStream(context.Background(), &ChatCompletionRequest{Model: "test"}) + if err != nil { + t.Fatalf("ChatCompletionStream() error = %v", err) + } + for event := range ch { + if event.Err != nil { + t.Fatalf("stream error = %v", event.Err) + } + } + if _, err := p.WebSearch(context.Background(), "query", 1); err != nil { + t.Fatalf("WebSearch() error = %v", err) + } + for _, name := range []string{"chat", "stream", "websearch"} { + if !seen[name] { + t.Fatalf("missing %s request", name) + } + } +} + func TestAnthropicProviderChatCompletionStream(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/v1/messages" { @@ -389,6 +488,64 @@ func TestAnthropicProviderChatCompletionStream(t *testing.T) { } } +func TestAnthropicProviderCustomHeadersPreserveProviderHeaders(t *testing.T) { + const userAgent = "Version: 5.10.0 openwarp" + seen := map[string]bool{} + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if got := r.Header.Get("User-Agent"); got != userAgent { + t.Fatalf("User-Agent = %q, want %q", got, userAgent) + } + if got := r.Header.Get("X-Test"); got != "yes" { + t.Fatalf("X-Test = %q, want yes", got) + } + if got := r.Header.Get("x-api-key"); got != "test-key" { + t.Fatalf("x-api-key = %q, want test-key", got) + } + if got := r.Header.Get("anthropic-version"); got != anthropicVersion { + t.Fatalf("anthropic-version = %q, want %q", got, anthropicVersion) + } + + w.Header().Set("Content-Type", "application/json") + if r.Header.Get("anthropic-beta") != "" { + seen["websearch"] = true + fmt.Fprint(w, `{"content":[{"type":"text","text":"ok"}]}`) + return + } + seen["chat"] = true + fmt.Fprint(w, `{"id":"msg_1","type":"message","role":"assistant","content":[{"type":"text","text":"ok"}],"stop_reason":"end_turn","usage":{"input_tokens":1,"output_tokens":1}}`) + })) + defer server.Close() + + p, err := NewAnthropicProvider(&ProviderConfig{ + Provider: "anthropic", + BaseURL: server.URL + "/v1", + APIKey: "test-key", + Headers: map[string]string{ + "User-Agent": userAgent, + "X-Test": "yes", + }, + Timeout: 5, + }) + if err != nil { + t.Fatalf("NewAnthropicProvider() error = %v", err) + } + + if _, err := p.ChatCompletion(context.Background(), &ChatCompletionRequest{ + Model: "claude-test", + Messages: []ChatMessage{NewTextMessage("user", "hello")}, + }); err != nil { + t.Fatalf("ChatCompletion() error = %v", err) + } + if _, err := p.WebSearch(context.Background(), "query", 1); err != nil { + t.Fatalf("WebSearch() error = %v", err) + } + for _, name := range []string{"chat", "websearch"} { + if !seen[name] { + t.Fatalf("missing %s request", name) + } + } +} + func TestOpenAIProviderChatCompletionBodyTimeout(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") diff --git a/pkg/web/types.go b/pkg/web/types.go index 4806ad2d..54c03b1c 100644 --- a/pkg/web/types.go +++ b/pkg/web/types.go @@ -62,13 +62,13 @@ type ServiceStatus struct { } type LLMConfig struct { - ConfigPath string `json:"config_path,omitempty"` - ConfigLoaded bool `json:"config_loaded"` - Provider string `json:"provider"` - BaseURL string `json:"base_url"` - APIKey string `json:"api_key,omitempty"` - APIKeyConfigured bool `json:"api_key_configured"` - Model string `json:"model"` - Proxy string `json:"proxy"` + ConfigPath string `json:"config_path,omitempty"` + ConfigLoaded bool `json:"config_loaded"` + Provider string `json:"provider"` + BaseURL string `json:"base_url"` + APIKey string `json:"api_key,omitempty"` + APIKeyConfigured bool `json:"api_key_configured"` + Model string `json:"model"` + Proxy string `json:"proxy"` + Headers map[string]string `json:"headers,omitempty"` } - diff --git a/web/frontend/src/api.ts b/web/frontend/src/api.ts index 2f705e6c..b4f71d4f 100644 --- a/web/frontend/src/api.ts +++ b/web/frontend/src/api.ts @@ -153,6 +153,7 @@ export interface LLMConfig { api_key_configured: boolean; model: string; proxy: string; + headers?: Record; } export interface TerminalMessage { diff --git a/web/frontend/src/components/LLMConfigPanel.tsx b/web/frontend/src/components/LLMConfigPanel.tsx index 821ac506..6e74760d 100644 --- a/web/frontend/src/components/LLMConfigPanel.tsx +++ b/web/frontend/src/components/LLMConfigPanel.tsx @@ -1,5 +1,5 @@ import { useEffect, useState, type FormEvent, type ReactNode } from 'react' -import { CheckCircle, Loader2, Settings, X } from 'lucide-react' +import { CheckCircle, Loader2, Plus, Settings, Trash2, X } from 'lucide-react' import { getLLMConfig, saveLLMConfig } from '../api' import type { LLMConfig, ServerStatus } from '../api' import { Button } from './ui/button' @@ -20,10 +20,42 @@ const emptyConfig: LLMConfig = { api_key_configured: false, model: '', proxy: '', + headers: {}, +} + +type HeaderRow = { + id: string + key: string + value: string +} + +let headerRowSeq = 0 + +function createHeaderRow(key = '', value = ''): HeaderRow { + headerRowSeq += 1 + return { id: `header-${headerRowSeq}`, key, value } +} + +function rowsFromHeaders(headers?: Record): HeaderRow[] { + return Object.entries(headers || {}) + .sort(([a], [b]) => a.localeCompare(b)) + .map(([key, value]) => createHeaderRow(key, value)) +} + +function headersFromRows(rows: HeaderRow[]): Record { + const headers: Record = {} + for (const row of rows) { + const key = row.key.trim() + const value = row.value.trim() + if (!key || !value) continue + headers[key] = value + } + return headers } export default function LLMConfigPanel({ open, status, onClose, onSaved }: LLMConfigPanelProps) { const [config, setConfig] = useState(emptyConfig) + const [headerRows, setHeaderRows] = useState([]) const [loading, setLoading] = useState(false) const [saving, setSaving] = useState(false) const [error, setError] = useState('') @@ -35,7 +67,10 @@ export default function LLMConfigPanel({ open, status, onClose, onSaved }: LLMCo setError('') setSaved(false) getLLMConfig() - .then((cfg) => setConfig({ ...cfg, api_key: '' })) + .then((cfg) => { + setConfig({ ...cfg, api_key: '', headers: cfg.headers || {} }) + setHeaderRows(rowsFromHeaders(cfg.headers)) + }) .catch((err: Error) => setError(err.message || 'Failed to load LLM config')) .finally(() => setLoading(false)) }, [open]) @@ -46,14 +81,27 @@ export default function LLMConfigPanel({ open, status, onClose, onSaved }: LLMCo setConfig((current) => ({ ...current, [key]: value })) } + const updateHeaderRow = (id: string, key: keyof Omit, value: string) => { + setHeaderRows((rows) => rows.map((row) => (row.id === id ? { ...row, [key]: value } : row))) + } + + const addHeaderRow = () => { + setHeaderRows((rows) => [...rows, createHeaderRow()]) + } + + const removeHeaderRow = (id: string) => { + setHeaderRows((rows) => rows.filter((row) => row.id !== id)) + } + const handleSave = async (event: FormEvent) => { event.preventDefault() setSaving(true) setError('') setSaved(false) try { - const next = await saveLLMConfig(config) - setConfig({ ...next, api_key: '' }) + const next = await saveLLMConfig({ ...config, headers: headersFromRows(headerRows) }) + setConfig({ ...next, api_key: '', headers: next.headers || {} }) + setHeaderRows(rowsFromHeaders(next.headers)) setSaved(true) onSaved() } catch (err: any) { @@ -153,6 +201,48 @@ export default function LLMConfigPanel({ open, status, onClose, onSaved }: LLMCo /> + +
+
+
+ Custom Headers + +
+ {headerRows.length > 0 && ( +
+ {headerRows.map((row) => ( +
+ updateHeaderRow(row.id, 'key', event.target.value)} + placeholder="User-Agent" + /> + updateHeaderRow(row.id, 'value', event.target.value)} + placeholder="Version: 5.10.0 openwarp" + /> + +
+ ))} +
+ )} +
+
)} diff --git a/web/static/assets/index-CJ8TjrpF.js b/web/static/assets/index-BlPO2xZS.js similarity index 75% rename from web/static/assets/index-CJ8TjrpF.js rename to web/static/assets/index-BlPO2xZS.js index 5a5bfdf0..ce5e936a 100644 --- a/web/static/assets/index-CJ8TjrpF.js +++ b/web/static/assets/index-BlPO2xZS.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Xm;function Yx(){if(Xm)return Ae;Xm=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=m&&P[m]||P["@@iterator"],typeof P=="function"?P:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function E(P,U,C){this.props=P,this.context=U,this.refs=k,this.updater=C||y}E.prototype.isReactComponent={},E.prototype.setState=function(P,U){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,U,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function L(){}L.prototype=E.prototype;function W(P,U,C){this.props=P,this.context=U,this.refs=k,this.updater=C||y}var z=W.prototype=new L;z.constructor=W,S(z,E.prototype),z.isPureReactComponent=!0;var q=Array.isArray,Q=Object.prototype.hasOwnProperty,A={current:null},le={key:!0,ref:!0,__self:!0,__source:!0};function he(P,U,C){var ae,ve={},fe=null,Le=null;if(U!=null)for(ae in U.ref!==void 0&&(Le=U.ref),U.key!==void 0&&(fe=""+U.key),U)Q.call(U,ae)&&!le.hasOwnProperty(ae)&&(ve[ae]=U[ae]);var ye=arguments.length-2;if(ye===1)ve.children=C;else if(1>>1,U=I[P];if(0>>1;Po(ve,b))feo(Le,ve)?(I[P]=Le,I[fe]=b,P=fe):(I[P]=ve,I[ae]=b,P=ae);else if(feo(Le,b))I[P]=Le,I[fe]=b,P=fe;else break e}}return K}function o(I,K){var b=I.sortIndex-K.sortIndex;return b!==0?b:I.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var f=[],h=[],g=1,m=null,x=3,y=!1,S=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(I){for(var K=r(h);K!==null;){if(K.callback===null)i(h);else if(K.startTime<=I)i(h),K.sortIndex=K.expirationTime,t(f,K);else break;K=r(h)}}function q(I){if(k=!1,z(I),!S)if(r(f)!==null)S=!0,G(Q);else{var K=r(h);K!==null&&re(q,K.startTime-I)}}function Q(I,K){S=!1,k&&(k=!1,L(he),he=-1),y=!0;var b=x;try{for(z(K),m=r(f);m!==null&&(!(m.expirationTime>K)||I&&!V());){var P=m.callback;if(typeof P=="function"){m.callback=null,x=m.priorityLevel;var U=P(m.expirationTime<=K);K=e.unstable_now(),typeof U=="function"?m.callback=U:m===r(f)&&i(f),z(K)}else i(f);m=r(f)}if(m!==null)var C=!0;else{var ae=r(h);ae!==null&&re(q,ae.startTime-K),C=!1}return C}finally{m=null,x=b,y=!1}}var A=!1,le=null,he=-1,ge=5,F=-1;function V(){return!(e.unstable_now()-FI||125P?(I.sortIndex=b,t(h,I),r(f)===null&&I===r(h)&&(k?(L(he),he=-1):k=!0,re(q,b-P))):(I.sortIndex=U,t(f,I),S||y||(S=!0,G(Q))),I},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(I){var K=x;return function(){var b=x;x=K;try{return I.apply(this,arguments)}finally{x=b}}}})(Vc)),Vc}var eg;function Zx(){return eg||(eg=1,Uc.exports=Jx()),Uc.exports}/** + */var Zm;function rw(){return Zm||(Zm=1,(function(e){function t(I,q){var b=I.length;I.push(q);e:for(;0>>1,V=I[P];if(0>>1;Po(ve,b))peo(Pe,ve)?(I[P]=Pe,I[pe]=b,P=pe):(I[P]=ve,I[ae]=b,P=ae);else if(peo(Pe,b))I[P]=Pe,I[pe]=b,P=pe;else break e}}return q}function o(I,q){var b=I.sortIndex-q.sortIndex;return b!==0?b:I.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var f=[],h=[],g=1,m=null,x=3,y=!1,S=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(I){for(var q=r(h);q!==null;){if(q.callback===null)i(h);else if(q.startTime<=I)i(h),q.sortIndex=q.expirationTime,t(f,q);else break;q=r(h)}}function Y(I){if(k=!1,z(I),!S)if(r(f)!==null)S=!0,Q(U);else{var q=r(h);q!==null&&re(Y,q.startTime-I)}}function U(I,q){S=!1,k&&(k=!1,L(he),he=-1),y=!0;var b=x;try{for(z(q),m=r(f);m!==null&&(!(m.expirationTime>q)||I&&!K());){var P=m.callback;if(typeof P=="function"){m.callback=null,x=m.priorityLevel;var V=P(m.expirationTime<=q);q=e.unstable_now(),typeof V=="function"?m.callback=V:m===r(f)&&i(f),z(q)}else i(f);m=r(f)}if(m!==null)var C=!0;else{var ae=r(h);ae!==null&&re(Y,ae.startTime-q),C=!1}return C}finally{m=null,x=b,y=!1}}var T=!1,se=null,he=-1,fe=5,F=-1;function K(){return!(e.unstable_now()-FI||125P?(I.sortIndex=b,t(h,I),r(f)===null&&I===r(h)&&(k?(L(he),he=-1):k=!0,re(Y,b-P))):(I.sortIndex=V,t(f,I),S||y||(S=!0,Q(U))),I},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(I){var q=x;return function(){var b=x;x=q;try{return I.apply(this,arguments)}finally{x=b}}}})(Vc)),Vc}var eg;function nw(){return eg||(eg=1,Uc.exports=rw()),Uc.exports}/** * @license React * react-dom.production.min.js * @@ -30,280 +30,285 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var tg;function ew(){if(tg)return rr;tg=1;var e=bd(),t=Zx();function r(n){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+n,u=1;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},m={};function x(n){return f.call(m,n)?!0:f.call(g,n)?!1:h.test(n)?m[n]=!0:(g[n]=!0,!1)}function y(n,s,u,d){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return d?!1:u!==null?!u.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function S(n,s,u,d){if(s===null||typeof s>"u"||y(n,s,u,d))return!0;if(d)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(n,s,u,d,p,v,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=u,this.propertyName=n,this.type=s,this.sanitizeURL=v,this.removeEmptyString=w}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){E[n]=new k(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var s=n[0];E[s]=new k(s,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){E[n]=new k(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){E[n]=new k(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){E[n]=new k(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){E[n]=new k(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){E[n]=new k(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){E[n]=new k(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){E[n]=new k(n,5,!1,n.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function W(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var s=n.replace(L,W);E[s]=new k(s,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var s=n.replace(L,W);E[s]=new k(s,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var s=n.replace(L,W);E[s]=new k(s,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){E[n]=new k(n,1,!1,n.toLowerCase(),null,!1,!1)}),E.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){E[n]=new k(n,1,!1,n.toLowerCase(),null,!0,!0)});function z(n,s,u,d){var p=E.hasOwnProperty(s)?E[s]:null;(p!==null?p.type!==0:d||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},m={};function x(n){return f.call(m,n)?!0:f.call(g,n)?!1:h.test(n)?m[n]=!0:(g[n]=!0,!1)}function y(n,s,u,d){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return d?!1:u!==null?!u.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function S(n,s,u,d){if(s===null||typeof s>"u"||y(n,s,u,d))return!0;if(d)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(n,s,u,d,p,v,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=u,this.propertyName=n,this.type=s,this.sanitizeURL=v,this.removeEmptyString=w}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){E[n]=new k(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var s=n[0];E[s]=new k(s,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){E[n]=new k(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){E[n]=new k(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){E[n]=new k(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){E[n]=new k(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){E[n]=new k(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){E[n]=new k(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){E[n]=new k(n,5,!1,n.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function W(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var s=n.replace(L,W);E[s]=new k(s,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var s=n.replace(L,W);E[s]=new k(s,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var s=n.replace(L,W);E[s]=new k(s,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){E[n]=new k(n,1,!1,n.toLowerCase(),null,!1,!1)}),E.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){E[n]=new k(n,1,!1,n.toLowerCase(),null,!0,!0)});function z(n,s,u,d){var p=E.hasOwnProperty(s)?E[s]:null;(p!==null?p.type!==0:d||!(2N||p[w]!==v[N]){var R=` -`+p[w].replace(" at new "," at ");return n.displayName&&R.includes("")&&(R=R.replace("",n.displayName)),R}while(1<=w&&0<=N);break}}}finally{C=!1,Error.prepareStackTrace=u}return(n=n?n.displayName||n.name:"")?U(n):""}function ve(n){switch(n.tag){case 5:return U(n.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return n=ae(n.type,!1),n;case 11:return n=ae(n.type.render,!1),n;case 1:return n=ae(n.type,!0),n;default:return""}}function fe(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case le:return"Fragment";case A:return"Portal";case ge:return"Profiler";case he:return"StrictMode";case D:return"Suspense";case H:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case V:return(n.displayName||"Context")+".Consumer";case F:return(n._context.displayName||"Context")+".Provider";case T:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case j:return s=n.displayName||null,s!==null?s:fe(n.type)||"Memo";case G:s=n._payload,n=n._init;try{return fe(n(s))}catch{}}return null}function Le(n){var s=n.type;switch(n.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=s.render,n=n.displayName||n.name||"",s.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(s);case 8:return s===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ye(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function xe(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Fe(n){var s=xe(n)?"checked":"value",u=Object.getOwnPropertyDescriptor(n.constructor.prototype,s),d=""+n[s];if(!n.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,v=u.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return p.call(this)},set:function(w){d=""+w,v.call(this,w)}}),Object.defineProperty(n,s,{enumerable:u.enumerable}),{getValue:function(){return d},setValue:function(w){d=""+w},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function Ye(n){n._valueTracker||(n._valueTracker=Fe(n))}function or(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var u=s.getValue(),d="";return n&&(d=xe(n)?n.checked?"true":"false":n.value),n=d,n!==u?(s.setValue(n),!0):!1}function ze(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function en(n,s){var u=s.checked;return b({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??n._wrapperState.initialChecked})}function xs(n,s){var u=s.defaultValue==null?"":s.defaultValue,d=s.checked!=null?s.checked:s.defaultChecked;u=ye(s.value!=null?s.value:u),n._wrapperState={initialChecked:d,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function ws(n,s){s=s.checked,s!=null&&z(n,"checked",s,!1)}function Mi(n,s){ws(n,s);var u=ye(s.value),d=s.type;if(u!=null)d==="number"?(u===0&&n.value===""||n.value!=u)&&(n.value=""+u):n.value!==""+u&&(n.value=""+u);else if(d==="submit"||d==="reset"){n.removeAttribute("value");return}s.hasOwnProperty("value")?Di(n,s.type,u):s.hasOwnProperty("defaultValue")&&Di(n,s.type,ye(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(n.defaultChecked=!!s.defaultChecked)}function Ko(n,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var d=s.type;if(!(d!=="submit"&&d!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+n._wrapperState.initialValue,u||s===n.value||(n.value=s),n.defaultValue=s}u=n.name,u!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,u!==""&&(n.name=u)}function Di(n,s,u){(s!=="number"||ze(n.ownerDocument)!==n)&&(u==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+u&&(n.defaultValue=""+u))}var xn=Array.isArray;function wn(n,s,u,d){if(n=n.options,s){s={};for(var p=0;p"+s.valueOf().toString()+"",s=ke.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;s.firstChild;)n.appendChild(s.firstChild)}});function He(n,s){if(s){var u=n.firstChild;if(u&&u===n.lastChild&&u.nodeType===3){u.nodeValue=s;return}}n.textContent=s}var Mt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tn=["Webkit","ms","Moz","O"];Object.keys(Mt).forEach(function(n){tn.forEach(function(s){s=s+n.charAt(0).toUpperCase()+n.substring(1),Mt[s]=Mt[n]})});function gr(n,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Mt.hasOwnProperty(n)&&Mt[n]?(""+s).trim():s+"px"}function Sn(n,s){n=n.style;for(var u in s)if(s.hasOwnProperty(u)){var d=u.indexOf("--")===0,p=gr(u,s[u],d);u==="float"&&(u="cssFloat"),d?n.setProperty(u,p):n[u]=p}}var ei=b({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dt(n,s){if(s){if(ei[n]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function zr(n,s){if(n.indexOf("-")===-1)return typeof s.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lr=null;function ru(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var nu=null,Ti=null,Ai=null;function df(n){if(n=Us(n)){if(typeof nu!="function")throw Error(r(280));var s=n.stateNode;s&&(s=vl(s),nu(n.stateNode,n.type,s))}}function ff(n){Ti?Ai?Ai.push(n):Ai=[n]:Ti=n}function pf(){if(Ti){var n=Ti,s=Ai;if(Ai=Ti=null,df(n),s)for(n=0;n>>=0,n===0?32:31-(c1(n)/h1|0)|0}var el=64,tl=4194304;function Es(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function rl(n,s){var u=n.pendingLanes;if(u===0)return 0;var d=0,p=n.suspendedLanes,v=n.pingedLanes,w=u&268435455;if(w!==0){var N=w&~p;N!==0?d=Es(N):(v&=w,v!==0&&(d=Es(v)))}else w=u&~p,w!==0?d=Es(w):v!==0&&(d=Es(v));if(d===0)return 0;if(s!==0&&s!==d&&(s&p)===0&&(p=d&-d,v=s&-s,p>=v||p===16&&(v&4194240)!==0))return s;if((d&4)!==0&&(d|=u&16),s=n.entangledLanes,s!==0)for(n=n.entanglements,s&=d;0u;u++)s.push(n);return s}function Ns(n,s,u){n.pendingLanes|=s,s!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,s=31-Pr(s),n[s]=u}function m1(n,s){var u=n.pendingLanes&~s;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=s,n.mutableReadLanes&=s,n.entangledLanes&=s,s=n.entanglements;var d=n.eventTimes;for(n=n.expirationTimes;0=Bs),$f=" ",Wf=!1;function Uf(n,s){switch(n){case"keyup":return W1.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vf(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ji=!1;function V1(n,s){switch(n){case"compositionend":return Vf(s);case"keypress":return s.which!==32?null:(Wf=!0,$f);case"textInput":return n=s.data,n===$f&&Wf?null:n;default:return null}}function K1(n,s){if(ji)return n==="compositionend"||!wu&&Uf(n,s)?(n=If(),ll=mu=Nn=null,ji=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:u,offset:s-n};n=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Jf(u)}}function ep(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?ep(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function tp(){for(var n=window,s=ze();s instanceof n.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)n=s.contentWindow;else break;s=ze(n.document)}return s}function ku(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}function tx(n){var s=tp(),u=n.focusedElem,d=n.selectionRange;if(s!==u&&u&&u.ownerDocument&&ep(u.ownerDocument.documentElement,u)){if(d!==null&&ku(u)){if(s=d.start,n=d.end,n===void 0&&(n=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(n,u.value.length);else if(n=(s=u.ownerDocument||document)&&s.defaultView||window,n.getSelection){n=n.getSelection();var p=u.textContent.length,v=Math.min(d.start,p);d=d.end===void 0?v:Math.min(d.end,p),!n.extend&&v>d&&(p=d,d=v,v=p),p=Zf(u,v);var w=Zf(u,d);p&&w&&(n.rangeCount!==1||n.anchorNode!==p.node||n.anchorOffset!==p.offset||n.focusNode!==w.node||n.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(p.node,p.offset),n.removeAllRanges(),v>d?(n.addRange(s),n.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),n.addRange(s)))}}for(s=[],n=u;n=n.parentNode;)n.nodeType===1&&s.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u=document.documentMode,zi=null,Cu=null,Os=null,Eu=!1;function rp(n,s,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Eu||zi==null||zi!==ze(d)||(d=zi,"selectionStart"in d&&ku(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Os&&zs(Os,d)||(Os=d,d=ml(Cu,"onSelect"),0Wi||(n.current=zu[Wi],zu[Wi]=null,Wi--)}function Xe(n,s){Wi++,zu[Wi]=n.current,n.current=s}var Mn={},jt=Rn(Mn),Qt=Rn(!1),ni=Mn;function Ui(n,s){var u=n.type.contextTypes;if(!u)return Mn;var d=n.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===s)return d.__reactInternalMemoizedMaskedChildContext;var p={},v;for(v in u)p[v]=s[v];return d&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=s,n.__reactInternalMemoizedMaskedChildContext=p),p}function Jt(n){return n=n.childContextTypes,n!=null}function yl(){Qe(Qt),Qe(jt)}function _p(n,s,u){if(jt.current!==Mn)throw Error(r(168));Xe(jt,s),Xe(Qt,u)}function vp(n,s,u){var d=n.stateNode;if(s=s.childContextTypes,typeof d.getChildContext!="function")return u;d=d.getChildContext();for(var p in d)if(!(p in s))throw Error(r(108,Le(n)||"Unknown",p));return b({},u,d)}function xl(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Mn,ni=jt.current,Xe(jt,n),Xe(Qt,Qt.current),!0}function yp(n,s,u){var d=n.stateNode;if(!d)throw Error(r(169));u?(n=vp(n,s,ni),d.__reactInternalMemoizedMergedChildContext=n,Qe(Qt),Qe(jt),Xe(jt,n)):Qe(Qt),Xe(Qt,u)}var nn=null,wl=!1,Ou=!1;function xp(n){nn===null?nn=[n]:nn.push(n)}function fx(n){wl=!0,xp(n)}function Dn(){if(!Ou&&nn!==null){Ou=!0;var n=0,s=Ue;try{var u=nn;for(Ue=1;n>=w,p-=w,sn=1<<32-Pr(s)+p|u<Ce?(kt=Se,Se=null):kt=Se.sibling;var We=J(B,Se,O[Ce],ie);if(We===null){Se===null&&(Se=kt);break}n&&Se&&We.alternate===null&&s(B,Se),M=v(We,M,Ce),we===null?_e=We:we.sibling=We,we=We,Se=kt}if(Ce===O.length)return u(B,Se),et&&si(B,Ce),_e;if(Se===null){for(;CeCe?(kt=Se,Se=null):kt=Se.sibling;var Hn=J(B,Se,We.value,ie);if(Hn===null){Se===null&&(Se=kt);break}n&&Se&&Hn.alternate===null&&s(B,Se),M=v(Hn,M,Ce),we===null?_e=Hn:we.sibling=Hn,we=Hn,Se=kt}if(We.done)return u(B,Se),et&&si(B,Ce),_e;if(Se===null){for(;!We.done;Ce++,We=O.next())We=ee(B,We.value,ie),We!==null&&(M=v(We,M,Ce),we===null?_e=We:we.sibling=We,we=We);return et&&si(B,Ce),_e}for(Se=d(B,Se);!We.done;Ce++,We=O.next())We=ce(Se,B,Ce,We.value,ie),We!==null&&(n&&We.alternate!==null&&Se.delete(We.key===null?Ce:We.key),M=v(We,M,Ce),we===null?_e=We:we.sibling=We,we=We);return n&&Se.forEach(function(qx){return s(B,qx)}),et&&si(B,Ce),_e}function ht(B,M,O,ie){if(typeof O=="object"&&O!==null&&O.type===le&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case Q:e:{for(var _e=O.key,we=M;we!==null;){if(we.key===_e){if(_e=O.type,_e===le){if(we.tag===7){u(B,we.sibling),M=p(we,O.props.children),M.return=B,B=M;break e}}else if(we.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===G&&Ep(_e)===we.type){u(B,we.sibling),M=p(we,O.props),M.ref=Vs(B,we,O),M.return=B,B=M;break e}u(B,we);break}else s(B,we);we=we.sibling}O.type===le?(M=fi(O.props.children,B.mode,ie,O.key),M.return=B,B=M):(ie=Xl(O.type,O.key,O.props,null,B.mode,ie),ie.ref=Vs(B,M,O),ie.return=B,B=ie)}return w(B);case A:e:{for(we=O.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){u(B,M.sibling),M=p(M,O.children||[]),M.return=B,B=M;break e}else{u(B,M);break}else s(B,M);M=M.sibling}M=Ic(O,B.mode,ie),M.return=B,B=M}return w(B);case G:return we=O._init,ht(B,M,we(O._payload),ie)}if(xn(O))return pe(B,M,O,ie);if(K(O))return me(B,M,O,ie);Cl(B,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(u(B,M.sibling),M=p(M,O),M.return=B,B=M):(u(B,M),M=Bc(O,B.mode,ie),M.return=B,B=M),w(B)):u(B,M)}return ht}var Yi=Np(!0),Lp=Np(!1),El=Rn(null),Nl=null,Xi=null,Vu=null;function Ku(){Vu=Xi=Nl=null}function qu(n){var s=El.current;Qe(El),n._currentValue=s}function Yu(n,s,u){for(;n!==null;){var d=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),n===u)break;n=n.return}}function Gi(n,s){Nl=n,Vu=Xi=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&s)!==0&&(Zt=!0),n.firstContext=null)}function yr(n){var s=n._currentValue;if(Vu!==n)if(n={context:n,memoizedValue:s,next:null},Xi===null){if(Nl===null)throw Error(r(308));Xi=n,Nl.dependencies={lanes:0,firstContext:n}}else Xi=Xi.next=n;return s}var oi=null;function Xu(n){oi===null?oi=[n]:oi.push(n)}function Pp(n,s,u,d){var p=s.interleaved;return p===null?(u.next=u,Xu(s)):(u.next=p.next,p.next=u),s.interleaved=u,ln(n,d)}function ln(n,s){n.lanes|=s;var u=n.alternate;for(u!==null&&(u.lanes|=s),u=n,n=n.return;n!==null;)n.childLanes|=s,u=n.alternate,u!==null&&(u.childLanes|=s),u=n,n=n.return;return u.tag===3?u.stateNode:null}var Tn=!1;function Gu(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rp(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function an(n,s){return{eventTime:n,lane:s,tag:0,payload:null,callback:null,next:null}}function An(n,s,u){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,($e&2)!==0){var p=d.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,ln(n,u)}return p=d.interleaved,p===null?(s.next=s,Xu(d)):(s.next=p.next,p.next=s),d.interleaved=s,ln(n,u)}function Ll(n,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var d=s.lanes;d&=n.pendingLanes,u|=d,s.lanes=u,cu(n,u)}}function Mp(n,s){var u=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var p=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var w={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};v===null?p=v=w:v=v.next=w,u=u.next}while(u!==null);v===null?p=v=s:v=v.next=s}else p=v=s;u={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,effects:d.effects},n.updateQueue=u;return}n=u.lastBaseUpdate,n===null?u.firstBaseUpdate=s:n.next=s,u.lastBaseUpdate=s}function Pl(n,s,u,d){var p=n.updateQueue;Tn=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var R=N,$=R.next;R.next=null,w===null?v=$:w.next=$,w=R;var Z=n.alternate;Z!==null&&(Z=Z.updateQueue,N=Z.lastBaseUpdate,N!==w&&(N===null?Z.firstBaseUpdate=$:N.next=$,Z.lastBaseUpdate=R))}if(v!==null){var ee=p.baseState;w=0,Z=$=R=null,N=v;do{var J=N.lane,ce=N.eventTime;if((d&J)===J){Z!==null&&(Z=Z.next={eventTime:ce,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var pe=n,me=N;switch(J=s,ce=u,me.tag){case 1:if(pe=me.payload,typeof pe=="function"){ee=pe.call(ce,ee,J);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=me.payload,J=typeof pe=="function"?pe.call(ce,ee,J):pe,J==null)break e;ee=b({},ee,J);break e;case 2:Tn=!0}}N.callback!==null&&N.lane!==0&&(n.flags|=64,J=p.effects,J===null?p.effects=[N]:J.push(N))}else ce={eventTime:ce,lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Z===null?($=Z=ce,R=ee):Z=Z.next=ce,w|=J;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);if(Z===null&&(R=ee),p.baseState=R,p.firstBaseUpdate=$,p.lastBaseUpdate=Z,s=p.shared.interleaved,s!==null){p=s;do w|=p.lane,p=p.next;while(p!==s)}else v===null&&(p.shared.lanes=0);ui|=w,n.lanes=w,n.memoizedState=ee}}function Dp(n,s,u){if(n=s.effects,s.effects=null,n!==null)for(s=0;su?u:4,n(!0);var d=tc.transition;tc.transition={};try{n(!1),s()}finally{Ue=u,tc.transition=d}}function Qp(){return xr().memoizedState}function _x(n,s,u){var d=zn(n);if(u={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null},Jp(n))Zp(s,u);else if(u=Pp(n,s,u,d),u!==null){var p=Kt();Br(u,n,d,p),em(u,s,d)}}function vx(n,s,u){var d=zn(n),p={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null};if(Jp(n))Zp(s,p);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=s.lastRenderedReducer,v!==null))try{var w=s.lastRenderedState,N=v(w,u);if(p.hasEagerState=!0,p.eagerState=N,Rr(N,w)){var R=s.interleaved;R===null?(p.next=p,Xu(s)):(p.next=R.next,R.next=p),s.interleaved=p;return}}catch{}finally{}u=Pp(n,s,p,d),u!==null&&(p=Kt(),Br(u,n,d,p),em(u,s,d))}}function Jp(n){var s=n.alternate;return n===nt||s!==null&&s===nt}function Zp(n,s){Xs=Dl=!0;var u=n.pending;u===null?s.next=s:(s.next=u.next,u.next=s),n.pending=s}function em(n,s,u){if((u&4194240)!==0){var d=s.lanes;d&=n.pendingLanes,u|=d,s.lanes=u,cu(n,u)}}var Bl={readContext:yr,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},yx={readContext:yr,useCallback:function(n,s){return $r().memoizedState=[n,s===void 0?null:s],n},useContext:yr,useEffect:Wp,useImperativeHandle:function(n,s,u){return u=u!=null?u.concat([n]):null,Tl(4194308,4,Kp.bind(null,s,n),u)},useLayoutEffect:function(n,s){return Tl(4194308,4,n,s)},useInsertionEffect:function(n,s){return Tl(4,2,n,s)},useMemo:function(n,s){var u=$r();return s=s===void 0?null:s,n=n(),u.memoizedState=[n,s],n},useReducer:function(n,s,u){var d=$r();return s=u!==void 0?u(s):s,d.memoizedState=d.baseState=s,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:s},d.queue=n,n=n.dispatch=_x.bind(null,nt,n),[d.memoizedState,n]},useRef:function(n){var s=$r();return n={current:n},s.memoizedState=n},useState:Hp,useDebugValue:ac,useDeferredValue:function(n){return $r().memoizedState=n},useTransition:function(){var n=Hp(!1),s=n[0];return n=gx.bind(null,n[1]),$r().memoizedState=n,[s,n]},useMutableSource:function(){},useSyncExternalStore:function(n,s,u){var d=nt,p=$r();if(et){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),bt===null)throw Error(r(349));(ai&30)!==0||Ip(d,s,u)}p.memoizedState=u;var v={value:u,getSnapshot:s};return p.queue=v,Wp(zp.bind(null,d,v,n),[n]),d.flags|=2048,Js(9,jp.bind(null,d,v,u,s),void 0,null),u},useId:function(){var n=$r(),s=bt.identifierPrefix;if(et){var u=on,d=sn;u=(d&~(1<<32-Pr(d)-1)).toString(32)+u,s=":"+s+"R"+u,u=Gs++,0")&&(R=R.replace("",n.displayName)),R}while(1<=w&&0<=N);break}}}finally{C=!1,Error.prepareStackTrace=u}return(n=n?n.displayName||n.name:"")?V(n):""}function ve(n){switch(n.tag){case 5:return V(n.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return n=ae(n.type,!1),n;case 11:return n=ae(n.type.render,!1),n;case 1:return n=ae(n.type,!0),n;default:return""}}function pe(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case se:return"Fragment";case T:return"Portal";case fe:return"Profiler";case he:return"StrictMode";case D:return"Suspense";case H:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case K:return(n.displayName||"Context")+".Consumer";case F:return(n._context.displayName||"Context")+".Provider";case A:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case j:return s=n.displayName||null,s!==null?s:pe(n.type)||"Memo";case Q:s=n._payload,n=n._init;try{return pe(n(s))}catch{}}return null}function Pe(n){var s=n.type;switch(n.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=s.render,n=n.displayName||n.name||"",s.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(s);case 8:return s===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ye(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function xe(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Fe(n){var s=xe(n)?"checked":"value",u=Object.getOwnPropertyDescriptor(n.constructor.prototype,s),d=""+n[s];if(!n.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,v=u.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return p.call(this)},set:function(w){d=""+w,v.call(this,w)}}),Object.defineProperty(n,s,{enumerable:u.enumerable}),{getValue:function(){return d},setValue:function(w){d=""+w},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function Ye(n){n._valueTracker||(n._valueTracker=Fe(n))}function or(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var u=s.getValue(),d="";return n&&(d=xe(n)?n.checked?"true":"false":n.value),n=d,n!==u?(s.setValue(n),!0):!1}function ze(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function tn(n,s){var u=s.checked;return b({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??n._wrapperState.initialChecked})}function xs(n,s){var u=s.defaultValue==null?"":s.defaultValue,d=s.checked!=null?s.checked:s.defaultChecked;u=ye(s.value!=null?s.value:u),n._wrapperState={initialChecked:d,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function ws(n,s){s=s.checked,s!=null&&z(n,"checked",s,!1)}function Mi(n,s){ws(n,s);var u=ye(s.value),d=s.type;if(u!=null)d==="number"?(u===0&&n.value===""||n.value!=u)&&(n.value=""+u):n.value!==""+u&&(n.value=""+u);else if(d==="submit"||d==="reset"){n.removeAttribute("value");return}s.hasOwnProperty("value")?Ti(n,s.type,u):s.hasOwnProperty("defaultValue")&&Ti(n,s.type,ye(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(n.defaultChecked=!!s.defaultChecked)}function Ko(n,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var d=s.type;if(!(d!=="submit"&&d!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+n._wrapperState.initialValue,u||s===n.value||(n.value=s),n.defaultValue=s}u=n.name,u!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,u!==""&&(n.name=u)}function Ti(n,s,u){(s!=="number"||ze(n.ownerDocument)!==n)&&(u==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+u&&(n.defaultValue=""+u))}var Sn=Array.isArray;function bn(n,s,u,d){if(n=n.options,s){s={};for(var p=0;p"+s.valueOf().toString()+"",s=ke.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;s.firstChild;)n.appendChild(s.firstChild)}});function He(n,s){if(s){var u=n.firstChild;if(u&&u===n.lastChild&&u.nodeType===3){u.nodeValue=s;return}}n.textContent=s}var Mt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rn=["Webkit","ms","Moz","O"];Object.keys(Mt).forEach(function(n){rn.forEach(function(s){s=s+n.charAt(0).toUpperCase()+n.substring(1),Mt[s]=Mt[n]})});function gr(n,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Mt.hasOwnProperty(n)&&Mt[n]?(""+s).trim():s+"px"}function kn(n,s){n=n.style;for(var u in s)if(s.hasOwnProperty(u)){var d=u.indexOf("--")===0,p=gr(u,s[u],d);u==="float"&&(u="cssFloat"),d?n.setProperty(u,p):n[u]=p}}var ti=b({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tt(n,s){if(s){if(ti[n]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function zr(n,s){if(n.indexOf("-")===-1)return typeof s.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lr=null;function ru(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var nu=null,Di=null,Ai=null;function df(n){if(n=Us(n)){if(typeof nu!="function")throw Error(r(280));var s=n.stateNode;s&&(s=vl(s),nu(n.stateNode,n.type,s))}}function ff(n){Di?Ai?Ai.push(n):Ai=[n]:Di=n}function pf(){if(Di){var n=Di,s=Ai;if(Ai=Di=null,df(n),s)for(n=0;n>>=0,n===0?32:31-(p1(n)/m1|0)|0}var el=64,tl=4194304;function Es(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function rl(n,s){var u=n.pendingLanes;if(u===0)return 0;var d=0,p=n.suspendedLanes,v=n.pingedLanes,w=u&268435455;if(w!==0){var N=w&~p;N!==0?d=Es(N):(v&=w,v!==0&&(d=Es(v)))}else w=u&~p,w!==0?d=Es(w):v!==0&&(d=Es(v));if(d===0)return 0;if(s!==0&&s!==d&&(s&p)===0&&(p=d&-d,v=s&-s,p>=v||p===16&&(v&4194240)!==0))return s;if((d&4)!==0&&(d|=u&16),s=n.entangledLanes,s!==0)for(n=n.entanglements,s&=d;0u;u++)s.push(n);return s}function Ns(n,s,u){n.pendingLanes|=s,s!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,s=31-Pr(s),n[s]=u}function y1(n,s){var u=n.pendingLanes&~s;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=s,n.mutableReadLanes&=s,n.entangledLanes&=s,s=n.entanglements;var d=n.eventTimes;for(n=n.expirationTimes;0=Bs),$f=" ",Wf=!1;function Uf(n,s){switch(n){case"keyup":return q1.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vf(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ji=!1;function X1(n,s){switch(n){case"compositionend":return Vf(s);case"keypress":return s.which!==32?null:(Wf=!0,$f);case"textInput":return n=s.data,n===$f&&Wf?null:n;default:return null}}function G1(n,s){if(ji)return n==="compositionend"||!wu&&Uf(n,s)?(n=If(),ll=mu=Pn=null,ji=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:u,offset:s-n};n=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Jf(u)}}function ep(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?ep(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function tp(){for(var n=window,s=ze();s instanceof n.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)n=s.contentWindow;else break;s=ze(n.document)}return s}function ku(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}function sx(n){var s=tp(),u=n.focusedElem,d=n.selectionRange;if(s!==u&&u&&u.ownerDocument&&ep(u.ownerDocument.documentElement,u)){if(d!==null&&ku(u)){if(s=d.start,n=d.end,n===void 0&&(n=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(n,u.value.length);else if(n=(s=u.ownerDocument||document)&&s.defaultView||window,n.getSelection){n=n.getSelection();var p=u.textContent.length,v=Math.min(d.start,p);d=d.end===void 0?v:Math.min(d.end,p),!n.extend&&v>d&&(p=d,d=v,v=p),p=Zf(u,v);var w=Zf(u,d);p&&w&&(n.rangeCount!==1||n.anchorNode!==p.node||n.anchorOffset!==p.offset||n.focusNode!==w.node||n.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(p.node,p.offset),n.removeAllRanges(),v>d?(n.addRange(s),n.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),n.addRange(s)))}}for(s=[],n=u;n=n.parentNode;)n.nodeType===1&&s.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u=document.documentMode,zi=null,Cu=null,Os=null,Eu=!1;function rp(n,s,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Eu||zi==null||zi!==ze(d)||(d=zi,"selectionStart"in d&&ku(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Os&&zs(Os,d)||(Os=d,d=ml(Cu,"onSelect"),0Wi||(n.current=zu[Wi],zu[Wi]=null,Wi--)}function Xe(n,s){Wi++,zu[Wi]=n.current,n.current=s}var Dn={},jt=Tn(Dn),Qt=Tn(!1),ii=Dn;function Ui(n,s){var u=n.type.contextTypes;if(!u)return Dn;var d=n.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===s)return d.__reactInternalMemoizedMaskedChildContext;var p={},v;for(v in u)p[v]=s[v];return d&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=s,n.__reactInternalMemoizedMaskedChildContext=p),p}function Jt(n){return n=n.childContextTypes,n!=null}function yl(){Qe(Qt),Qe(jt)}function _p(n,s,u){if(jt.current!==Dn)throw Error(r(168));Xe(jt,s),Xe(Qt,u)}function vp(n,s,u){var d=n.stateNode;if(s=s.childContextTypes,typeof d.getChildContext!="function")return u;d=d.getChildContext();for(var p in d)if(!(p in s))throw Error(r(108,Pe(n)||"Unknown",p));return b({},u,d)}function xl(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Dn,ii=jt.current,Xe(jt,n),Xe(Qt,Qt.current),!0}function yp(n,s,u){var d=n.stateNode;if(!d)throw Error(r(169));u?(n=vp(n,s,ii),d.__reactInternalMemoizedMergedChildContext=n,Qe(Qt),Qe(jt),Xe(jt,n)):Qe(Qt),Xe(Qt,u)}var sn=null,wl=!1,Ou=!1;function xp(n){sn===null?sn=[n]:sn.push(n)}function _x(n){wl=!0,xp(n)}function An(){if(!Ou&&sn!==null){Ou=!0;var n=0,s=Ue;try{var u=sn;for(Ue=1;n>=w,p-=w,on=1<<32-Pr(s)+p|u<Ce?(kt=Se,Se=null):kt=Se.sibling;var We=J(B,Se,O[Ce],ie);if(We===null){Se===null&&(Se=kt);break}n&&Se&&We.alternate===null&&s(B,Se),M=v(We,M,Ce),we===null?_e=We:we.sibling=We,we=We,Se=kt}if(Ce===O.length)return u(B,Se),et&&oi(B,Ce),_e;if(Se===null){for(;CeCe?(kt=Se,Se=null):kt=Se.sibling;var Wn=J(B,Se,We.value,ie);if(Wn===null){Se===null&&(Se=kt);break}n&&Se&&Wn.alternate===null&&s(B,Se),M=v(Wn,M,Ce),we===null?_e=Wn:we.sibling=Wn,we=Wn,Se=kt}if(We.done)return u(B,Se),et&&oi(B,Ce),_e;if(Se===null){for(;!We.done;Ce++,We=O.next())We=ee(B,We.value,ie),We!==null&&(M=v(We,M,Ce),we===null?_e=We:we.sibling=We,we=We);return et&&oi(B,Ce),_e}for(Se=d(B,Se);!We.done;Ce++,We=O.next())We=ce(Se,B,Ce,We.value,ie),We!==null&&(n&&We.alternate!==null&&Se.delete(We.key===null?Ce:We.key),M=v(We,M,Ce),we===null?_e=We:we.sibling=We,we=We);return n&&Se.forEach(function(Qx){return s(B,Qx)}),et&&oi(B,Ce),_e}function ht(B,M,O,ie){if(typeof O=="object"&&O!==null&&O.type===se&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case U:e:{for(var _e=O.key,we=M;we!==null;){if(we.key===_e){if(_e=O.type,_e===se){if(we.tag===7){u(B,we.sibling),M=p(we,O.props.children),M.return=B,B=M;break e}}else if(we.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===Q&&Ep(_e)===we.type){u(B,we.sibling),M=p(we,O.props),M.ref=Vs(B,we,O),M.return=B,B=M;break e}u(B,we);break}else s(B,we);we=we.sibling}O.type===se?(M=pi(O.props.children,B.mode,ie,O.key),M.return=B,B=M):(ie=Xl(O.type,O.key,O.props,null,B.mode,ie),ie.ref=Vs(B,M,O),ie.return=B,B=ie)}return w(B);case T:e:{for(we=O.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){u(B,M.sibling),M=p(M,O.children||[]),M.return=B,B=M;break e}else{u(B,M);break}else s(B,M);M=M.sibling}M=Ic(O,B.mode,ie),M.return=B,B=M}return w(B);case Q:return we=O._init,ht(B,M,we(O._payload),ie)}if(Sn(O))return me(B,M,O,ie);if(q(O))return ge(B,M,O,ie);Cl(B,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(u(B,M.sibling),M=p(M,O),M.return=B,B=M):(u(B,M),M=Bc(O,B.mode,ie),M.return=B,B=M),w(B)):u(B,M)}return ht}var Yi=Np(!0),Lp=Np(!1),El=Tn(null),Nl=null,Xi=null,Vu=null;function Ku(){Vu=Xi=Nl=null}function qu(n){var s=El.current;Qe(El),n._currentValue=s}function Yu(n,s,u){for(;n!==null;){var d=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),n===u)break;n=n.return}}function Gi(n,s){Nl=n,Vu=Xi=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&s)!==0&&(Zt=!0),n.firstContext=null)}function yr(n){var s=n._currentValue;if(Vu!==n)if(n={context:n,memoizedValue:s,next:null},Xi===null){if(Nl===null)throw Error(r(308));Xi=n,Nl.dependencies={lanes:0,firstContext:n}}else Xi=Xi.next=n;return s}var li=null;function Xu(n){li===null?li=[n]:li.push(n)}function Pp(n,s,u,d){var p=s.interleaved;return p===null?(u.next=u,Xu(s)):(u.next=p.next,p.next=u),s.interleaved=u,an(n,d)}function an(n,s){n.lanes|=s;var u=n.alternate;for(u!==null&&(u.lanes|=s),u=n,n=n.return;n!==null;)n.childLanes|=s,u=n.alternate,u!==null&&(u.childLanes|=s),u=n,n=n.return;return u.tag===3?u.stateNode:null}var Bn=!1;function Gu(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rp(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function un(n,s){return{eventTime:n,lane:s,tag:0,payload:null,callback:null,next:null}}function In(n,s,u){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,($e&2)!==0){var p=d.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s,an(n,u)}return p=d.interleaved,p===null?(s.next=s,Xu(d)):(s.next=p.next,p.next=s),d.interleaved=s,an(n,u)}function Ll(n,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var d=s.lanes;d&=n.pendingLanes,u|=d,s.lanes=u,cu(n,u)}}function Mp(n,s){var u=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var p=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var w={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};v===null?p=v=w:v=v.next=w,u=u.next}while(u!==null);v===null?p=v=s:v=v.next=s}else p=v=s;u={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,effects:d.effects},n.updateQueue=u;return}n=u.lastBaseUpdate,n===null?u.firstBaseUpdate=s:n.next=s,u.lastBaseUpdate=s}function Pl(n,s,u,d){var p=n.updateQueue;Bn=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var R=N,$=R.next;R.next=null,w===null?v=$:w.next=$,w=R;var Z=n.alternate;Z!==null&&(Z=Z.updateQueue,N=Z.lastBaseUpdate,N!==w&&(N===null?Z.firstBaseUpdate=$:N.next=$,Z.lastBaseUpdate=R))}if(v!==null){var ee=p.baseState;w=0,Z=$=R=null,N=v;do{var J=N.lane,ce=N.eventTime;if((d&J)===J){Z!==null&&(Z=Z.next={eventTime:ce,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var me=n,ge=N;switch(J=s,ce=u,ge.tag){case 1:if(me=ge.payload,typeof me=="function"){ee=me.call(ce,ee,J);break e}ee=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ge.payload,J=typeof me=="function"?me.call(ce,ee,J):me,J==null)break e;ee=b({},ee,J);break e;case 2:Bn=!0}}N.callback!==null&&N.lane!==0&&(n.flags|=64,J=p.effects,J===null?p.effects=[N]:J.push(N))}else ce={eventTime:ce,lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},Z===null?($=Z=ce,R=ee):Z=Z.next=ce,w|=J;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;J=N,N=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);if(Z===null&&(R=ee),p.baseState=R,p.firstBaseUpdate=$,p.lastBaseUpdate=Z,s=p.shared.interleaved,s!==null){p=s;do w|=p.lane,p=p.next;while(p!==s)}else v===null&&(p.shared.lanes=0);ci|=w,n.lanes=w,n.memoizedState=ee}}function Tp(n,s,u){if(n=s.effects,s.effects=null,n!==null)for(s=0;su?u:4,n(!0);var d=tc.transition;tc.transition={};try{n(!1),s()}finally{Ue=u,tc.transition=d}}function Qp(){return xr().memoizedState}function wx(n,s,u){var d=Fn(n);if(u={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null},Jp(n))Zp(s,u);else if(u=Pp(n,s,u,d),u!==null){var p=Kt();Br(u,n,d,p),em(u,s,d)}}function Sx(n,s,u){var d=Fn(n),p={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null};if(Jp(n))Zp(s,p);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=s.lastRenderedReducer,v!==null))try{var w=s.lastRenderedState,N=v(w,u);if(p.hasEagerState=!0,p.eagerState=N,Rr(N,w)){var R=s.interleaved;R===null?(p.next=p,Xu(s)):(p.next=R.next,R.next=p),s.interleaved=p;return}}catch{}finally{}u=Pp(n,s,p,d),u!==null&&(p=Kt(),Br(u,n,d,p),em(u,s,d))}}function Jp(n){var s=n.alternate;return n===nt||s!==null&&s===nt}function Zp(n,s){Xs=Tl=!0;var u=n.pending;u===null?s.next=s:(s.next=u.next,u.next=s),n.pending=s}function em(n,s,u){if((u&4194240)!==0){var d=s.lanes;d&=n.pendingLanes,u|=d,s.lanes=u,cu(n,u)}}var Bl={readContext:yr,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},bx={readContext:yr,useCallback:function(n,s){return $r().memoizedState=[n,s===void 0?null:s],n},useContext:yr,useEffect:Wp,useImperativeHandle:function(n,s,u){return u=u!=null?u.concat([n]):null,Dl(4194308,4,Kp.bind(null,s,n),u)},useLayoutEffect:function(n,s){return Dl(4194308,4,n,s)},useInsertionEffect:function(n,s){return Dl(4,2,n,s)},useMemo:function(n,s){var u=$r();return s=s===void 0?null:s,n=n(),u.memoizedState=[n,s],n},useReducer:function(n,s,u){var d=$r();return s=u!==void 0?u(s):s,d.memoizedState=d.baseState=s,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:s},d.queue=n,n=n.dispatch=wx.bind(null,nt,n),[d.memoizedState,n]},useRef:function(n){var s=$r();return n={current:n},s.memoizedState=n},useState:Hp,useDebugValue:ac,useDeferredValue:function(n){return $r().memoizedState=n},useTransition:function(){var n=Hp(!1),s=n[0];return n=xx.bind(null,n[1]),$r().memoizedState=n,[s,n]},useMutableSource:function(){},useSyncExternalStore:function(n,s,u){var d=nt,p=$r();if(et){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),bt===null)throw Error(r(349));(ui&30)!==0||Ip(d,s,u)}p.memoizedState=u;var v={value:u,getSnapshot:s};return p.queue=v,Wp(zp.bind(null,d,v,n),[n]),d.flags|=2048,Js(9,jp.bind(null,d,v,u,s),void 0,null),u},useId:function(){var n=$r(),s=bt.identifierPrefix;if(et){var u=ln,d=on;u=(d&~(1<<32-Pr(d)-1)).toString(32)+u,s=":"+s+"R"+u,u=Gs++,0<\/script>",n=n.removeChild(n.firstChild)):typeof d.is=="string"?n=w.createElement(u,{is:d.is}):(n=w.createElement(u),u==="select"&&(w=n,d.multiple?w.multiple=!0:d.size&&(w.size=d.size))):n=w.createElementNS(n,u),n[Fr]=s,n[Ws]=d,xm(n,s,!1,!1),s.stateNode=n;e:{switch(w=zr(u,d),u){case"dialog":Ge("cancel",n),Ge("close",n),p=d;break;case"iframe":case"object":case"embed":Ge("load",n),p=d;break;case"video":case"audio":for(p=0;pts&&(s.flags|=128,d=!0,Zs(v,!1),s.lanes=4194304)}else{if(!d)if(n=Rl(w),n!==null){if(s.flags|=128,d=!0,u=n.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),Zs(v,!0),v.tail===null&&v.tailMode==="hidden"&&!w.alternate&&!et)return Ot(s),null}else 2*ct()-v.renderingStartTime>ts&&u!==1073741824&&(s.flags|=128,d=!0,Zs(v,!1),s.lanes=4194304);v.isBackwards?(w.sibling=s.child,s.child=w):(u=v.last,u!==null?u.sibling=w:s.child=w,v.last=w)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=ct(),s.sibling=null,u=rt.current,Xe(rt,d?u&1|2:u&1),s):(Ot(s),null);case 22:case 23:return Dc(),d=s.memoizedState!==null,n!==null&&n.memoizedState!==null!==d&&(s.flags|=8192),d&&(s.mode&1)!==0?(hr&1073741824)!==0&&(Ot(s),s.subtreeFlags&6&&(s.flags|=8192)):Ot(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function Nx(n,s){switch(Hu(s),s.tag){case 1:return Jt(s.type)&&yl(),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return Qi(),Qe(Qt),Qe(jt),ec(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 5:return Ju(s),null;case 13:if(Qe(rt),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));qi()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return Qe(rt),null;case 4:return Qi(),null;case 10:return qu(s.type._context),null;case 22:case 23:return Dc(),null;case 24:return null;default:return null}}var Ol=!1,Ft=!1,Lx=typeof WeakSet=="function"?WeakSet:Set,de=null;function Zi(n,s){var u=n.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(d){ot(n,s,d)}else u.current=null}function xc(n,s,u){try{u()}catch(d){ot(n,s,d)}}var bm=!1;function Px(n,s){if(Du=sl,n=tp(),ku(n)){if("selectionStart"in n)var u={start:n.selectionStart,end:n.selectionEnd};else e:{u=(u=n.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var w=0,N=-1,R=-1,$=0,Z=0,ee=n,J=null;t:for(;;){for(var ce;ee!==u||p!==0&&ee.nodeType!==3||(N=w+p),ee!==v||d!==0&&ee.nodeType!==3||(R=w+d),ee.nodeType===3&&(w+=ee.nodeValue.length),(ce=ee.firstChild)!==null;)J=ee,ee=ce;for(;;){if(ee===n)break t;if(J===u&&++$===p&&(N=w),J===v&&++Z===d&&(R=w),(ce=ee.nextSibling)!==null)break;ee=J,J=ee.parentNode}ee=ce}u=N===-1||R===-1?null:{start:N,end:R}}else u=null}u=u||{start:0,end:0}}else u=null;for(Tu={focusedElem:n,selectionRange:u},sl=!1,de=s;de!==null;)if(s=de,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,de=n;else for(;de!==null;){s=de;try{var pe=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var me=pe.memoizedProps,ht=pe.memoizedState,B=s.stateNode,M=B.getSnapshotBeforeUpdate(s.elementType===s.type?me:Dr(s.type,me),ht);B.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=s.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ie){ot(s,s.return,ie)}if(n=s.sibling,n!==null){n.return=s.return,de=n;break}de=s.return}return pe=bm,bm=!1,pe}function eo(n,s,u){var d=s.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&n)===n){var v=p.destroy;p.destroy=void 0,v!==void 0&&xc(s,u,v)}p=p.next}while(p!==d)}}function Fl(n,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&n)===n){var d=u.create;u.destroy=d()}u=u.next}while(u!==s)}}function wc(n){var s=n.ref;if(s!==null){var u=n.stateNode;switch(n.tag){case 5:n=u;break;default:n=u}typeof s=="function"?s(n):s.current=n}}function km(n){var s=n.alternate;s!==null&&(n.alternate=null,km(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&(delete s[Fr],delete s[Ws],delete s[ju],delete s[hx],delete s[dx])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Cm(n){return n.tag===5||n.tag===3||n.tag===4}function Em(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Cm(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Sc(n,s,u){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(n,s):u.insertBefore(n,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(n,u)):(s=u,s.appendChild(n)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=_l));else if(d!==4&&(n=n.child,n!==null))for(Sc(n,s,u),n=n.sibling;n!==null;)Sc(n,s,u),n=n.sibling}function bc(n,s,u){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?u.insertBefore(n,s):u.appendChild(n);else if(d!==4&&(n=n.child,n!==null))for(bc(n,s,u),n=n.sibling;n!==null;)bc(n,s,u),n=n.sibling}var Tt=null,Tr=!1;function Bn(n,s,u){for(u=u.child;u!==null;)Nm(n,s,u),u=u.sibling}function Nm(n,s,u){if(Or&&typeof Or.onCommitFiberUnmount=="function")try{Or.onCommitFiberUnmount(Zo,u)}catch{}switch(u.tag){case 5:Ft||Zi(u,s);case 6:var d=Tt,p=Tr;Tt=null,Bn(n,s,u),Tt=d,Tr=p,Tt!==null&&(Tr?(n=Tt,u=u.stateNode,n.nodeType===8?n.parentNode.removeChild(u):n.removeChild(u)):Tt.removeChild(u.stateNode));break;case 18:Tt!==null&&(Tr?(n=Tt,u=u.stateNode,n.nodeType===8?Iu(n.parentNode,u):n.nodeType===1&&Iu(n,u),Ds(n)):Iu(Tt,u.stateNode));break;case 4:d=Tt,p=Tr,Tt=u.stateNode.containerInfo,Tr=!0,Bn(n,s,u),Tt=d,Tr=p;break;case 0:case 11:case 14:case 15:if(!Ft&&(d=u.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var v=p,w=v.destroy;v=v.tag,w!==void 0&&((v&2)!==0||(v&4)!==0)&&xc(u,s,w),p=p.next}while(p!==d)}Bn(n,s,u);break;case 1:if(!Ft&&(Zi(u,s),d=u.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=u.memoizedProps,d.state=u.memoizedState,d.componentWillUnmount()}catch(N){ot(u,s,N)}Bn(n,s,u);break;case 21:Bn(n,s,u);break;case 22:u.mode&1?(Ft=(d=Ft)||u.memoizedState!==null,Bn(n,s,u),Ft=d):Bn(n,s,u);break;default:Bn(n,s,u)}}function Lm(n){var s=n.updateQueue;if(s!==null){n.updateQueue=null;var u=n.stateNode;u===null&&(u=n.stateNode=new Lx),s.forEach(function(d){var p=zx.bind(null,n,d);u.has(d)||(u.add(d),d.then(p,p))})}}function Ar(n,s){var u=s.deletions;if(u!==null)for(var d=0;dp&&(p=w),d&=~v}if(d=p,d=ct()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Mx(d/1960))-d,10n?16:n,jn===null)var d=!1;else{if(n=jn,jn=null,Vl=0,($e&6)!==0)throw Error(r(331));var p=$e;for($e|=4,de=n.current;de!==null;){var v=de,w=v.child;if((de.flags&16)!==0){var N=v.deletions;if(N!==null){for(var R=0;Rct()-Ec?hi(n,0):Cc|=u),tr(n,s)}function Hm(n,s){s===0&&((n.mode&1)===0?s=1:(s=tl,tl<<=1,(tl&130023424)===0&&(tl=4194304)));var u=Kt();n=ln(n,s),n!==null&&(Ns(n,s,u),tr(n,u))}function jx(n){var s=n.memoizedState,u=0;s!==null&&(u=s.retryLane),Hm(n,u)}function zx(n,s){var u=0;switch(n.tag){case 13:var d=n.stateNode,p=n.memoizedState;p!==null&&(u=p.retryLane);break;case 19:d=n.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(s),Hm(n,u)}var $m;$m=function(n,s,u){if(n!==null)if(n.memoizedProps!==s.pendingProps||Qt.current)Zt=!0;else{if((n.lanes&u)===0&&(s.flags&128)===0)return Zt=!1,Cx(n,s,u);Zt=(n.flags&131072)!==0}else Zt=!1,et&&(s.flags&1048576)!==0&&wp(s,bl,s.index);switch(s.lanes=0,s.tag){case 2:var d=s.type;zl(n,s),n=s.pendingProps;var p=Ui(s,jt.current);Gi(s,u),p=nc(null,s,d,n,p,u);var v=ic();return s.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Jt(d)?(v=!0,xl(s)):v=!1,s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Gu(s),p.updater=Il,s.stateNode=p,p._reactInternals=s,cc(s,d,n,u),s=pc(null,s,d,!0,v,u)):(s.tag=0,et&&v&&Fu(s),Vt(null,s,p,u),s=s.child),s;case 16:d=s.elementType;e:{switch(zl(n,s),n=s.pendingProps,p=d._init,d=p(d._payload),s.type=d,p=s.tag=Fx(d),n=Dr(d,n),p){case 0:s=fc(null,s,d,n,u);break e;case 1:s=pm(null,s,d,n,u);break e;case 11:s=um(null,s,d,n,u);break e;case 14:s=cm(null,s,d,Dr(d.type,n),u);break e}throw Error(r(306,d,""))}return s;case 0:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Dr(d,p),fc(n,s,d,p,u);case 1:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Dr(d,p),pm(n,s,d,p,u);case 3:e:{if(mm(s),n===null)throw Error(r(387));d=s.pendingProps,v=s.memoizedState,p=v.element,Rp(n,s),Pl(s,d,null,u);var w=s.memoizedState;if(d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=v,s.memoizedState=v,s.flags&256){p=Ji(Error(r(423)),s),s=gm(n,s,d,u,p);break e}else if(d!==p){p=Ji(Error(r(424)),s),s=gm(n,s,d,u,p);break e}else for(cr=Pn(s.stateNode.containerInfo.firstChild),ur=s,et=!0,Mr=null,u=Lp(s,null,d,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(qi(),d===p){s=un(n,s,u);break e}Vt(n,s,d,u)}s=s.child}return s;case 5:return Tp(s),n===null&&Wu(s),d=s.type,p=s.pendingProps,v=n!==null?n.memoizedProps:null,w=p.children,Au(d,p)?w=null:v!==null&&Au(d,v)&&(s.flags|=32),fm(n,s),Vt(n,s,w,u),s.child;case 6:return n===null&&Wu(s),null;case 13:return _m(n,s,u);case 4:return Qu(s,s.stateNode.containerInfo),d=s.pendingProps,n===null?s.child=Yi(s,null,d,u):Vt(n,s,d,u),s.child;case 11:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Dr(d,p),um(n,s,d,p,u);case 7:return Vt(n,s,s.pendingProps,u),s.child;case 8:return Vt(n,s,s.pendingProps.children,u),s.child;case 12:return Vt(n,s,s.pendingProps.children,u),s.child;case 10:e:{if(d=s.type._context,p=s.pendingProps,v=s.memoizedProps,w=p.value,Xe(El,d._currentValue),d._currentValue=w,v!==null)if(Rr(v.value,w)){if(v.children===p.children&&!Qt.current){s=un(n,s,u);break e}}else for(v=s.child,v!==null&&(v.return=s);v!==null;){var N=v.dependencies;if(N!==null){w=v.child;for(var R=N.firstContext;R!==null;){if(R.context===d){if(v.tag===1){R=an(-1,u&-u),R.tag=2;var $=v.updateQueue;if($!==null){$=$.shared;var Z=$.pending;Z===null?R.next=R:(R.next=Z.next,Z.next=R),$.pending=R}}v.lanes|=u,R=v.alternate,R!==null&&(R.lanes|=u),Yu(v.return,u,s),N.lanes|=u;break}R=R.next}}else if(v.tag===10)w=v.type===s.type?null:v.child;else if(v.tag===18){if(w=v.return,w===null)throw Error(r(341));w.lanes|=u,N=w.alternate,N!==null&&(N.lanes|=u),Yu(w,u,s),w=v.sibling}else w=v.child;if(w!==null)w.return=v;else for(w=v;w!==null;){if(w===s){w=null;break}if(v=w.sibling,v!==null){v.return=w.return,w=v;break}w=w.return}v=w}Vt(n,s,p.children,u),s=s.child}return s;case 9:return p=s.type,d=s.pendingProps.children,Gi(s,u),p=yr(p),d=d(p),s.flags|=1,Vt(n,s,d,u),s.child;case 14:return d=s.type,p=Dr(d,s.pendingProps),p=Dr(d.type,p),cm(n,s,d,p,u);case 15:return hm(n,s,s.type,s.pendingProps,u);case 17:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Dr(d,p),zl(n,s),s.tag=1,Jt(d)?(n=!0,xl(s)):n=!1,Gi(s,u),rm(s,d,p),cc(s,d,p,u),pc(null,s,d,!0,n,u);case 19:return ym(n,s,u);case 22:return dm(n,s,u)}throw Error(r(156,s.tag))};function Wm(n,s){return Sf(n,s)}function Ox(n,s,u,d){this.tag=n,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(n,s,u,d){return new Ox(n,s,u,d)}function Ac(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Fx(n){if(typeof n=="function")return Ac(n)?1:0;if(n!=null){if(n=n.$$typeof,n===T)return 11;if(n===j)return 14}return 2}function Fn(n,s){var u=n.alternate;return u===null?(u=Sr(n.tag,s,n.key,n.mode),u.elementType=n.elementType,u.type=n.type,u.stateNode=n.stateNode,u.alternate=n,n.alternate=u):(u.pendingProps=s,u.type=n.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=n.flags&14680064,u.childLanes=n.childLanes,u.lanes=n.lanes,u.child=n.child,u.memoizedProps=n.memoizedProps,u.memoizedState=n.memoizedState,u.updateQueue=n.updateQueue,s=n.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=n.sibling,u.index=n.index,u.ref=n.ref,u}function Xl(n,s,u,d,p,v){var w=2;if(d=n,typeof n=="function")Ac(n)&&(w=1);else if(typeof n=="string")w=5;else e:switch(n){case le:return fi(u.children,p,v,s);case he:w=8,p|=8;break;case ge:return n=Sr(12,u,s,p|2),n.elementType=ge,n.lanes=v,n;case D:return n=Sr(13,u,s,p),n.elementType=D,n.lanes=v,n;case H:return n=Sr(19,u,s,p),n.elementType=H,n.lanes=v,n;case re:return Gl(u,p,v,s);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case F:w=10;break e;case V:w=9;break e;case T:w=11;break e;case j:w=14;break e;case G:w=16,d=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return s=Sr(w,u,s,p),s.elementType=n,s.type=d,s.lanes=v,s}function fi(n,s,u,d){return n=Sr(7,n,d,s),n.lanes=u,n}function Gl(n,s,u,d){return n=Sr(22,n,d,s),n.elementType=re,n.lanes=u,n.stateNode={isHidden:!1},n}function Bc(n,s,u){return n=Sr(6,n,null,s),n.lanes=u,n}function Ic(n,s,u){return s=Sr(4,n.children!==null?n.children:[],n.key,s),s.lanes=u,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}function Hx(n,s,u,d,p){this.tag=s,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uu(0),this.expirationTimes=uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function jc(n,s,u,d,p,v,w,N,R){return n=new Hx(n,s,u,N,R),s===1?(s=1,v===!0&&(s|=8)):s=0,v=Sr(3,null,null,s),n.current=v,v.stateNode=n,v.memoizedState={element:d,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gu(v),n}function $x(n,s,u){var d=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wc.exports=ew(),Wc.exports}var ng;function rw(){if(ng)return na;ng=1;var e=tw();return na.createRoot=e.createRoot,na.hydrateRoot=e.hydrateRoot,na}var nw=rw();const iw=Ha(nw);/** +`+v.stack}return{value:n,source:s,stack:p,digest:null}}function hc(n,s,u){return{value:n,source:null,stack:u??null,digest:s??null}}function dc(n,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var Ex=typeof WeakMap=="function"?WeakMap:Map;function im(n,s,u){u=un(-1,u),u.tag=3,u.payload={element:null};var d=s.value;return u.callback=function(){Wl||(Wl=!0,Nc=d),dc(n,s)},u}function sm(n,s,u){u=un(-1,u),u.tag=3;var d=n.type.getDerivedStateFromError;if(typeof d=="function"){var p=s.value;u.payload=function(){return d(p)},u.callback=function(){dc(n,s)}}var v=n.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(u.callback=function(){dc(n,s),typeof d!="function"&&(zn===null?zn=new Set([this]):zn.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})}),u}function om(n,s,u){var d=n.pingCache;if(d===null){d=n.pingCache=new Ex;var p=new Set;d.set(s,p)}else p=d.get(s),p===void 0&&(p=new Set,d.set(s,p));p.has(u)||(p.add(u),n=Fx.bind(null,n,s,u),s.then(n,n))}function lm(n){do{var s;if((s=n.tag===13)&&(s=n.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return n;n=n.return}while(n!==null);return null}function am(n,s,u,d,p){return(n.mode&1)===0?(n===s?n.flags|=65536:(n.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=un(-1,1),s.tag=2,In(u,s,1))),u.lanes|=1),n):(n.flags|=65536,n.lanes=p,n)}var Nx=Y.ReactCurrentOwner,Zt=!1;function Vt(n,s,u,d){s.child=n===null?Lp(s,null,u,d):Yi(s,n.child,u,d)}function um(n,s,u,d,p){u=u.render;var v=s.ref;return Gi(s,p),d=nc(n,s,u,d,v,p),u=ic(),n!==null&&!Zt?(s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~p,cn(n,s,p)):(et&&u&&Fu(s),s.flags|=1,Vt(n,s,d,p),s.child)}function cm(n,s,u,d,p){if(n===null){var v=u.type;return typeof v=="function"&&!Ac(v)&&v.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=v,hm(n,s,v,d,p)):(n=Xl(u.type,null,d,s,s.mode,p),n.ref=s.ref,n.return=s,s.child=n)}if(v=n.child,(n.lanes&p)===0){var w=v.memoizedProps;if(u=u.compare,u=u!==null?u:zs,u(w,d)&&n.ref===s.ref)return cn(n,s,p)}return s.flags|=1,n=$n(v,d),n.ref=s.ref,n.return=s,s.child=n}function hm(n,s,u,d,p){if(n!==null){var v=n.memoizedProps;if(zs(v,d)&&n.ref===s.ref)if(Zt=!1,s.pendingProps=d=v,(n.lanes&p)!==0)(n.flags&131072)!==0&&(Zt=!0);else return s.lanes=n.lanes,cn(n,s,p)}return fc(n,s,u,d,p)}function dm(n,s,u){var d=s.pendingProps,p=d.children,v=n!==null?n.memoizedState:null;if(d.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(es,hr),hr|=u;else{if((u&1073741824)===0)return n=v!==null?v.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:n,cachePool:null,transitions:null},s.updateQueue=null,Xe(es,hr),hr|=n,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=v!==null?v.baseLanes:u,Xe(es,hr),hr|=d}else v!==null?(d=v.baseLanes|u,s.memoizedState=null):d=u,Xe(es,hr),hr|=d;return Vt(n,s,p,u),s.child}function fm(n,s){var u=s.ref;(n===null&&u!==null||n!==null&&n.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function fc(n,s,u,d,p){var v=Jt(u)?ii:jt.current;return v=Ui(s,v),Gi(s,p),u=nc(n,s,u,d,v,p),d=ic(),n!==null&&!Zt?(s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~p,cn(n,s,p)):(et&&d&&Fu(s),s.flags|=1,Vt(n,s,u,p),s.child)}function pm(n,s,u,d,p){if(Jt(u)){var v=!0;xl(s)}else v=!1;if(Gi(s,p),s.stateNode===null)zl(n,s),rm(s,u,d),cc(s,u,d,p),d=!0;else if(n===null){var w=s.stateNode,N=s.memoizedProps;w.props=N;var R=w.context,$=u.contextType;typeof $=="object"&&$!==null?$=yr($):($=Jt(u)?ii:jt.current,$=Ui(s,$));var Z=u.getDerivedStateFromProps,ee=typeof Z=="function"||typeof w.getSnapshotBeforeUpdate=="function";ee||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==d||R!==$)&&nm(s,w,d,$),Bn=!1;var J=s.memoizedState;w.state=J,Pl(s,d,w,p),R=s.memoizedState,N!==d||J!==R||Qt.current||Bn?(typeof Z=="function"&&(uc(s,u,Z,d),R=s.memoizedState),(N=Bn||tm(s,u,N,d,J,R,$))?(ee||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=R),w.props=d,w.state=R,w.context=$,d=N):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{w=s.stateNode,Rp(n,s),N=s.memoizedProps,$=s.type===s.elementType?N:Tr(s.type,N),w.props=$,ee=s.pendingProps,J=w.context,R=u.contextType,typeof R=="object"&&R!==null?R=yr(R):(R=Jt(u)?ii:jt.current,R=Ui(s,R));var ce=u.getDerivedStateFromProps;(Z=typeof ce=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==ee||J!==R)&&nm(s,w,d,R),Bn=!1,J=s.memoizedState,w.state=J,Pl(s,d,w,p);var me=s.memoizedState;N!==ee||J!==me||Qt.current||Bn?(typeof ce=="function"&&(uc(s,u,ce,d),me=s.memoizedState),($=Bn||tm(s,u,$,d,J,me,R)||!1)?(Z||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(d,me,R),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(d,me,R)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===n.memoizedProps&&J===n.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===n.memoizedProps&&J===n.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=me),w.props=d,w.state=me,w.context=R,d=$):(typeof w.componentDidUpdate!="function"||N===n.memoizedProps&&J===n.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===n.memoizedProps&&J===n.memoizedState||(s.flags|=1024),d=!1)}return pc(n,s,u,d,v,p)}function pc(n,s,u,d,p,v){fm(n,s);var w=(s.flags&128)!==0;if(!d&&!w)return p&&yp(s,u,!1),cn(n,s,v);d=s.stateNode,Nx.current=s;var N=w&&typeof u.getDerivedStateFromError!="function"?null:d.render();return s.flags|=1,n!==null&&w?(s.child=Yi(s,n.child,null,v),s.child=Yi(s,null,N,v)):Vt(n,s,N,v),s.memoizedState=d.state,p&&yp(s,u,!0),s.child}function mm(n){var s=n.stateNode;s.pendingContext?_p(n,s.pendingContext,s.pendingContext!==s.context):s.context&&_p(n,s.context,!1),Qu(n,s.containerInfo)}function gm(n,s,u,d,p){return qi(),Uu(p),s.flags|=256,Vt(n,s,u,d),s.child}var mc={dehydrated:null,treeContext:null,retryLane:0};function gc(n){return{baseLanes:n,cachePool:null,transitions:null}}function _m(n,s,u){var d=s.pendingProps,p=rt.current,v=!1,w=(s.flags&128)!==0,N;if((N=w)||(N=n!==null&&n.memoizedState===null?!1:(p&2)!==0),N?(v=!0,s.flags&=-129):(n===null||n.memoizedState!==null)&&(p|=1),Xe(rt,p&1),n===null)return Wu(s),n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((s.mode&1)===0?s.lanes=1:n.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(w=d.children,n=d.fallback,v?(d=s.mode,v=s.child,w={mode:"hidden",children:w},(d&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=w):v=Gl(w,d,0,null),n=pi(n,d,u,null),v.return=s,n.return=s,v.sibling=n,s.child=v,s.child.memoizedState=gc(u),s.memoizedState=mc,n):_c(s,w));if(p=n.memoizedState,p!==null&&(N=p.dehydrated,N!==null))return Lx(n,s,w,d,N,p,u);if(v){v=d.fallback,w=s.mode,p=n.child,N=p.sibling;var R={mode:"hidden",children:d.children};return(w&1)===0&&s.child!==p?(d=s.child,d.childLanes=0,d.pendingProps=R,s.deletions=null):(d=$n(p,R),d.subtreeFlags=p.subtreeFlags&14680064),N!==null?v=$n(N,v):(v=pi(v,w,u,null),v.flags|=2),v.return=s,d.return=s,d.sibling=v,s.child=d,d=v,v=s.child,w=n.child.memoizedState,w=w===null?gc(u):{baseLanes:w.baseLanes|u,cachePool:null,transitions:w.transitions},v.memoizedState=w,v.childLanes=n.childLanes&~u,s.memoizedState=mc,d}return v=n.child,n=v.sibling,d=$n(v,{mode:"visible",children:d.children}),(s.mode&1)===0&&(d.lanes=u),d.return=s,d.sibling=null,n!==null&&(u=s.deletions,u===null?(s.deletions=[n],s.flags|=16):u.push(n)),s.child=d,s.memoizedState=null,d}function _c(n,s){return s=Gl({mode:"visible",children:s},n.mode,0,null),s.return=n,n.child=s}function jl(n,s,u,d){return d!==null&&Uu(d),Yi(s,n.child,null,u),n=_c(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function Lx(n,s,u,d,p,v,w){if(u)return s.flags&256?(s.flags&=-257,d=hc(Error(r(422))),jl(n,s,w,d)):s.memoizedState!==null?(s.child=n.child,s.flags|=128,null):(v=d.fallback,p=s.mode,d=Gl({mode:"visible",children:d.children},p,0,null),v=pi(v,p,w,null),v.flags|=2,d.return=s,v.return=s,d.sibling=v,s.child=d,(s.mode&1)!==0&&Yi(s,n.child,null,w),s.child.memoizedState=gc(w),s.memoizedState=mc,v);if((s.mode&1)===0)return jl(n,s,w,null);if(p.data==="$!"){if(d=p.nextSibling&&p.nextSibling.dataset,d)var N=d.dgst;return d=N,v=Error(r(419)),d=hc(v,d,void 0),jl(n,s,w,d)}if(N=(w&n.childLanes)!==0,Zt||N){if(d=bt,d!==null){switch(w&-w){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(d.suspendedLanes|w))!==0?0:p,p!==0&&p!==v.retryLane&&(v.retryLane=p,an(n,p),Br(d,n,p,-1))}return Dc(),d=hc(Error(r(421))),jl(n,s,w,d)}return p.data==="$?"?(s.flags|=128,s.child=n.child,s=Hx.bind(null,n),p._reactRetry=s,null):(n=v.treeContext,cr=Mn(p.nextSibling),ur=s,et=!0,Mr=null,n!==null&&(_r[vr++]=on,_r[vr++]=ln,_r[vr++]=si,on=n.id,ln=n.overflow,si=s),s=_c(s,d.children),s.flags|=4096,s)}function vm(n,s,u){n.lanes|=s;var d=n.alternate;d!==null&&(d.lanes|=s),Yu(n.return,s,u)}function vc(n,s,u,d,p){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:p}:(v.isBackwards=s,v.rendering=null,v.renderingStartTime=0,v.last=d,v.tail=u,v.tailMode=p)}function ym(n,s,u){var d=s.pendingProps,p=d.revealOrder,v=d.tail;if(Vt(n,s,d.children,u),d=rt.current,(d&2)!==0)d=d&1|2,s.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&vm(n,u,s);else if(n.tag===19)vm(n,u,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}d&=1}if(Xe(rt,d),(s.mode&1)===0)s.memoizedState=null;else switch(p){case"forwards":for(u=s.child,p=null;u!==null;)n=u.alternate,n!==null&&Rl(n)===null&&(p=u),u=u.sibling;u=p,u===null?(p=s.child,s.child=null):(p=u.sibling,u.sibling=null),vc(s,!1,p,u,v);break;case"backwards":for(u=null,p=s.child,s.child=null;p!==null;){if(n=p.alternate,n!==null&&Rl(n)===null){s.child=p;break}n=p.sibling,p.sibling=u,u=p,p=n}vc(s,!0,u,null,v);break;case"together":vc(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function zl(n,s){(s.mode&1)===0&&n!==null&&(n.alternate=null,s.alternate=null,s.flags|=2)}function cn(n,s,u){if(n!==null&&(s.dependencies=n.dependencies),ci|=s.lanes,(u&s.childLanes)===0)return null;if(n!==null&&s.child!==n.child)throw Error(r(153));if(s.child!==null){for(n=s.child,u=$n(n,n.pendingProps),s.child=u,u.return=s;n.sibling!==null;)n=n.sibling,u=u.sibling=$n(n,n.pendingProps),u.return=s;u.sibling=null}return s.child}function Px(n,s,u){switch(s.tag){case 3:mm(s),qi();break;case 5:Dp(s);break;case 1:Jt(s.type)&&xl(s);break;case 4:Qu(s,s.stateNode.containerInfo);break;case 10:var d=s.type._context,p=s.memoizedProps.value;Xe(El,d._currentValue),d._currentValue=p;break;case 13:if(d=s.memoizedState,d!==null)return d.dehydrated!==null?(Xe(rt,rt.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?_m(n,s,u):(Xe(rt,rt.current&1),n=cn(n,s,u),n!==null?n.sibling:null);Xe(rt,rt.current&1);break;case 19:if(d=(u&s.childLanes)!==0,(n.flags&128)!==0){if(d)return ym(n,s,u);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Xe(rt,rt.current),d)break;return null;case 22:case 23:return s.lanes=0,dm(n,s,u)}return cn(n,s,u)}var xm,yc,wm,Sm;xm=function(n,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)n.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},yc=function(){},wm=function(n,s,u,d){var p=n.memoizedProps;if(p!==d){n=s.stateNode,ai(Hr.current);var v=null;switch(u){case"input":p=tn(n,p),d=tn(n,d),v=[];break;case"select":p=b({},p,{value:void 0}),d=b({},d,{value:void 0}),v=[];break;case"textarea":p=Ss(n,p),d=Ss(n,d),v=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(n.onclick=_l)}Tt(u,d);var w;u=null;for($ in p)if(!d.hasOwnProperty($)&&p.hasOwnProperty($)&&p[$]!=null)if($==="style"){var N=p[$];for(w in N)N.hasOwnProperty(w)&&(u||(u={}),u[w]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(o.hasOwnProperty($)?v||(v=[]):(v=v||[]).push($,null));for($ in d){var R=d[$];if(N=p!=null?p[$]:void 0,d.hasOwnProperty($)&&R!==N&&(R!=null||N!=null))if($==="style")if(N){for(w in N)!N.hasOwnProperty(w)||R&&R.hasOwnProperty(w)||(u||(u={}),u[w]="");for(w in R)R.hasOwnProperty(w)&&N[w]!==R[w]&&(u||(u={}),u[w]=R[w])}else u||(v||(v=[]),v.push($,u)),u=R;else $==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,N=N?N.__html:void 0,R!=null&&N!==R&&(v=v||[]).push($,R)):$==="children"?typeof R!="string"&&typeof R!="number"||(v=v||[]).push($,""+R):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(o.hasOwnProperty($)?(R!=null&&$==="onScroll"&&Ge("scroll",n),v||N===R||(v=[])):(v=v||[]).push($,R))}u&&(v=v||[]).push("style",u);var $=v;(s.updateQueue=$)&&(s.flags|=4)}},Sm=function(n,s,u,d){u!==d&&(s.flags|=4)};function Zs(n,s){if(!et)switch(n.tailMode){case"hidden":s=n.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?n.tail=null:u.sibling=null;break;case"collapsed":u=n.tail;for(var d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function Ot(n){var s=n.alternate!==null&&n.alternate.child===n.child,u=0,d=0;if(s)for(var p=n.child;p!==null;)u|=p.lanes|p.childLanes,d|=p.subtreeFlags&14680064,d|=p.flags&14680064,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)u|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=d,n.childLanes=u,s}function Rx(n,s,u){var d=s.pendingProps;switch(Hu(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(s),null;case 1:return Jt(s.type)&&yl(),Ot(s),null;case 3:return d=s.stateNode,Qi(),Qe(Qt),Qe(jt),ec(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(n===null||n.child===null)&&(kl(s)?s.flags|=4:n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Mr!==null&&(Rc(Mr),Mr=null))),yc(n,s),Ot(s),null;case 5:Ju(s);var p=ai(Ys.current);if(u=s.type,n!==null&&s.stateNode!=null)wm(n,s,u,d,p),n.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!d){if(s.stateNode===null)throw Error(r(166));return Ot(s),null}if(n=ai(Hr.current),kl(s)){d=s.stateNode,u=s.type;var v=s.memoizedProps;switch(d[Fr]=s,d[Ws]=v,n=(s.mode&1)!==0,u){case"dialog":Ge("cancel",d),Ge("close",d);break;case"iframe":case"object":case"embed":Ge("load",d);break;case"video":case"audio":for(p=0;p<\/script>",n=n.removeChild(n.firstChild)):typeof d.is=="string"?n=w.createElement(u,{is:d.is}):(n=w.createElement(u),u==="select"&&(w=n,d.multiple?w.multiple=!0:d.size&&(w.size=d.size))):n=w.createElementNS(n,u),n[Fr]=s,n[Ws]=d,xm(n,s,!1,!1),s.stateNode=n;e:{switch(w=zr(u,d),u){case"dialog":Ge("cancel",n),Ge("close",n),p=d;break;case"iframe":case"object":case"embed":Ge("load",n),p=d;break;case"video":case"audio":for(p=0;pts&&(s.flags|=128,d=!0,Zs(v,!1),s.lanes=4194304)}else{if(!d)if(n=Rl(w),n!==null){if(s.flags|=128,d=!0,u=n.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),Zs(v,!0),v.tail===null&&v.tailMode==="hidden"&&!w.alternate&&!et)return Ot(s),null}else 2*ct()-v.renderingStartTime>ts&&u!==1073741824&&(s.flags|=128,d=!0,Zs(v,!1),s.lanes=4194304);v.isBackwards?(w.sibling=s.child,s.child=w):(u=v.last,u!==null?u.sibling=w:s.child=w,v.last=w)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=ct(),s.sibling=null,u=rt.current,Xe(rt,d?u&1|2:u&1),s):(Ot(s),null);case 22:case 23:return Tc(),d=s.memoizedState!==null,n!==null&&n.memoizedState!==null!==d&&(s.flags|=8192),d&&(s.mode&1)!==0?(hr&1073741824)!==0&&(Ot(s),s.subtreeFlags&6&&(s.flags|=8192)):Ot(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function Mx(n,s){switch(Hu(s),s.tag){case 1:return Jt(s.type)&&yl(),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return Qi(),Qe(Qt),Qe(jt),ec(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 5:return Ju(s),null;case 13:if(Qe(rt),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(r(340));qi()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return Qe(rt),null;case 4:return Qi(),null;case 10:return qu(s.type._context),null;case 22:case 23:return Tc(),null;case 24:return null;default:return null}}var Ol=!1,Ft=!1,Tx=typeof WeakSet=="function"?WeakSet:Set,de=null;function Zi(n,s){var u=n.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(d){ot(n,s,d)}else u.current=null}function xc(n,s,u){try{u()}catch(d){ot(n,s,d)}}var bm=!1;function Dx(n,s){if(Tu=sl,n=tp(),ku(n)){if("selectionStart"in n)var u={start:n.selectionStart,end:n.selectionEnd};else e:{u=(u=n.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var w=0,N=-1,R=-1,$=0,Z=0,ee=n,J=null;t:for(;;){for(var ce;ee!==u||p!==0&&ee.nodeType!==3||(N=w+p),ee!==v||d!==0&&ee.nodeType!==3||(R=w+d),ee.nodeType===3&&(w+=ee.nodeValue.length),(ce=ee.firstChild)!==null;)J=ee,ee=ce;for(;;){if(ee===n)break t;if(J===u&&++$===p&&(N=w),J===v&&++Z===d&&(R=w),(ce=ee.nextSibling)!==null)break;ee=J,J=ee.parentNode}ee=ce}u=N===-1||R===-1?null:{start:N,end:R}}else u=null}u=u||{start:0,end:0}}else u=null;for(Du={focusedElem:n,selectionRange:u},sl=!1,de=s;de!==null;)if(s=de,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,de=n;else for(;de!==null;){s=de;try{var me=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(me!==null){var ge=me.memoizedProps,ht=me.memoizedState,B=s.stateNode,M=B.getSnapshotBeforeUpdate(s.elementType===s.type?ge:Tr(s.type,ge),ht);B.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=s.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ie){ot(s,s.return,ie)}if(n=s.sibling,n!==null){n.return=s.return,de=n;break}de=s.return}return me=bm,bm=!1,me}function eo(n,s,u){var d=s.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&n)===n){var v=p.destroy;p.destroy=void 0,v!==void 0&&xc(s,u,v)}p=p.next}while(p!==d)}}function Fl(n,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&n)===n){var d=u.create;u.destroy=d()}u=u.next}while(u!==s)}}function wc(n){var s=n.ref;if(s!==null){var u=n.stateNode;switch(n.tag){case 5:n=u;break;default:n=u}typeof s=="function"?s(n):s.current=n}}function km(n){var s=n.alternate;s!==null&&(n.alternate=null,km(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&(delete s[Fr],delete s[Ws],delete s[ju],delete s[mx],delete s[gx])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Cm(n){return n.tag===5||n.tag===3||n.tag===4}function Em(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Cm(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Sc(n,s,u){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(n,s):u.insertBefore(n,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(n,u)):(s=u,s.appendChild(n)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=_l));else if(d!==4&&(n=n.child,n!==null))for(Sc(n,s,u),n=n.sibling;n!==null;)Sc(n,s,u),n=n.sibling}function bc(n,s,u){var d=n.tag;if(d===5||d===6)n=n.stateNode,s?u.insertBefore(n,s):u.appendChild(n);else if(d!==4&&(n=n.child,n!==null))for(bc(n,s,u),n=n.sibling;n!==null;)bc(n,s,u),n=n.sibling}var Dt=null,Dr=!1;function jn(n,s,u){for(u=u.child;u!==null;)Nm(n,s,u),u=u.sibling}function Nm(n,s,u){if(Or&&typeof Or.onCommitFiberUnmount=="function")try{Or.onCommitFiberUnmount(Zo,u)}catch{}switch(u.tag){case 5:Ft||Zi(u,s);case 6:var d=Dt,p=Dr;Dt=null,jn(n,s,u),Dt=d,Dr=p,Dt!==null&&(Dr?(n=Dt,u=u.stateNode,n.nodeType===8?n.parentNode.removeChild(u):n.removeChild(u)):Dt.removeChild(u.stateNode));break;case 18:Dt!==null&&(Dr?(n=Dt,u=u.stateNode,n.nodeType===8?Iu(n.parentNode,u):n.nodeType===1&&Iu(n,u),Ts(n)):Iu(Dt,u.stateNode));break;case 4:d=Dt,p=Dr,Dt=u.stateNode.containerInfo,Dr=!0,jn(n,s,u),Dt=d,Dr=p;break;case 0:case 11:case 14:case 15:if(!Ft&&(d=u.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var v=p,w=v.destroy;v=v.tag,w!==void 0&&((v&2)!==0||(v&4)!==0)&&xc(u,s,w),p=p.next}while(p!==d)}jn(n,s,u);break;case 1:if(!Ft&&(Zi(u,s),d=u.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=u.memoizedProps,d.state=u.memoizedState,d.componentWillUnmount()}catch(N){ot(u,s,N)}jn(n,s,u);break;case 21:jn(n,s,u);break;case 22:u.mode&1?(Ft=(d=Ft)||u.memoizedState!==null,jn(n,s,u),Ft=d):jn(n,s,u);break;default:jn(n,s,u)}}function Lm(n){var s=n.updateQueue;if(s!==null){n.updateQueue=null;var u=n.stateNode;u===null&&(u=n.stateNode=new Tx),s.forEach(function(d){var p=$x.bind(null,n,d);u.has(d)||(u.add(d),d.then(p,p))})}}function Ar(n,s){var u=s.deletions;if(u!==null)for(var d=0;dp&&(p=w),d&=~v}if(d=p,d=ct()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Bx(d/1960))-d,10n?16:n,On===null)var d=!1;else{if(n=On,On=null,Vl=0,($e&6)!==0)throw Error(r(331));var p=$e;for($e|=4,de=n.current;de!==null;){var v=de,w=v.child;if((de.flags&16)!==0){var N=v.deletions;if(N!==null){for(var R=0;Rct()-Ec?di(n,0):Cc|=u),tr(n,s)}function Hm(n,s){s===0&&((n.mode&1)===0?s=1:(s=tl,tl<<=1,(tl&130023424)===0&&(tl=4194304)));var u=Kt();n=an(n,s),n!==null&&(Ns(n,s,u),tr(n,u))}function Hx(n){var s=n.memoizedState,u=0;s!==null&&(u=s.retryLane),Hm(n,u)}function $x(n,s){var u=0;switch(n.tag){case 13:var d=n.stateNode,p=n.memoizedState;p!==null&&(u=p.retryLane);break;case 19:d=n.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(s),Hm(n,u)}var $m;$m=function(n,s,u){if(n!==null)if(n.memoizedProps!==s.pendingProps||Qt.current)Zt=!0;else{if((n.lanes&u)===0&&(s.flags&128)===0)return Zt=!1,Px(n,s,u);Zt=(n.flags&131072)!==0}else Zt=!1,et&&(s.flags&1048576)!==0&&wp(s,bl,s.index);switch(s.lanes=0,s.tag){case 2:var d=s.type;zl(n,s),n=s.pendingProps;var p=Ui(s,jt.current);Gi(s,u),p=nc(null,s,d,n,p,u);var v=ic();return s.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Jt(d)?(v=!0,xl(s)):v=!1,s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Gu(s),p.updater=Il,s.stateNode=p,p._reactInternals=s,cc(s,d,n,u),s=pc(null,s,d,!0,v,u)):(s.tag=0,et&&v&&Fu(s),Vt(null,s,p,u),s=s.child),s;case 16:d=s.elementType;e:{switch(zl(n,s),n=s.pendingProps,p=d._init,d=p(d._payload),s.type=d,p=s.tag=Ux(d),n=Tr(d,n),p){case 0:s=fc(null,s,d,n,u);break e;case 1:s=pm(null,s,d,n,u);break e;case 11:s=um(null,s,d,n,u);break e;case 14:s=cm(null,s,d,Tr(d.type,n),u);break e}throw Error(r(306,d,""))}return s;case 0:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Tr(d,p),fc(n,s,d,p,u);case 1:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Tr(d,p),pm(n,s,d,p,u);case 3:e:{if(mm(s),n===null)throw Error(r(387));d=s.pendingProps,v=s.memoizedState,p=v.element,Rp(n,s),Pl(s,d,null,u);var w=s.memoizedState;if(d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=v,s.memoizedState=v,s.flags&256){p=Ji(Error(r(423)),s),s=gm(n,s,d,u,p);break e}else if(d!==p){p=Ji(Error(r(424)),s),s=gm(n,s,d,u,p);break e}else for(cr=Mn(s.stateNode.containerInfo.firstChild),ur=s,et=!0,Mr=null,u=Lp(s,null,d,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(qi(),d===p){s=cn(n,s,u);break e}Vt(n,s,d,u)}s=s.child}return s;case 5:return Dp(s),n===null&&Wu(s),d=s.type,p=s.pendingProps,v=n!==null?n.memoizedProps:null,w=p.children,Au(d,p)?w=null:v!==null&&Au(d,v)&&(s.flags|=32),fm(n,s),Vt(n,s,w,u),s.child;case 6:return n===null&&Wu(s),null;case 13:return _m(n,s,u);case 4:return Qu(s,s.stateNode.containerInfo),d=s.pendingProps,n===null?s.child=Yi(s,null,d,u):Vt(n,s,d,u),s.child;case 11:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Tr(d,p),um(n,s,d,p,u);case 7:return Vt(n,s,s.pendingProps,u),s.child;case 8:return Vt(n,s,s.pendingProps.children,u),s.child;case 12:return Vt(n,s,s.pendingProps.children,u),s.child;case 10:e:{if(d=s.type._context,p=s.pendingProps,v=s.memoizedProps,w=p.value,Xe(El,d._currentValue),d._currentValue=w,v!==null)if(Rr(v.value,w)){if(v.children===p.children&&!Qt.current){s=cn(n,s,u);break e}}else for(v=s.child,v!==null&&(v.return=s);v!==null;){var N=v.dependencies;if(N!==null){w=v.child;for(var R=N.firstContext;R!==null;){if(R.context===d){if(v.tag===1){R=un(-1,u&-u),R.tag=2;var $=v.updateQueue;if($!==null){$=$.shared;var Z=$.pending;Z===null?R.next=R:(R.next=Z.next,Z.next=R),$.pending=R}}v.lanes|=u,R=v.alternate,R!==null&&(R.lanes|=u),Yu(v.return,u,s),N.lanes|=u;break}R=R.next}}else if(v.tag===10)w=v.type===s.type?null:v.child;else if(v.tag===18){if(w=v.return,w===null)throw Error(r(341));w.lanes|=u,N=w.alternate,N!==null&&(N.lanes|=u),Yu(w,u,s),w=v.sibling}else w=v.child;if(w!==null)w.return=v;else for(w=v;w!==null;){if(w===s){w=null;break}if(v=w.sibling,v!==null){v.return=w.return,w=v;break}w=w.return}v=w}Vt(n,s,p.children,u),s=s.child}return s;case 9:return p=s.type,d=s.pendingProps.children,Gi(s,u),p=yr(p),d=d(p),s.flags|=1,Vt(n,s,d,u),s.child;case 14:return d=s.type,p=Tr(d,s.pendingProps),p=Tr(d.type,p),cm(n,s,d,p,u);case 15:return hm(n,s,s.type,s.pendingProps,u);case 17:return d=s.type,p=s.pendingProps,p=s.elementType===d?p:Tr(d,p),zl(n,s),s.tag=1,Jt(d)?(n=!0,xl(s)):n=!1,Gi(s,u),rm(s,d,p),cc(s,d,p,u),pc(null,s,d,!0,n,u);case 19:return ym(n,s,u);case 22:return dm(n,s,u)}throw Error(r(156,s.tag))};function Wm(n,s){return Sf(n,s)}function Wx(n,s,u,d){this.tag=n,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(n,s,u,d){return new Wx(n,s,u,d)}function Ac(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Ux(n){if(typeof n=="function")return Ac(n)?1:0;if(n!=null){if(n=n.$$typeof,n===A)return 11;if(n===j)return 14}return 2}function $n(n,s){var u=n.alternate;return u===null?(u=Sr(n.tag,s,n.key,n.mode),u.elementType=n.elementType,u.type=n.type,u.stateNode=n.stateNode,u.alternate=n,n.alternate=u):(u.pendingProps=s,u.type=n.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=n.flags&14680064,u.childLanes=n.childLanes,u.lanes=n.lanes,u.child=n.child,u.memoizedProps=n.memoizedProps,u.memoizedState=n.memoizedState,u.updateQueue=n.updateQueue,s=n.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=n.sibling,u.index=n.index,u.ref=n.ref,u}function Xl(n,s,u,d,p,v){var w=2;if(d=n,typeof n=="function")Ac(n)&&(w=1);else if(typeof n=="string")w=5;else e:switch(n){case se:return pi(u.children,p,v,s);case he:w=8,p|=8;break;case fe:return n=Sr(12,u,s,p|2),n.elementType=fe,n.lanes=v,n;case D:return n=Sr(13,u,s,p),n.elementType=D,n.lanes=v,n;case H:return n=Sr(19,u,s,p),n.elementType=H,n.lanes=v,n;case re:return Gl(u,p,v,s);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case F:w=10;break e;case K:w=9;break e;case A:w=11;break e;case j:w=14;break e;case Q:w=16,d=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return s=Sr(w,u,s,p),s.elementType=n,s.type=d,s.lanes=v,s}function pi(n,s,u,d){return n=Sr(7,n,d,s),n.lanes=u,n}function Gl(n,s,u,d){return n=Sr(22,n,d,s),n.elementType=re,n.lanes=u,n.stateNode={isHidden:!1},n}function Bc(n,s,u){return n=Sr(6,n,null,s),n.lanes=u,n}function Ic(n,s,u){return s=Sr(4,n.children!==null?n.children:[],n.key,s),s.lanes=u,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}function Vx(n,s,u,d,p){this.tag=s,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uu(0),this.expirationTimes=uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function jc(n,s,u,d,p,v,w,N,R){return n=new Vx(n,s,u,N,R),s===1?(s=1,v===!0&&(s|=8)):s=0,v=Sr(3,null,null,s),n.current=v,v.stateNode=n,v.memoizedState={element:d,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gu(v),n}function Kx(n,s,u){var d=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wc.exports=iw(),Wc.exports}var ng;function ow(){if(ng)return na;ng=1;var e=sw();return na.createRoot=e.createRoot,na.hydrateRoot=e.hydrateRoot,na}var lw=ow();const aw=Ha(lw);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fv=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();/** + */const uw=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mv=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var ow={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var cw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lw=te.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:l,iconNode:a,...c},f)=>te.createElement("svg",{ref:f,...ow,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:fv("lucide",o),...c},[...a.map(([h,g])=>te.createElement(h,g)),...Array.isArray(l)?l:[l]]));/** + */const hw=te.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:l,iconNode:a,...c},f)=>te.createElement("svg",{ref:f,...cw,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:mv("lucide",o),...c},[...a.map(([h,g])=>te.createElement(h,g)),...Array.isArray(l)?l:[l]]));/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pe=(e,t)=>{const r=te.forwardRef(({className:i,...o},l)=>te.createElement(lw,{ref:l,iconNode:t,className:fv(`lucide-${sw(e)}`,i),...o}));return r.displayName=`${e}`,r};/** + */const Le=(e,t)=>{const r=te.forwardRef(({className:i,...o},l)=>te.createElement(hw,{ref:l,iconNode:t,className:mv(`lucide-${uw(e)}`,i),...o}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pv=Pe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + */const gv=Le("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aw=Pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const dw=Le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $a=Pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const $a=Le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mv=Pe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const _v=Le("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uw=Pe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + */const fw=Le("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gn=Pe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const vn=Le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cw=Pe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const pw=Le("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hw=Pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const mw=Le("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gv=Pe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const vv=Le("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wa=Pe("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/** + */const Wa=Le("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dw=Pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const gw=Le("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fw=Pe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + */const _w=Le("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kd=Pe("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/** + */const kd=Le("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _v=Pe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const yv=Le("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vv=Pe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const xv=Le("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pw=Pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const vw=Le("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yv=Pe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + */const wv=Le("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xv=Pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const Sv=Le("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mw=Pe("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** + */const yw=Le("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gw=Pe("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** + */const xw=Le("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wv=Pe("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** + */const bv=Le("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Na=Pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const Na=Le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const La=Pe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + */const La=Le("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _w=Pe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const ww=Le("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vw=Pe("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + */const Sw=Le("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yw=Pe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** + */const bw=Le("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xw=Pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** + */const kw=Le("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ww=Pe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const Cw=Le("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sw=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const kv=Le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ua=Pe("Radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]);/** + */const Ua=Le("Radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sv=Pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const Cv=Le("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bv=Pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const Ev=Le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cd=Pe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + */const Cd=Le("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kv=Pe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Nv=Le("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bw=Pe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** + */const Ew=Le("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kw=Pe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const Nw=Le("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ki=Pe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + */const ki=Le("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cw=Pe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + */const Lw=Le("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ew=Pe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + */const Pw=Le("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nw=Pe("TableProperties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** + */const Rw=Le("TableProperties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cv=Pe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const Lv=Le("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pa=Pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const Mw=Le("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jo=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ev(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,sg=Nv,Lv=(e,t)=>r=>{var i;if((t==null?void 0:t.variants)==null)return sg(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:l}=t,a=Object.keys(o).map(h=>{const g=r==null?void 0:r[h],m=l==null?void 0:l[h];if(g===null)return null;const x=ig(g)||ig(m);return o[h][x]}),c=r&&Object.entries(r).reduce((h,g)=>{let[m,x]=g;return x===void 0||(h[m]=x),h},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,g)=>{let{class:m,className:x,...y}=g;return Object.entries(y).every(S=>{let[k,E]=S;return Array.isArray(E)?E.includes({...l,...c}[k]):{...l,...c}[k]===E})?[...h,m,x]:h},[]);return sg(e,a,f,r==null?void 0:r.class,r==null?void 0:r.className)},Ed="-",Lw=e=>{const t=Rw(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:a=>{const c=a.split(Ed);return c[0]===""&&c.length!==1&&c.shift(),Pv(c,t)||Pw(a)},getConflictingClassGroupIds:(a,c)=>{const f=r[a]||[];return c&&i[a]?[...f,...i[a]]:f}}},Pv=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],i=t.nextPart.get(r),o=i?Pv(e.slice(1),i):void 0;if(o)return o;if(t.validators.length===0)return;const l=e.join(Ed);return(a=t.validators.find(({validator:c})=>c(l)))==null?void 0:a.classGroupId},og=/^\[(.+)\]$/,Pw=e=>{if(og.test(e)){const t=og.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Rw=e=>{const{theme:t,prefix:r}=e,i={nextPart:new Map,validators:[]};return Dw(Object.entries(e.classGroups),r).forEach(([l,a])=>{Eh(a,i,l,t)}),i},Eh=(e,t,r,i)=>{e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:lg(t,o);l.classGroupId=r;return}if(typeof o=="function"){if(Mw(o)){Eh(o(i),t,r,i);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([l,a])=>{Eh(a,lg(t,l),r,i)})})},lg=(e,t)=>{let r=e;return t.split(Ed).forEach(i=>{r.nextPart.has(i)||r.nextPart.set(i,{nextPart:new Map,validators:[]}),r=r.nextPart.get(i)}),r},Mw=e=>e.isThemeGetter,Dw=(e,t)=>t?e.map(([r,i])=>{const o=i.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([a,c])=>[t+a,c])):l);return[r,o]}):e,Tw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,i=new Map;const o=(l,a)=>{r.set(l,a),t++,t>e&&(t=0,i=r,r=new Map)};return{get(l){let a=r.get(l);if(a!==void 0)return a;if((a=i.get(l))!==void 0)return o(l,a),a},set(l,a){r.has(l)?r.set(l,a):o(l,a)}}},Rv="!",Aw=e=>{const{separator:t,experimentalParseClassName:r}=e,i=t.length===1,o=t[0],l=t.length,a=c=>{const f=[];let h=0,g=0,m;for(let E=0;Eg?m-g:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:k}};return r?c=>r({className:c,parseClassName:a}):a},Bw=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(i=>{i[0]==="["?(t.push(...r.sort(),i),r=[]):r.push(i)}),t.push(...r.sort()),t},Iw=e=>({cache:Tw(e.cacheSize),parseClassName:Aw(e),...Lw(e)}),jw=/\s+/,zw=(e,t)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o}=t,l=[],a=e.trim().split(jw);let c="";for(let f=a.length-1;f>=0;f-=1){const h=a[f],{modifiers:g,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:y}=r(h);let S=!!y,k=i(S?x.substring(0,y):x);if(!k){if(!S){c=h+(c.length>0?" "+c:c);continue}if(k=i(x),!k){c=h+(c.length>0?" "+c:c);continue}S=!1}const E=Bw(g).join(":"),L=m?E+Rv:E,W=L+k;if(l.includes(W))continue;l.push(W);const z=o(k,S);for(let q=0;q0?" "+c:c)}return c};function Ow(){let e=0,t,r,i="";for(;e{if(typeof e=="string")return e;let t,r="";for(let i=0;im(g),e());return r=Iw(h),i=r.cache.get,o=r.cache.set,l=c,c(f)}function c(f){const h=i(f);if(h)return h;const g=zw(f,r);return o(f,g),g}return function(){return l(Ow.apply(null,arguments))}}const Je=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Dv=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hw=/^\d+\/\d+$/,$w=new Set(["px","full","screen"]),Ww=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Kw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hn=e=>cs(e)||$w.has(e)||Hw.test(e),$n=e=>ms(e,"length",tS),cs=e=>!!e&&!Number.isNaN(Number(e)),Kc=e=>ms(e,"number",cs),oo=e=>!!e&&Number.isInteger(Number(e)),Yw=e=>e.endsWith("%")&&cs(e.slice(0,-1)),Re=e=>Dv.test(e),Wn=e=>Ww.test(e),Xw=new Set(["length","size","percentage"]),Gw=e=>ms(e,Xw,Tv),Qw=e=>ms(e,"position",Tv),Jw=new Set(["image","url"]),Zw=e=>ms(e,Jw,nS),eS=e=>ms(e,"",rS),lo=()=>!0,ms=(e,t,r)=>{const i=Dv.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):r(i[2]):!1},tS=e=>Uw.test(e)&&!Vw.test(e),Tv=()=>!1,rS=e=>Kw.test(e),nS=e=>qw.test(e),iS=()=>{const e=Je("colors"),t=Je("spacing"),r=Je("blur"),i=Je("brightness"),o=Je("borderColor"),l=Je("borderRadius"),a=Je("borderSpacing"),c=Je("borderWidth"),f=Je("contrast"),h=Je("grayscale"),g=Je("hueRotate"),m=Je("invert"),x=Je("gap"),y=Je("gradientColorStops"),S=Je("gradientColorStopPositions"),k=Je("inset"),E=Je("margin"),L=Je("opacity"),W=Je("padding"),z=Je("saturate"),q=Je("scale"),Q=Je("sepia"),A=Je("skew"),le=Je("space"),he=Je("translate"),ge=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Re,t],T=()=>[Re,t],D=()=>["",hn,$n],H=()=>["auto",cs,Re],j=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Re],b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[cs,Re];return{cacheSize:500,separator:":",theme:{colors:[lo],spacing:[hn,$n],blur:["none","",Wn,Re],brightness:P(),borderColor:[e],borderRadius:["none","","full",Wn,Re],borderSpacing:T(),borderWidth:D(),contrast:P(),grayscale:K(),hueRotate:P(),invert:K(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[Yw,$n],inset:V(),margin:V(),opacity:P(),padding:T(),saturate:P(),scale:P(),sepia:K(),skew:P(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[Wn]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...j(),Re]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:ge()}],"overscroll-x":[{"overscroll-x":ge()}],"overscroll-y":[{"overscroll-y":ge()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",oo,Re]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",oo,Re]}],"grid-cols":[{"grid-cols":[lo]}],"col-start-end":[{col:["auto",{span:["full",oo,Re]},Re]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[lo]}],"row-start-end":[{row:["auto",{span:[oo,Re]},Re]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[W]}],px:[{px:[W]}],py:[{py:[W]}],ps:[{ps:[W]}],pe:[{pe:[W]}],pt:[{pt:[W]}],pr:[{pr:[W]}],pb:[{pb:[W]}],pl:[{pl:[W]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[le]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[le]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[Wn]},Wn]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Wn,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kc]}],"font-family":[{font:[lo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Re]}],"line-clamp":[{"line-clamp":["none",cs,Kc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hn,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[L]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hn,$n]}],"underline-offset":[{"underline-offset":["auto",hn,Re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[L]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...j(),Qw]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Gw]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Zw]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[L]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[L]}],"divide-style":[{divide:G()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[hn,Re]}],"outline-w":[{outline:[hn,$n]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[L]}],"ring-offset-w":[{"ring-offset":[hn,$n]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wn,eS]}],"shadow-color":[{shadow:[lo]}],opacity:[{opacity:[L]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[i]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Wn,Re]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[m]}],saturate:[{saturate:[z]}],sepia:[{sepia:[Q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[L]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Re]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[q]}],"scale-x":[{"scale-x":[q]}],"scale-y":[{"scale-y":[q]}],rotate:[{rotate:[oo,Re]}],"translate-x":[{"translate-x":[he]}],"translate-y":[{"translate-y":[he]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[hn,$n,Kc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},sS=Fw(iS);function je(...e){return sS(Nv(e))}const oS=Lv("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Jn=te.forwardRef(({className:e,variant:t,size:r,...i},o)=>_.jsx("button",{className:je(oS({variant:t,size:r,className:e})),ref:o,...i}));Jn.displayName="Button";function hs({content:e,children:t,side:r="right"}){const[i,o]=te.useState(!1),l={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"}[r];return _.jsxs("div",{className:"relative inline-flex",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t,i&&_.jsx("div",{className:je("absolute z-50 whitespace-nowrap rounded-md border border-border bg-card px-2.5 py-1.5 text-xs text-card-foreground shadow-lg",l),children:e})]})}const lS=Lv("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function aS({className:e,variant:t,...r}){return _.jsx("div",{className:je(lS({variant:t}),e),...r})}const yi=te.forwardRef(({className:e,type:t,...r},i)=>_.jsx("input",{type:t,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:i,...r}));yi.displayName="Input";function uS({scans:e,activeId:t,onSelect:r,emptyMessage:i="No scans yet."}){return e.length===0?_.jsx("div",{className:"text-muted-foreground/60 text-xs text-center py-6",children:i}):_.jsx("div",{className:"space-y-1",children:e.map(o=>{const l=!!o.verify||!!o.ai&&!o.sniper,a=!!o.sniper||!!o.ai&&!o.verify,c=hS(o),f=dS(o),h=!!o.result||c>0||f>0;return _.jsxs("button",{onClick:()=>r(o),title:`${o.target} — ${o.status}`,"aria-current":o.id===t?"true":void 0,"aria-label":`${o.target}, ${o.status}, ${o.mode}, ${c} assets, ${f} loots`,className:`w-full text-left px-2.5 py-2 rounded-md transition-colors ${o.id===t?"bg-accent border border-cyber-600/30":"hover:bg-accent/50 border border-transparent"}`,children:[_.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_.jsx("span",{className:"text-xs font-mono text-foreground truncate",children:o.target}),_.jsx(cS,{status:o.status})]}),_.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[_.jsx("span",{className:"text-[10px] text-muted-foreground",children:o.mode}),h&&_.jsxs(_.Fragment,{children:[_.jsx(ag,{icon:_.jsx(gw,{className:"h-3 w-3"}),value:c,label:"assets",className:"text-cyber-700 dark:text-cyber-300"}),_.jsx(ag,{icon:_.jsx(bw,{className:"h-3 w-3"}),value:f,label:"loots",className:f>0?"text-red-700 dark:text-red-300":"text-muted-foreground/60"})]}),l&&_.jsx("span",{className:"text-[10px] text-cyber-700 dark:text-cyber-300",children:"Verify"}),a&&_.jsx("span",{className:"text-[10px] text-red-700 dark:text-red-300",children:"Sniper"}),o.deep&&_.jsx("span",{className:"text-[10px] text-yellow-700 dark:text-yellow-300",children:"Deep"}),_.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:pS(o.created_at)})]})]},o.id)})})}function ag({className:e,icon:t,label:r,value:i}){return _.jsxs("span",{title:`${i} ${r}`,className:`inline-flex items-center gap-0.5 text-[10px] font-medium ${e}`,children:[t,_.jsx("span",{className:"font-mono",children:i})]})}function cS({status:e}){const t={queued:"bg-gray-500",running:"bg-blue-400 animate-pulse",completed:"bg-green-400",failed:"bg-red-400",canceled:"bg-yellow-400"};return _.jsx("span",{title:e,className:`w-2 h-2 rounded-full shrink-0 ${t[e]||t.queued}`})}function hS(e){var t,r;return((r=(t=e.result)==null?void 0:t.assets)==null?void 0:r.length)||0}function dS(e){const t=e.result;return t?t.loots&&t.loots.length>0?t.loots.filter(r=>r.kind.toLowerCase()!=="fingerprint").length:(t.assets||[]).reduce((r,i)=>r+(i.items||[]).filter(o=>o.kind==="loot"&&fS(o.data).toLowerCase()!=="fingerprint").length,0):0}function fS(e){const t=e==null?void 0:e.kind;return typeof t=="string"?t:""}function pS(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function mS({open:e,onToggle:t,scans:r,activeId:i,onSelectScan:o}){const[l,a]=te.useState(""),c=r.filter(g=>g.status==="running").length,f=l.trim().toLowerCase(),h=te.useMemo(()=>f?r.filter(g=>g.target.toLowerCase().includes(f)):r,[f,r]);return _.jsxs(_.Fragment,{children:[e&&_.jsx("button",{type:"button","aria-label":"Close sidebar overlay",onClick:t,className:"fixed inset-0 z-30 bg-background/60 backdrop-blur-[1px] md:hidden"}),_.jsxs("aside",{className:`flex flex-col border-r border-border bg-card/95 backdrop-blur-sm transition-all duration-200 ease-in-out shrink-0 md:bg-card/50 ${e?"fixed inset-y-0 left-0 z-40 w-72 shadow-xl md:relative md:inset-auto md:z-auto md:shadow-none":"w-12"}`,children:[_.jsx("div",{className:`flex items-center border-b border-border ${e?"p-3 gap-3":"p-2 flex-col gap-2"}`,children:e?_.jsxs(_.Fragment,{children:[_.jsx(ki,{className:"w-5 h-5 text-cyber-400 shrink-0"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("h1",{className:"text-sm font-bold text-cyber-700 dark:text-cyber-400",children:"AIScan"}),_.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Web console"})]}),_.jsx(Jn,{variant:"ghost",size:"icon",onClick:t,className:"h-7 w-7 text-muted-foreground","aria-label":"Collapse sidebar",children:_.jsx(yw,{className:"w-4 h-4"})})]}):_.jsx(_.Fragment,{children:_.jsx(hs,{content:"AIScan",side:"right",children:_.jsx("button",{type:"button",onClick:t,"aria-label":"Expand sidebar",className:"p-1 rounded-md hover:bg-accent transition-colors",children:_.jsx(ki,{className:"w-5 h-5 text-cyber-700 dark:text-cyber-400"})})})})}),e?_.jsxs("div",{className:"flex-1 overflow-auto p-3 animate-fade-in",children:[_.jsxs("div",{className:"flex items-center justify-between mb-3",children:[_.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"History"}),c>0&&_.jsxs(aS,{className:"border-blue-300 bg-blue-500/10 px-1.5 text-[10px] text-blue-700 dark:border-blue-800 dark:bg-blue-900/50 dark:text-blue-400",children:[c," running"]})]}),_.jsxs("div",{className:"relative mb-3",children:[_.jsx(bv,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),_.jsx(yi,{value:l,onChange:g=>a(g.target.value),placeholder:"Search targets","aria-label":"Search scan targets",className:"h-8 pl-8 pr-8 text-xs"}),l&&_.jsx("button",{type:"button","aria-label":"Clear target search",onClick:()=>a(""),className:"absolute right-1.5 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",children:_.jsx(jo,{className:"h-3 w-3"})})]}),_.jsx(uS,{scans:h,activeId:i,onSelect:o,emptyMessage:f?"No matching targets.":"No scans yet."})]}):_.jsxs("div",{className:"flex flex-col items-center gap-2 pt-3",children:[_.jsx(hs,{content:`${r.length} scans`,side:"right",children:_.jsxs("button",{type:"button",onClick:t,"aria-label":`${r.length} scans in history`,className:"p-1.5 rounded-md hover:bg-accent transition-colors relative",children:[_.jsx(yv,{className:"w-4 h-4 text-muted-foreground"}),r.length>0&&_.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-3.5 h-3.5 bg-cyber-600 rounded-full text-[8px] font-bold flex items-center justify-center text-white",children:r.length>9?"9+":r.length})]})}),_.jsx(hs,{content:"Expand sidebar",side:"right",children:_.jsx(Jn,{variant:"ghost",size:"icon",onClick:t,className:"h-7 w-7 text-muted-foreground","aria-label":"Expand sidebar",children:_.jsx(xw,{className:"w-3.5 h-3.5"})})})]})]})]})}function gS({value:e,onValueChange:t,children:r,className:i,disabled:o,ariaLabel:l}){return _.jsx("div",{role:"group","aria-label":l,className:je("inline-flex items-center rounded-md border border-input bg-secondary/50 p-0.5",i),children:te.Children.map(r,a=>te.isValidElement(a)?te.cloneElement(a,{active:a.props.value===e,onClick:()=>!o&&t(a.props.value),disabled:o}):a)})}function ug({children:e,className:t,active:r,onClick:i,disabled:o}){return _.jsx("button",{type:"button",onClick:i,disabled:o,className:je("inline-flex items-center justify-center rounded-sm px-3 py-1 text-xs font-medium transition-all",r?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground",o&&"opacity-50 cursor-not-allowed",t),children:e})}function _S({onSubmit:e,disabled:t,analysisAvailable:r,status:i,actions:o}){const[l,a]=te.useState(""),[c,f]=te.useState("quick"),[h,g]=te.useState({verify:!1,sniper:!1,deep:!1});te.useEffect(()=>{r||g({verify:!1,sniper:!1,deep:!1})},[r]);const m=S=>{S.preventDefault(),l.trim()&&e(l.trim(),c,h)},x=S=>{g(k=>({...k,[S]:!k[S]}))},y=[{key:"verify",label:"Verify",icon:_.jsx(pv,{className:"h-4 w-4"}),activeClass:"border-cyber-500/40 bg-cyber-500/15 text-cyber-700 dark:text-cyber-300"},{key:"sniper",label:"Sniper",icon:_.jsx(Wa,{className:"h-4 w-4"}),activeClass:"border-red-400/40 bg-red-400/15 text-red-700 dark:text-red-300"},{key:"deep",label:"Deep",icon:_.jsx(Ua,{className:"h-4 w-4"}),activeClass:"border-yellow-400/40 bg-yellow-400/15 text-yellow-700 dark:text-yellow-300"}];return _.jsxs("form",{onSubmit:m,className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-2 sm:flex sm:flex-wrap sm:gap-3",children:[_.jsxs("div",{className:"relative col-start-1 row-start-1 min-w-0 sm:min-w-[16rem] sm:flex-1",children:[_.jsx(bv,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),_.jsx(yi,{value:l,onChange:S=>a(S.target.value),placeholder:"Target — IP, hostname, or URL",disabled:t,autoFocus:!0,"aria-label":"Scan target",className:"pl-9 h-10 font-mono text-sm bg-secondary/50 border-border focus-visible:ring-cyber-500/50"})]}),_.jsxs("div",{className:"col-span-full row-start-2 flex min-w-0 items-center gap-2 sm:contents",children:[_.jsxs(gS,{value:c,onValueChange:f,disabled:t,ariaLabel:"Scan mode",children:[_.jsx(ug,{value:"quick",children:"Quick"}),_.jsx(ug,{value:"full",children:"Full"})]}),_.jsx("div",{className:"inline-flex min-w-0 items-center gap-1.5 sm:gap-2",children:y.map(S=>{const k=h[S.key],E=t||!r;return _.jsxs("button",{type:"button","aria-pressed":k,"aria-label":`${S.label} analysis`,title:r?S.label:"LLM Offline",disabled:E,onClick:()=>x(S.key),className:je("inline-flex h-10 w-10 shrink-0 items-center justify-center gap-2 rounded-md border px-0 text-xs font-medium transition-colors sm:w-auto sm:px-3",k?S.activeClass:"border-input bg-secondary/50 text-muted-foreground hover:text-foreground",E&&"cursor-not-allowed opacity-50"),children:[S.icon,_.jsx("span",{className:"hidden sm:inline",children:S.label})]},S.key)})}),_.jsxs(Jn,{type:"submit",disabled:t||!l.trim(),"aria-label":t?"Scanning target":"Start scan",className:"h-10 w-10 shrink-0 px-0 bg-cyber-600 text-white hover:bg-cyber-500 sm:w-auto sm:px-5",children:[t?_.jsx(Na,{className:"w-4 h-4 animate-spin"}):_.jsx(ww,{className:"w-4 h-4"}),_.jsx("span",{className:"hidden sm:inline",children:t?"Scanning":"Scan"})]})]}),_.jsxs("div",{className:"col-start-2 row-start-1 flex items-center justify-end gap-2 sm:contents",children:[i,o]})]})}const cg=["Port Scan","Web Probe","Credentials","Vulns","Analysis"];function vS(e){for(let t=e.length-1;t>=0;t--){const r=e[t].toLowerCase();if(r.includes("[ai")||r.includes("sniper")||r.includes("verify")||r.includes("[deep"))return 4;if(r.includes("[vuln")||r.includes("neutron"))return 3;if(r.includes("[risk")||r.includes("zombie")||r.includes("weakpass"))return 2;if(r.includes("[web")||r.includes("[fingerprint")||r.includes("spray"))return 1;if(r.includes("[service")||r.includes("gogo"))return 0}return 0}function yS({lines:e,status:t,collapsed:r,onToggleCollapse:i}){const o=te.useRef(null),l=vS(e),a=t==="running";return te.useEffect(()=>{o.current&&!r&&(o.current.scrollTop=o.current.scrollHeight)},[e,r]),_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"space-y-1.5",children:[_.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-secondary",children:cg.map((c,f)=>_.jsx("div",{className:`flex-1 transition-all duration-500 ${f0?"ml-px":""}`},f))}),_.jsx("div",{className:"flex justify-between px-0.5",children:cg.map((c,f)=>_.jsx("span",{className:`text-[10px] transition-colors ${f<=l?"text-muted-foreground":"text-muted-foreground/40"} ${f===l&&a?"text-cyber-400":""}`,children:c},f))})]}),_.jsxs("div",{className:"rounded-lg border border-border bg-card/50 overflow-hidden",children:[_.jsxs("button",{onClick:i,className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground hover:bg-accent/50 transition-colors",children:[r?_.jsx($a,{className:"w-3.5 h-3.5"}):_.jsx(aw,{className:"w-3.5 h-3.5"}),_.jsx(Cv,{className:"w-3.5 h-3.5"}),_.jsx("span",{children:"Scan Output"}),e.length>0&&_.jsxs("span",{className:"text-muted-foreground/60 ml-auto",children:[e.length," lines"]})]}),!r&&_.jsx("div",{ref:o,className:"px-3 pb-3 max-h-64 overflow-y-auto font-mono text-xs leading-relaxed",children:e.length===0?_.jsx("div",{className:"text-muted-foreground/60 flex items-center gap-2 py-2",children:_.jsx("span",{className:"animate-pulse",children:"Initializing scan..."})}):e.map((c,f)=>_.jsx("div",{className:xS(c),children:c},f))})]})]})}function xS(e){const t=e.toLowerCase();return t.includes("[vuln")||t.includes("critical")?"text-red-400":t.includes("[risk")||t.includes("weakpass")?"text-orange-400":t.includes("[ai")||t.includes("verified")||t.includes("sniper")||t.includes("[deep")?"text-purple-400":t.includes("[fingerprint")?"text-yellow-400":t.includes("[web")||t.includes("[service")?"text-green-400":t.includes("[summary")||t.includes("completed")?"text-cyan-400":t.includes("error")||t.includes("failed")?"text-red-500":"text-muted-foreground/80"}function wS(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const SS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kS={};function hg(e,t){return(kS.jsx?bS:SS).test(e)}const CS=/[ \t\n\f\r]/g;function ES(e){return typeof e=="object"?e.type==="text"?dg(e.value):!1:dg(e)}function dg(e){return e.replace(CS,"")===""}class zo{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}zo.prototype.normal={};zo.prototype.property={};zo.prototype.space=void 0;function Av(e,t){const r={},i={};for(const o of e)Object.assign(r,o.property),Object.assign(i,o.normal);return new zo(r,i,t)}function Nh(e){return e.toLowerCase()}class sr{constructor(t,r){this.attribute=r,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let NS=0;const Ne=Li(),pt=Li(),Lh=Li(),ne=Li(),Ke=Li(),Si=Li(),pr=Li();function Li(){return 2**++NS}const Ph=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:pt,commaOrSpaceSeparated:pr,commaSeparated:Si,number:ne,overloadedBoolean:Lh,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),qc=Object.keys(Ph);class Nd extends sr{constructor(t,r,i,o){let l=-1;if(super(t,r),fg(this,"space",o),typeof i=="number")for(;++l4&&r.slice(0,4)==="data"&&DS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(pg,BS);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!pg.test(l)){let a=l.replace(MS,AS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=Nd}return new o(i,t)}function AS(e){return"-"+e.toLowerCase()}function BS(e){return e.charAt(1).toUpperCase()}const IS=Av([Bv,LS,zv,Ov,Fv],"html"),Ld=Av([Bv,PS,zv,Ov,Fv],"svg");function jS(e){return e.join(" ").trim()}var ns={},Yc,mg;function zS(){if(mg)return Yc;mg=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,f=` -`,h="/",g="*",m="",x="comment",y="declaration";function S(E,L){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];L=L||{};var W=1,z=1;function q(H){var j=H.match(t);j&&(W+=j.length);var G=H.lastIndexOf(f);z=~G?H.length-G:z+H.length}function Q(){var H={line:W,column:z};return function(j){return j.position=new A(H),ge(),j}}function A(H){this.start=H,this.end={line:W,column:z},this.source=L.source}A.prototype.content=E;function le(H){var j=new Error(L.source+":"+W+":"+z+": "+H);if(j.reason=H,j.filename=L.source,j.line=W,j.column=z,j.source=E,!L.silent)throw j}function he(H){var j=H.exec(E);if(j){var G=j[0];return q(G),E=E.slice(G.length),j}}function ge(){he(r)}function F(H){var j;for(H=H||[];j=V();)j!==!1&&H.push(j);return H}function V(){var H=Q();if(!(h!=E.charAt(0)||g!=E.charAt(1))){for(var j=2;m!=E.charAt(j)&&(g!=E.charAt(j)||h!=E.charAt(j+1));)++j;if(j+=2,m===E.charAt(j-1))return le("End of comment missing");var G=E.slice(2,j-2);return z+=2,q(G),E=E.slice(j),z+=2,H({type:x,comment:G})}}function T(){var H=Q(),j=he(i);if(j){if(V(),!he(o))return le("property missing ':'");var G=he(l),re=H({type:y,property:k(j[0].replace(e,m)),value:G?k(G[0].replace(e,m)):m});return he(a),re}}function D(){var H=[];F(H);for(var j;j=T();)j!==!1&&(H.push(j),F(H));return H}return ge(),D()}function k(E){return E?E.replace(c,m):m}return Yc=S,Yc}var gg;function OS(){if(gg)return ns;gg=1;var e=ns&&ns.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ns,"__esModule",{value:!0}),ns.default=r;const t=e(zS());function r(i,o){let l=null;if(!i||typeof i!="string")return l;const a=(0,t.default)(i),c=typeof o=="function";return a.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;c?o(h,g,f):g&&(l=l||{},l[h]=g)}),l}return ns}var ao={},_g;function FS(){if(_g)return ao;_g=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(h){return!h||r.test(h)||e.test(h)},a=function(h,g){return g.toUpperCase()},c=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(o,c):h=h.replace(i,c),h.replace(t,a))};return ao.camelCase=f,ao}var uo,vg;function HS(){if(vg)return uo;vg=1;var e=uo&&uo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(OS()),r=FS();function i(o,l){var a={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(a[(0,r.camelCase)(c,l)]=f)}),a}return i.default=i,uo=i,uo}var $S=HS();const WS=Ha($S),Hv=$v("end"),Pd=$v("start");function $v(e){return t;function t(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function US(e){const t=Pd(e),r=Hv(e);if(t&&r)return{start:t,end:r}}function Co(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yg(e.position):"start"in e||"end"in e?yg(e):"line"in e||"column"in e?Rh(e):""}function Rh(e){return xg(e&&e.line)+":"+xg(e&&e.column)}function yg(e){return Rh(e&&e.start)+"-"+Rh(e&&e.end)}function xg(e){return e&&typeof e=="number"?e:1}class Ut extends Error{constructor(t,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let o="",l={},a=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?o=t:!l.cause&&t&&(a=!0,o=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?l.ruleId=i:(l.source=i.slice(0,f),l.ruleId=i.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Co(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ut.prototype.file="";Ut.prototype.name="";Ut.prototype.reason="";Ut.prototype.message="";Ut.prototype.stack="";Ut.prototype.column=void 0;Ut.prototype.line=void 0;Ut.prototype.ancestors=void 0;Ut.prototype.cause=void 0;Ut.prototype.fatal=void 0;Ut.prototype.place=void 0;Ut.prototype.ruleId=void 0;Ut.prototype.source=void 0;const Rd={}.hasOwnProperty,VS=new Map,KS=/[A-Z]/g,qS=new Set(["table","tbody","thead","tfoot","tr"]),YS=new Set(["td","th"]),Wv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=nb(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=rb(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ld:IS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Uv(o,e,void 0);return l&&typeof l!="string"?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}function Uv(e,t,r){if(t.type==="element")return GS(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ZS(e,t,r);if(t.type==="mdxjsEsm")return JS(e,t);if(t.type==="root")return eb(e,t,r);if(t.type==="text")return tb(e,t)}function GS(e,t,r){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Ld,e.schema=o),e.ancestors.push(t);const l=Kv(e,t.tagName,!1),a=ib(e,t);let c=Dd(e,t);return qS.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!ES(f):!0})),Vv(e,a,l,t),Md(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,r)}function QS(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ro(e,t.position)}function JS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ro(e,t.position)}function ZS(e,t,r){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Ld,e.schema=o),e.ancestors.push(t);const l=t.name===null?e.Fragment:Kv(e,t.name,!0),a=sb(e,t),c=Dd(e,t);return Vv(e,a,l,t),Md(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,r)}function eb(e,t,r){const i={};return Md(i,Dd(e,t)),e.create(t,e.Fragment,i,r)}function tb(e,t){return t.value}function Vv(e,t,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=i)}function Md(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function rb(e,t,r){return i;function i(o,l,a,c){const h=Array.isArray(a.children)?r:t;return c?h(l,a,c):h(l,a)}}function nb(e,t){return r;function r(i,o,l,a){const c=Array.isArray(l.children),f=Pd(i);return t(o,l,a,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function ib(e,t){const r={};let i,o;for(o in t.properties)if(o!=="children"&&Rd.call(t.properties,o)){const l=ob(e,o,t.properties[o]);if(l){const[a,c]=l;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&YS.has(t.tagName)?i=c:r[a]=c}}if(i){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function sb(e,t){const r={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const a=l.expression;a.type;const c=a.properties[0];c.type,Object.assign(r,e.evaluater.evaluateExpression(c.argument))}else Ro(e,t.position);else{const o=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else Ro(e,t.position);else l=i.value===null?!0:i.value;r[o]=l}return r}function Dd(e,t){const r=[];let i=-1;const o=e.passKeys?new Map:VS;for(;++io?0:o+t:t=t>o?o:t,r=r>0?r:0,i.length<1e4)a=Array.from(i),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);l0?(mr(e,e.length,0,t),e):t}const bg={}.hasOwnProperty;function Yv(e){const t={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function jr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yt=Zn(/[A-Za-z]/),$t=Zn(/[\dA-Za-z]/),mb=Zn(/[#-'*+\--9=?A-Z^-~]/);function Ra(e){return e!==null&&(e<32||e===127)}const Mh=Zn(/\d/),gb=Zn(/[\dA-Fa-f]/),_b=Zn(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function qe(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const Va=Zn(new RegExp("\\p{P}|\\p{S}","u")),Ci=Zn(/\s/);function Zn(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function _s(e){const t=[];let r=-1,i=0,o=0;for(;++r55295&&l<57344){const c=e.charCodeAt(r+1);l<56320&&c>56319&&c<57344?(a=String.fromCharCode(l,c),o=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(i,r),encodeURIComponent(a)),i=r+o+1,a=""),o&&(r+=o,o=0)}return t.join("")+e.slice(i)}function Oe(e,t,r,i){const o=i?i-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(f){return Ie(f)?(e.enter(r),c(f)):t(f)}function c(f){return Ie(f)&&l++a))return;const le=t.events.length;let he=le,ge,F;for(;he--;)if(t.events[he][0]==="exit"&&t.events[he][1].type==="chunkFlow"){if(ge){F=t.events[he][1].end;break}ge=!0}for(L(i),A=le;Az;){const Q=r[q];t.containerState=Q[1],Q[0].exit.call(t,e)}r.length=z}function W(){o.write([null]),l=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Sb(e,t,r){return Oe(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ds(e){if(e===null||qe(e)||Ci(e))return 1;if(Va(e))return 2}function Ka(e,t,r){const i=[];let o=-1;for(;++o1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const m={...e[i][1].end},x={...e[r][1].start};Cg(m,-f),Cg(x,f),a={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},l={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},o={type:f>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[i][1].end={...a.start},e[r][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Er(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Er(h,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",l,t]]),h=Er(h,Ka(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),h=Er(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,h=Er(h,[["enter",e[r][1],t],["exit",e[r][1],t]])):g=0,mr(e,i-1,r-i+3,h),r=i+h.length-g-2;break}}for(r=-1;++r0&&Ie(A)?Oe(e,W,"linePrefix",l+1)(A):W(A)}function W(A){return A===null||be(A)?e.check(Eg,k,q)(A):(e.enter("codeFlowValue"),z(A))}function z(A){return A===null||be(A)?(e.exit("codeFlowValue"),W(A)):(e.consume(A),z)}function q(A){return e.exit("codeFenced"),t(A)}function Q(A,le,he){let ge=0;return F;function F(j){return A.enter("lineEnding"),A.consume(j),A.exit("lineEnding"),V}function V(j){return A.enter("codeFencedFence"),Ie(j)?Oe(A,T,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):T(j)}function T(j){return j===c?(A.enter("codeFencedFenceSequence"),D(j)):he(j)}function D(j){return j===c?(ge++,A.consume(j),D):ge>=a?(A.exit("codeFencedFenceSequence"),Ie(j)?Oe(A,H,"whitespace")(j):H(j)):he(j)}function H(j){return j===null||be(j)?(A.exit("codeFencedFence"),le(j)):he(j)}}}function Ab(e,t,r){const i=this;return o;function o(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return i.parser.lazy[i.now().line]?r(a):t(a)}}const Gc={name:"codeIndented",tokenize:Ib},Bb={partial:!0,tokenize:jb};function Ib(e,t,r){const i=this;return o;function o(h){return e.enter("codeIndented"),Oe(e,l,"linePrefix",5)(h)}function l(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?a(h):r(h)}function a(h){return h===null?f(h):be(h)?e.attempt(Bb,a,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||be(h)?(e.exit("codeFlowValue"),a(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function jb(e,t,r){const i=this;return o;function o(a){return i.parser.lazy[i.now().line]?r(a):be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):Oe(e,l,"linePrefix",5)(a)}function l(a){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):be(a)?o(a):r(a)}}const zb={name:"codeText",previous:Fb,resolve:Ob,tokenize:Hb};function Ob(e){let t=e.length-4,r=3,i,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=r;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,r,i){const o=r||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&co(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),co(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),co(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(i.parser.constructs.flow,r,t)(a)}}function e0(e,t,r,i,o,l,a,c,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return m;function m(L){return L===60?(e.enter(i),e.enter(o),e.enter(l),e.consume(L),e.exit(l),x):L===null||L===32||L===41||Ra(L)?r(L):(e.enter(i),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(L))}function x(L){return L===62?(e.enter(l),e.consume(L),e.exit(l),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(L))}function y(L){return L===62?(e.exit("chunkString"),e.exit(c),x(L)):L===null||L===60||be(L)?r(L):(e.consume(L),L===92?S:y)}function S(L){return L===60||L===62||L===92?(e.consume(L),y):y(L)}function k(L){return!g&&(L===null||L===41||qe(L))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(i),t(L)):g999||y===null||y===91||y===93&&!f||y===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?r(y):y===93?(e.exit(l),e.enter(o),e.consume(y),e.exit(o),e.exit(i),t):be(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||be(y)||c++>999?(e.exit("chunkString"),g(y)):(e.consume(y),f||(f=!Ie(y)),y===92?x:m)}function x(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function r0(e,t,r,i,o,l){let a;return c;function c(x){return x===34||x===39||x===40?(e.enter(i),e.enter(o),e.consume(x),e.exit(o),a=x===40?41:x,f):r(x)}function f(x){return x===a?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),t):(e.enter(l),h(x))}function h(x){return x===a?(e.exit(l),f(a)):x===null?r(x):be(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Oe(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===a||x===null||be(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?m:g)}function m(x){return x===a||x===92?(e.consume(x),g):g(x)}}function Eo(e,t){let r;return i;function i(o){return be(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,i):Ie(o)?Oe(e,i,r?"linePrefix":"lineSuffix")(o):t(o)}}const Xb={name:"definition",tokenize:Qb},Gb={partial:!0,tokenize:Jb};function Qb(e,t,r){const i=this;let o;return l;function l(y){return e.enter("definition"),a(y)}function a(y){return t0.call(i,e,c,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return o=jr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):r(y)}function f(y){return qe(y)?Eo(e,h)(y):h(y)}function h(y){return e0(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(Gb,m,m)(y)}function m(y){return Ie(y)?Oe(e,x,"whitespace")(y):x(y)}function x(y){return y===null||be(y)?(e.exit("definition"),i.parser.defined.push(o),t(y)):r(y)}}function Jb(e,t,r){return i;function i(c){return qe(c)?Eo(e,o)(c):r(c)}function o(c){return r0(e,l,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Ie(c)?Oe(e,a,"whitespace")(c):a(c)}function a(c){return c===null||be(c)?t(c):r(c)}}const Zb={name:"hardBreakEscape",tokenize:ek};function ek(e,t,r){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),o}function o(l){return be(l)?(e.exit("hardBreakEscape"),t(l)):r(l)}}const tk={name:"headingAtx",resolve:rk,tokenize:nk};function rk(e,t){let r=e.length-2,i=3,o,l;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},l={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},mr(e,i,r-i+1,[["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t]])),e}function nk(e,t,r){let i=0;return o;function o(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),a(g)}function a(g){return g===35&&i++<6?(e.consume(g),a):g===null||qe(g)?(e.exit("atxHeadingSequence"),c(g)):r(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||be(g)?(e.exit("atxHeading"),t(g)):Ie(g)?Oe(e,c,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),c(g))}function h(g){return g===null||g===35||qe(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),h)}}const ik=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lg=["pre","script","style","textarea"],sk={concrete:!0,name:"htmlFlow",resolveTo:ak,tokenize:uk},ok={partial:!0,tokenize:hk},lk={partial:!0,tokenize:ck};function ak(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function uk(e,t,r){const i=this;let o,l,a,c,f;return h;function h(C){return g(C)}function g(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),m}function m(C){return C===33?(e.consume(C),x):C===47?(e.consume(C),l=!0,k):C===63?(e.consume(C),o=3,i.interrupt?t:b):Yt(C)?(e.consume(C),a=String.fromCharCode(C),E):r(C)}function x(C){return C===45?(e.consume(C),o=2,y):C===91?(e.consume(C),o=5,c=0,S):Yt(C)?(e.consume(C),o=4,i.interrupt?t:b):r(C)}function y(C){return C===45?(e.consume(C),i.interrupt?t:b):r(C)}function S(C){const ae="CDATA[";return C===ae.charCodeAt(c++)?(e.consume(C),c===ae.length?i.interrupt?t:T:S):r(C)}function k(C){return Yt(C)?(e.consume(C),a=String.fromCharCode(C),E):r(C)}function E(C){if(C===null||C===47||C===62||qe(C)){const ae=C===47,ve=a.toLowerCase();return!ae&&!l&&Lg.includes(ve)?(o=1,i.interrupt?t(C):T(C)):ik.includes(a.toLowerCase())?(o=6,ae?(e.consume(C),L):i.interrupt?t(C):T(C)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(C):l?W(C):z(C))}return C===45||$t(C)?(e.consume(C),a+=String.fromCharCode(C),E):r(C)}function L(C){return C===62?(e.consume(C),i.interrupt?t:T):r(C)}function W(C){return Ie(C)?(e.consume(C),W):F(C)}function z(C){return C===47?(e.consume(C),F):C===58||C===95||Yt(C)?(e.consume(C),q):Ie(C)?(e.consume(C),z):F(C)}function q(C){return C===45||C===46||C===58||C===95||$t(C)?(e.consume(C),q):Q(C)}function Q(C){return C===61?(e.consume(C),A):Ie(C)?(e.consume(C),Q):z(C)}function A(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),f=C,le):Ie(C)?(e.consume(C),A):he(C)}function le(C){return C===f?(e.consume(C),f=null,ge):C===null||be(C)?r(C):(e.consume(C),le)}function he(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||qe(C)?Q(C):(e.consume(C),he)}function ge(C){return C===47||C===62||Ie(C)?z(C):r(C)}function F(C){return C===62?(e.consume(C),V):r(C)}function V(C){return C===null||be(C)?T(C):Ie(C)?(e.consume(C),V):r(C)}function T(C){return C===45&&o===2?(e.consume(C),G):C===60&&o===1?(e.consume(C),re):C===62&&o===4?(e.consume(C),P):C===63&&o===3?(e.consume(C),b):C===93&&o===5?(e.consume(C),K):be(C)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(ok,U,D)(C)):C===null||be(C)?(e.exit("htmlFlowData"),D(C)):(e.consume(C),T)}function D(C){return e.check(lk,H,U)(C)}function H(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),j}function j(C){return C===null||be(C)?D(C):(e.enter("htmlFlowData"),T(C))}function G(C){return C===45?(e.consume(C),b):T(C)}function re(C){return C===47?(e.consume(C),a="",I):T(C)}function I(C){if(C===62){const ae=a.toLowerCase();return Lg.includes(ae)?(e.consume(C),P):T(C)}return Yt(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),I):T(C)}function K(C){return C===93?(e.consume(C),b):T(C)}function b(C){return C===62?(e.consume(C),P):C===45&&o===2?(e.consume(C),b):T(C)}function P(C){return C===null||be(C)?(e.exit("htmlFlowData"),U(C)):(e.consume(C),P)}function U(C){return e.exit("htmlFlow"),t(C)}}function ck(e,t,r){const i=this;return o;function o(a){return be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):r(a)}function l(a){return i.parser.lazy[i.now().line]?r(a):t(a)}}function hk(e,t,r){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Oo,t,r)}}const dk={name:"htmlText",tokenize:fk};function fk(e,t,r){const i=this;let o,l,a;return c;function c(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),f}function f(b){return b===33?(e.consume(b),h):b===47?(e.consume(b),Q):b===63?(e.consume(b),z):Yt(b)?(e.consume(b),he):r(b)}function h(b){return b===45?(e.consume(b),g):b===91?(e.consume(b),l=0,S):Yt(b)?(e.consume(b),W):r(b)}function g(b){return b===45?(e.consume(b),y):r(b)}function m(b){return b===null?r(b):b===45?(e.consume(b),x):be(b)?(a=m,re(b)):(e.consume(b),m)}function x(b){return b===45?(e.consume(b),y):m(b)}function y(b){return b===62?G(b):b===45?x(b):m(b)}function S(b){const P="CDATA[";return b===P.charCodeAt(l++)?(e.consume(b),l===P.length?k:S):r(b)}function k(b){return b===null?r(b):b===93?(e.consume(b),E):be(b)?(a=k,re(b)):(e.consume(b),k)}function E(b){return b===93?(e.consume(b),L):k(b)}function L(b){return b===62?G(b):b===93?(e.consume(b),L):k(b)}function W(b){return b===null||b===62?G(b):be(b)?(a=W,re(b)):(e.consume(b),W)}function z(b){return b===null?r(b):b===63?(e.consume(b),q):be(b)?(a=z,re(b)):(e.consume(b),z)}function q(b){return b===62?G(b):z(b)}function Q(b){return Yt(b)?(e.consume(b),A):r(b)}function A(b){return b===45||$t(b)?(e.consume(b),A):le(b)}function le(b){return be(b)?(a=le,re(b)):Ie(b)?(e.consume(b),le):G(b)}function he(b){return b===45||$t(b)?(e.consume(b),he):b===47||b===62||qe(b)?ge(b):r(b)}function ge(b){return b===47?(e.consume(b),G):b===58||b===95||Yt(b)?(e.consume(b),F):be(b)?(a=ge,re(b)):Ie(b)?(e.consume(b),ge):G(b)}function F(b){return b===45||b===46||b===58||b===95||$t(b)?(e.consume(b),F):V(b)}function V(b){return b===61?(e.consume(b),T):be(b)?(a=V,re(b)):Ie(b)?(e.consume(b),V):ge(b)}function T(b){return b===null||b===60||b===61||b===62||b===96?r(b):b===34||b===39?(e.consume(b),o=b,D):be(b)?(a=T,re(b)):Ie(b)?(e.consume(b),T):(e.consume(b),H)}function D(b){return b===o?(e.consume(b),o=void 0,j):b===null?r(b):be(b)?(a=D,re(b)):(e.consume(b),D)}function H(b){return b===null||b===34||b===39||b===60||b===61||b===96?r(b):b===47||b===62||qe(b)?ge(b):(e.consume(b),H)}function j(b){return b===47||b===62||qe(b)?ge(b):r(b)}function G(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):r(b)}function re(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),I}function I(b){return Ie(b)?Oe(e,K,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):K(b)}function K(b){return e.enter("htmlTextData"),a(b)}}const Bd={name:"labelEnd",resolveAll:_k,resolveTo:vk,tokenize:yk},pk={tokenize:xk},mk={tokenize:wk},gk={tokenize:Sk};function _k(e){let t=-1;const r=[];for(;++t=3&&(h===null||be(h))?(e.exit("thematicBreak"),t(h)):r(h)}function f(h){return h===o?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),Ie(h)?Oe(e,c,"whitespace")(h):c(h))}}const ir={continuation:{tokenize:Dk},exit:Ak,name:"list",tokenize:Mk},Pk={partial:!0,tokenize:Bk},Rk={partial:!0,tokenize:Tk};function Mk(e,t,r){const i=this,o=i.events[i.events.length-1];let l=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return c;function c(y){const S=i.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||y===i.containerState.marker:Mh(y)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(xa,r,h)(y):h(y);if(!i.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return r(y)}function f(y){return Mh(y)&&++a<10?(e.consume(y),f):(!i.interrupt||a<2)&&(i.containerState.marker?y===i.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):r(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||y,e.check(Oo,i.interrupt?r:g,e.attempt(Pk,x,m))}function g(y){return i.containerState.initialBlankLine=!0,l++,x(y)}function m(y){return Ie(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):r(y)}function x(y){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function Dk(e,t,r){const i=this;return i.containerState._closeFlow=void 0,e.check(Oo,o,l);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Oe(e,t,"listItemIndent",i.containerState.size+1)(c)}function l(c){return i.containerState.furtherBlankLines||!Ie(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Rk,t,a)(c))}function a(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Oe(e,e.attempt(ir,t,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Tk(e,t,r){const i=this;return Oe(e,o,"listItemIndent",i.containerState.size+1);function o(l){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(l):r(l)}}function Ak(e){e.exit(this.containerState.type)}function Bk(e,t,r){const i=this;return Oe(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(l){const a=i.events[i.events.length-1];return!Ie(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):r(l)}}const Pg={name:"setextUnderline",resolveTo:Ik,tokenize:jk};function Ik(e,t){let r=e.length,i,o,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!l&&e[r][1].type==="definition"&&(l=r);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",l?(e.splice(o,0,["enter",a,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function jk(e,t,r){const i=this;let o;return l;function l(h){let g=i.events.length,m;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){m=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),o=h,a(h)):r(h)}function a(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===o?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ie(h)?Oe(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||be(h)?(e.exit("setextHeadingLine"),t(h)):r(h)}}const zk={tokenize:Ok};function Ok(e){const t=this,r=e.attempt(Oo,i,e.attempt(this.parser.constructs.flowInitial,o,Oe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Ub,o)),"linePrefix")));return r;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const Fk={resolveAll:i0()},Hk=n0("string"),$k=n0("text");function n0(e){return{resolveAll:i0(e==="text"?Wk:void 0),tokenize:t};function t(r){const i=this,o=this.parser.constructs[e],l=r.attempt(o,a,c);return a;function a(g){return h(g)?l(g):c(g)}function c(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),f}function f(g){return h(g)?(r.exit("data"),l(g)):(r.consume(g),f)}function h(g){if(g===null)return!0;const m=o[g];let x=-1;if(m)for(;++x-1){const c=a[0];typeof c=="string"?a[0]=c.slice(i):a.shift()}l>0&&a.push(e[o].slice(0,l))}return a}function rC(e,t){let r=-1;const i=[];let o;for(;++rtypeof e=="boolean"?`${e}`:e===0?"0":e,sg=Rv,Mv=(e,t)=>r=>{var i;if((t==null?void 0:t.variants)==null)return sg(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:l}=t,a=Object.keys(o).map(h=>{const g=r==null?void 0:r[h],m=l==null?void 0:l[h];if(g===null)return null;const x=ig(g)||ig(m);return o[h][x]}),c=r&&Object.entries(r).reduce((h,g)=>{let[m,x]=g;return x===void 0||(h[m]=x),h},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,g)=>{let{class:m,className:x,...y}=g;return Object.entries(y).every(S=>{let[k,E]=S;return Array.isArray(E)?E.includes({...l,...c}[k]):{...l,...c}[k]===E})?[...h,m,x]:h},[]);return sg(e,a,f,r==null?void 0:r.class,r==null?void 0:r.className)},Ed="-",Tw=e=>{const t=Aw(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:a=>{const c=a.split(Ed);return c[0]===""&&c.length!==1&&c.shift(),Tv(c,t)||Dw(a)},getConflictingClassGroupIds:(a,c)=>{const f=r[a]||[];return c&&i[a]?[...f,...i[a]]:f}}},Tv=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],i=t.nextPart.get(r),o=i?Tv(e.slice(1),i):void 0;if(o)return o;if(t.validators.length===0)return;const l=e.join(Ed);return(a=t.validators.find(({validator:c})=>c(l)))==null?void 0:a.classGroupId},og=/^\[(.+)\]$/,Dw=e=>{if(og.test(e)){const t=og.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Aw=e=>{const{theme:t,prefix:r}=e,i={nextPart:new Map,validators:[]};return Iw(Object.entries(e.classGroups),r).forEach(([l,a])=>{Eh(a,i,l,t)}),i},Eh=(e,t,r,i)=>{e.forEach(o=>{if(typeof o=="string"){const l=o===""?t:lg(t,o);l.classGroupId=r;return}if(typeof o=="function"){if(Bw(o)){Eh(o(i),t,r,i);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([l,a])=>{Eh(a,lg(t,l),r,i)})})},lg=(e,t)=>{let r=e;return t.split(Ed).forEach(i=>{r.nextPart.has(i)||r.nextPart.set(i,{nextPart:new Map,validators:[]}),r=r.nextPart.get(i)}),r},Bw=e=>e.isThemeGetter,Iw=(e,t)=>t?e.map(([r,i])=>{const o=i.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([a,c])=>[t+a,c])):l);return[r,o]}):e,jw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,i=new Map;const o=(l,a)=>{r.set(l,a),t++,t>e&&(t=0,i=r,r=new Map)};return{get(l){let a=r.get(l);if(a!==void 0)return a;if((a=i.get(l))!==void 0)return o(l,a),a},set(l,a){r.has(l)?r.set(l,a):o(l,a)}}},Dv="!",zw=e=>{const{separator:t,experimentalParseClassName:r}=e,i=t.length===1,o=t[0],l=t.length,a=c=>{const f=[];let h=0,g=0,m;for(let E=0;Eg?m-g:void 0;return{modifiers:f,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:k}};return r?c=>r({className:c,parseClassName:a}):a},Ow=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(i=>{i[0]==="["?(t.push(...r.sort(),i),r=[]):r.push(i)}),t.push(...r.sort()),t},Fw=e=>({cache:jw(e.cacheSize),parseClassName:zw(e),...Tw(e)}),Hw=/\s+/,$w=(e,t)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:o}=t,l=[],a=e.trim().split(Hw);let c="";for(let f=a.length-1;f>=0;f-=1){const h=a[f],{modifiers:g,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:y}=r(h);let S=!!y,k=i(S?x.substring(0,y):x);if(!k){if(!S){c=h+(c.length>0?" "+c:c);continue}if(k=i(x),!k){c=h+(c.length>0?" "+c:c);continue}S=!1}const E=Ow(g).join(":"),L=m?E+Dv:E,W=L+k;if(l.includes(W))continue;l.push(W);const z=o(k,S);for(let Y=0;Y0?" "+c:c)}return c};function Ww(){let e=0,t,r,i="";for(;e{if(typeof e=="string")return e;let t,r="";for(let i=0;im(g),e());return r=Fw(h),i=r.cache.get,o=r.cache.set,l=c,c(f)}function c(f){const h=i(f);if(h)return h;const g=$w(f,r);return o(f,g),g}return function(){return l(Ww.apply(null,arguments))}}const Je=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Bv=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vw=/^\d+\/\d+$/,Kw=new Set(["px","full","screen"]),qw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Gw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dn=e=>cs(e)||Kw.has(e)||Vw.test(e),Un=e=>ms(e,"length",sS),cs=e=>!!e&&!Number.isNaN(Number(e)),Kc=e=>ms(e,"number",cs),oo=e=>!!e&&Number.isInteger(Number(e)),Jw=e=>e.endsWith("%")&&cs(e.slice(0,-1)),Re=e=>Bv.test(e),Vn=e=>qw.test(e),Zw=new Set(["length","size","percentage"]),eS=e=>ms(e,Zw,Iv),tS=e=>ms(e,"position",Iv),rS=new Set(["image","url"]),nS=e=>ms(e,rS,lS),iS=e=>ms(e,"",oS),lo=()=>!0,ms=(e,t,r)=>{const i=Bv.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):r(i[2]):!1},sS=e=>Yw.test(e)&&!Xw.test(e),Iv=()=>!1,oS=e=>Gw.test(e),lS=e=>Qw.test(e),aS=()=>{const e=Je("colors"),t=Je("spacing"),r=Je("blur"),i=Je("brightness"),o=Je("borderColor"),l=Je("borderRadius"),a=Je("borderSpacing"),c=Je("borderWidth"),f=Je("contrast"),h=Je("grayscale"),g=Je("hueRotate"),m=Je("invert"),x=Je("gap"),y=Je("gradientColorStops"),S=Je("gradientColorStopPositions"),k=Je("inset"),E=Je("margin"),L=Je("opacity"),W=Je("padding"),z=Je("saturate"),Y=Je("scale"),U=Je("sepia"),T=Je("skew"),se=Je("space"),he=Je("translate"),fe=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",Re,t],A=()=>[Re,t],D=()=>["",dn,Un],H=()=>["auto",cs,Re],j=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Re],b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[cs,Re];return{cacheSize:500,separator:":",theme:{colors:[lo],spacing:[dn,Un],blur:["none","",Vn,Re],brightness:P(),borderColor:[e],borderRadius:["none","","full",Vn,Re],borderSpacing:A(),borderWidth:D(),contrast:P(),grayscale:q(),hueRotate:P(),invert:q(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[Jw,Un],inset:K(),margin:K(),opacity:P(),padding:A(),saturate:P(),scale:P(),sepia:q(),skew:P(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[Vn]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...j(),Re]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:fe()}],"overscroll-x":[{"overscroll-x":fe()}],"overscroll-y":[{"overscroll-y":fe()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",oo,Re]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",oo,Re]}],"grid-cols":[{"grid-cols":[lo]}],"col-start-end":[{col:["auto",{span:["full",oo,Re]},Re]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[lo]}],"row-start-end":[{row:["auto",{span:[oo,Re]},Re]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[W]}],px:[{px:[W]}],py:[{py:[W]}],ps:[{ps:[W]}],pe:[{pe:[W]}],pt:[{pt:[W]}],pr:[{pr:[W]}],pb:[{pb:[W]}],pl:[{pl:[W]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[se]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[se]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[Vn]},Vn]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Vn,Un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kc]}],"font-family":[{font:[lo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Re]}],"line-clamp":[{"line-clamp":["none",cs,Kc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",dn,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[L]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",dn,Un]}],"underline-offset":[{"underline-offset":["auto",dn,Re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[L]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...j(),tS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nS]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[L]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[L]}],"divide-style":[{divide:Q()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[dn,Re]}],"outline-w":[{outline:[dn,Un]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[L]}],"ring-offset-w":[{"ring-offset":[dn,Un]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Vn,iS]}],"shadow-color":[{shadow:[lo]}],opacity:[{opacity:[L]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[i]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Vn,Re]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[m]}],saturate:[{saturate:[z]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[L]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Re]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Y]}],"scale-x":[{"scale-x":[Y]}],"scale-y":[{"scale-y":[Y]}],rotate:[{rotate:[oo,Re]}],"translate-x":[{"translate-x":[he]}],"translate-y":[{"translate-y":[he]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[dn,Un,Kc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},uS=Uw(aS);function je(...e){return uS(Rv(e))}const cS=Mv("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Yr=te.forwardRef(({className:e,variant:t,size:r,...i},o)=>_.jsx("button",{className:je(cS({variant:t,size:r,className:e})),ref:o,...i}));Yr.displayName="Button";function hs({content:e,children:t,side:r="right"}){const[i,o]=te.useState(!1),l={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"}[r];return _.jsxs("div",{className:"relative inline-flex",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t,i&&_.jsx("div",{className:je("absolute z-50 whitespace-nowrap rounded-md border border-border bg-card px-2.5 py-1.5 text-xs text-card-foreground shadow-lg",l),children:e})]})}const hS=Mv("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function dS({className:e,variant:t,...r}){return _.jsx("div",{className:je(hS({variant:t}),e),...r})}const mn=te.forwardRef(({className:e,type:t,...r},i)=>_.jsx("input",{type:t,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:i,...r}));mn.displayName="Input";function fS({scans:e,activeId:t,onSelect:r,emptyMessage:i="No scans yet."}){return e.length===0?_.jsx("div",{className:"text-muted-foreground/60 text-xs text-center py-6",children:i}):_.jsx("div",{className:"space-y-1",children:e.map(o=>{const l=!!o.verify||!!o.ai&&!o.sniper,a=!!o.sniper||!!o.ai&&!o.verify,c=mS(o),f=gS(o),h=!!o.result||c>0||f>0;return _.jsxs("button",{onClick:()=>r(o),title:`${o.target} — ${o.status}`,"aria-current":o.id===t?"true":void 0,"aria-label":`${o.target}, ${o.status}, ${o.mode}, ${c} assets, ${f} loots`,className:`w-full text-left px-2.5 py-2 rounded-md transition-colors ${o.id===t?"bg-accent border border-cyber-600/30":"hover:bg-accent/50 border border-transparent"}`,children:[_.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_.jsx("span",{className:"text-xs font-mono text-foreground truncate",children:o.target}),_.jsx(pS,{status:o.status})]}),_.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[_.jsx("span",{className:"text-[10px] text-muted-foreground",children:o.mode}),h&&_.jsxs(_.Fragment,{children:[_.jsx(ag,{icon:_.jsx(xw,{className:"h-3 w-3"}),value:c,label:"assets",className:"text-cyber-700 dark:text-cyber-300"}),_.jsx(ag,{icon:_.jsx(Ew,{className:"h-3 w-3"}),value:f,label:"loots",className:f>0?"text-red-700 dark:text-red-300":"text-muted-foreground/60"})]}),l&&_.jsx("span",{className:"text-[10px] text-cyber-700 dark:text-cyber-300",children:"Verify"}),a&&_.jsx("span",{className:"text-[10px] text-red-700 dark:text-red-300",children:"Sniper"}),o.deep&&_.jsx("span",{className:"text-[10px] text-yellow-700 dark:text-yellow-300",children:"Deep"}),_.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:vS(o.created_at)})]})]},o.id)})})}function ag({className:e,icon:t,label:r,value:i}){return _.jsxs("span",{title:`${i} ${r}`,className:`inline-flex items-center gap-0.5 text-[10px] font-medium ${e}`,children:[t,_.jsx("span",{className:"font-mono",children:i})]})}function pS({status:e}){const t={queued:"bg-gray-500",running:"bg-blue-400 animate-pulse",completed:"bg-green-400",failed:"bg-red-400",canceled:"bg-yellow-400"};return _.jsx("span",{title:e,className:`w-2 h-2 rounded-full shrink-0 ${t[e]||t.queued}`})}function mS(e){var t,r;return((r=(t=e.result)==null?void 0:t.assets)==null?void 0:r.length)||0}function gS(e){const t=e.result;return t?t.loots&&t.loots.length>0?t.loots.filter(r=>r.kind.toLowerCase()!=="fingerprint").length:(t.assets||[]).reduce((r,i)=>r+(i.items||[]).filter(o=>o.kind==="loot"&&_S(o.data).toLowerCase()!=="fingerprint").length,0):0}function _S(e){const t=e==null?void 0:e.kind;return typeof t=="string"?t:""}function vS(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function yS({open:e,onToggle:t,scans:r,activeId:i,onSelectScan:o}){const[l,a]=te.useState(""),c=r.filter(g=>g.status==="running").length,f=l.trim().toLowerCase(),h=te.useMemo(()=>f?r.filter(g=>g.target.toLowerCase().includes(f)):r,[f,r]);return _.jsxs(_.Fragment,{children:[e&&_.jsx("button",{type:"button","aria-label":"Close sidebar overlay",onClick:t,className:"fixed inset-0 z-30 bg-background/60 backdrop-blur-[1px] md:hidden"}),_.jsxs("aside",{className:`flex flex-col border-r border-border bg-card/95 backdrop-blur-sm transition-all duration-200 ease-in-out shrink-0 md:bg-card/50 ${e?"fixed inset-y-0 left-0 z-40 w-72 shadow-xl md:relative md:inset-auto md:z-auto md:shadow-none":"w-12"}`,children:[_.jsx("div",{className:`flex items-center border-b border-border ${e?"p-3 gap-3":"p-2 flex-col gap-2"}`,children:e?_.jsxs(_.Fragment,{children:[_.jsx(ki,{className:"w-5 h-5 text-cyber-400 shrink-0"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("h1",{className:"text-sm font-bold text-cyber-700 dark:text-cyber-400",children:"AIScan"}),_.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Web console"})]}),_.jsx(Yr,{variant:"ghost",size:"icon",onClick:t,className:"h-7 w-7 text-muted-foreground","aria-label":"Collapse sidebar",children:_.jsx(bw,{className:"w-4 h-4"})})]}):_.jsx(_.Fragment,{children:_.jsx(hs,{content:"AIScan",side:"right",children:_.jsx("button",{type:"button",onClick:t,"aria-label":"Expand sidebar",className:"p-1 rounded-md hover:bg-accent transition-colors",children:_.jsx(ki,{className:"w-5 h-5 text-cyber-700 dark:text-cyber-400"})})})})}),e?_.jsxs("div",{className:"flex-1 overflow-auto p-3 animate-fade-in",children:[_.jsxs("div",{className:"flex items-center justify-between mb-3",children:[_.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"History"}),c>0&&_.jsxs(dS,{className:"border-blue-300 bg-blue-500/10 px-1.5 text-[10px] text-blue-700 dark:border-blue-800 dark:bg-blue-900/50 dark:text-blue-400",children:[c," running"]})]}),_.jsxs("div",{className:"relative mb-3",children:[_.jsx(Ev,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),_.jsx(mn,{value:l,onChange:g=>a(g.target.value),placeholder:"Search targets","aria-label":"Search scan targets",className:"h-8 pl-8 pr-8 text-xs"}),l&&_.jsx("button",{type:"button","aria-label":"Clear target search",onClick:()=>a(""),className:"absolute right-1.5 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",children:_.jsx(jo,{className:"h-3 w-3"})})]}),_.jsx(fS,{scans:h,activeId:i,onSelect:o,emptyMessage:f?"No matching targets.":"No scans yet."})]}):_.jsxs("div",{className:"flex flex-col items-center gap-2 pt-3",children:[_.jsx(hs,{content:`${r.length} scans`,side:"right",children:_.jsxs("button",{type:"button",onClick:t,"aria-label":`${r.length} scans in history`,className:"p-1.5 rounded-md hover:bg-accent transition-colors relative",children:[_.jsx(wv,{className:"w-4 h-4 text-muted-foreground"}),r.length>0&&_.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-3.5 h-3.5 bg-cyber-600 rounded-full text-[8px] font-bold flex items-center justify-center text-white",children:r.length>9?"9+":r.length})]})}),_.jsx(hs,{content:"Expand sidebar",side:"right",children:_.jsx(Yr,{variant:"ghost",size:"icon",onClick:t,className:"h-7 w-7 text-muted-foreground","aria-label":"Expand sidebar",children:_.jsx(kw,{className:"w-3.5 h-3.5"})})})]})]})]})}function xS({value:e,onValueChange:t,children:r,className:i,disabled:o,ariaLabel:l}){return _.jsx("div",{role:"group","aria-label":l,className:je("inline-flex items-center rounded-md border border-input bg-secondary/50 p-0.5",i),children:te.Children.map(r,a=>te.isValidElement(a)?te.cloneElement(a,{active:a.props.value===e,onClick:()=>!o&&t(a.props.value),disabled:o}):a)})}function ug({children:e,className:t,active:r,onClick:i,disabled:o}){return _.jsx("button",{type:"button",onClick:i,disabled:o,className:je("inline-flex items-center justify-center rounded-sm px-3 py-1 text-xs font-medium transition-all",r?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground",o&&"opacity-50 cursor-not-allowed",t),children:e})}function wS({onSubmit:e,disabled:t,analysisAvailable:r,status:i,actions:o}){const[l,a]=te.useState(""),[c,f]=te.useState("quick"),[h,g]=te.useState({verify:!1,sniper:!1,deep:!1});te.useEffect(()=>{r||g({verify:!1,sniper:!1,deep:!1})},[r]);const m=S=>{S.preventDefault(),l.trim()&&e(l.trim(),c,h)},x=S=>{g(k=>({...k,[S]:!k[S]}))},y=[{key:"verify",label:"Verify",icon:_.jsx(gv,{className:"h-4 w-4"}),activeClass:"border-cyber-500/40 bg-cyber-500/15 text-cyber-700 dark:text-cyber-300"},{key:"sniper",label:"Sniper",icon:_.jsx(Wa,{className:"h-4 w-4"}),activeClass:"border-red-400/40 bg-red-400/15 text-red-700 dark:text-red-300"},{key:"deep",label:"Deep",icon:_.jsx(Ua,{className:"h-4 w-4"}),activeClass:"border-yellow-400/40 bg-yellow-400/15 text-yellow-700 dark:text-yellow-300"}];return _.jsxs("form",{onSubmit:m,className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-2 sm:flex sm:flex-wrap sm:gap-3",children:[_.jsxs("div",{className:"relative col-start-1 row-start-1 min-w-0 sm:min-w-[16rem] sm:flex-1",children:[_.jsx(Ev,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),_.jsx(mn,{value:l,onChange:S=>a(S.target.value),placeholder:"Target — IP, hostname, or URL",disabled:t,autoFocus:!0,"aria-label":"Scan target",className:"pl-9 h-10 font-mono text-sm bg-secondary/50 border-border focus-visible:ring-cyber-500/50"})]}),_.jsxs("div",{className:"col-span-full row-start-2 flex min-w-0 items-center gap-2 sm:contents",children:[_.jsxs(xS,{value:c,onValueChange:f,disabled:t,ariaLabel:"Scan mode",children:[_.jsx(ug,{value:"quick",children:"Quick"}),_.jsx(ug,{value:"full",children:"Full"})]}),_.jsx("div",{className:"inline-flex min-w-0 items-center gap-1.5 sm:gap-2",children:y.map(S=>{const k=h[S.key],E=t||!r;return _.jsxs("button",{type:"button","aria-pressed":k,"aria-label":`${S.label} analysis`,title:r?S.label:"LLM Offline",disabled:E,onClick:()=>x(S.key),className:je("inline-flex h-10 w-10 shrink-0 items-center justify-center gap-2 rounded-md border px-0 text-xs font-medium transition-colors sm:w-auto sm:px-3",k?S.activeClass:"border-input bg-secondary/50 text-muted-foreground hover:text-foreground",E&&"cursor-not-allowed opacity-50"),children:[S.icon,_.jsx("span",{className:"hidden sm:inline",children:S.label})]},S.key)})}),_.jsxs(Yr,{type:"submit",disabled:t||!l.trim(),"aria-label":t?"Scanning target":"Start scan",className:"h-10 w-10 shrink-0 px-0 bg-cyber-600 text-white hover:bg-cyber-500 sm:w-auto sm:px-5",children:[t?_.jsx(Na,{className:"w-4 h-4 animate-spin"}):_.jsx(Cw,{className:"w-4 h-4"}),_.jsx("span",{className:"hidden sm:inline",children:t?"Scanning":"Scan"})]})]}),_.jsxs("div",{className:"col-start-2 row-start-1 flex items-center justify-end gap-2 sm:contents",children:[i,o]})]})}const cg=["Port Scan","Web Probe","Credentials","Vulns","Analysis"];function SS(e){for(let t=e.length-1;t>=0;t--){const r=e[t].toLowerCase();if(r.includes("[ai")||r.includes("sniper")||r.includes("verify")||r.includes("[deep"))return 4;if(r.includes("[vuln")||r.includes("neutron"))return 3;if(r.includes("[risk")||r.includes("zombie")||r.includes("weakpass"))return 2;if(r.includes("[web")||r.includes("[fingerprint")||r.includes("spray"))return 1;if(r.includes("[service")||r.includes("gogo"))return 0}return 0}function bS({lines:e,status:t,collapsed:r,onToggleCollapse:i}){const o=te.useRef(null),l=SS(e),a=t==="running";return te.useEffect(()=>{o.current&&!r&&(o.current.scrollTop=o.current.scrollHeight)},[e,r]),_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"space-y-1.5",children:[_.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-secondary",children:cg.map((c,f)=>_.jsx("div",{className:`flex-1 transition-all duration-500 ${f0?"ml-px":""}`},f))}),_.jsx("div",{className:"flex justify-between px-0.5",children:cg.map((c,f)=>_.jsx("span",{className:`text-[10px] transition-colors ${f<=l?"text-muted-foreground":"text-muted-foreground/40"} ${f===l&&a?"text-cyber-400":""}`,children:c},f))})]}),_.jsxs("div",{className:"rounded-lg border border-border bg-card/50 overflow-hidden",children:[_.jsxs("button",{onClick:i,className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground hover:bg-accent/50 transition-colors",children:[r?_.jsx($a,{className:"w-3.5 h-3.5"}):_.jsx(dw,{className:"w-3.5 h-3.5"}),_.jsx(Lv,{className:"w-3.5 h-3.5"}),_.jsx("span",{children:"Scan Output"}),e.length>0&&_.jsxs("span",{className:"text-muted-foreground/60 ml-auto",children:[e.length," lines"]})]}),!r&&_.jsx("div",{ref:o,className:"px-3 pb-3 max-h-64 overflow-y-auto font-mono text-xs leading-relaxed",children:e.length===0?_.jsx("div",{className:"text-muted-foreground/60 flex items-center gap-2 py-2",children:_.jsx("span",{className:"animate-pulse",children:"Initializing scan..."})}):e.map((c,f)=>_.jsx("div",{className:kS(c),children:c},f))})]})]})}function kS(e){const t=e.toLowerCase();return t.includes("[vuln")||t.includes("critical")?"text-red-400":t.includes("[risk")||t.includes("weakpass")?"text-orange-400":t.includes("[ai")||t.includes("verified")||t.includes("sniper")||t.includes("[deep")?"text-purple-400":t.includes("[fingerprint")?"text-yellow-400":t.includes("[web")||t.includes("[service")?"text-green-400":t.includes("[summary")||t.includes("completed")?"text-cyan-400":t.includes("error")||t.includes("failed")?"text-red-500":"text-muted-foreground/80"}function CS(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const ES=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LS={};function hg(e,t){return(LS.jsx?NS:ES).test(e)}const PS=/[ \t\n\f\r]/g;function RS(e){return typeof e=="object"?e.type==="text"?dg(e.value):!1:dg(e)}function dg(e){return e.replace(PS,"")===""}class zo{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}zo.prototype.normal={};zo.prototype.property={};zo.prototype.space=void 0;function jv(e,t){const r={},i={};for(const o of e)Object.assign(r,o.property),Object.assign(i,o.normal);return new zo(r,i,t)}function Nh(e){return e.toLowerCase()}class sr{constructor(t,r){this.attribute=r,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let MS=0;const Ne=Li(),pt=Li(),Lh=Li(),ne=Li(),Ke=Li(),Si=Li(),pr=Li();function Li(){return 2**++MS}const Ph=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:pt,commaOrSpaceSeparated:pr,commaSeparated:Si,number:ne,overloadedBoolean:Lh,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),qc=Object.keys(Ph);class Nd extends sr{constructor(t,r,i,o){let l=-1;if(super(t,r),fg(this,"space",o),typeof i=="number")for(;++l4&&r.slice(0,4)==="data"&&IS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(pg,OS);i="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!pg.test(l)){let a=l.replace(BS,zS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=Nd}return new o(i,t)}function zS(e){return"-"+e.toLowerCase()}function OS(e){return e.charAt(1).toUpperCase()}const FS=jv([zv,TS,Hv,$v,Wv],"html"),Ld=jv([zv,DS,Hv,$v,Wv],"svg");function HS(e){return e.join(" ").trim()}var ns={},Yc,mg;function $S(){if(mg)return Yc;mg=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,f=` +`,h="/",g="*",m="",x="comment",y="declaration";function S(E,L){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];L=L||{};var W=1,z=1;function Y(H){var j=H.match(t);j&&(W+=j.length);var Q=H.lastIndexOf(f);z=~Q?H.length-Q:z+H.length}function U(){var H={line:W,column:z};return function(j){return j.position=new T(H),fe(),j}}function T(H){this.start=H,this.end={line:W,column:z},this.source=L.source}T.prototype.content=E;function se(H){var j=new Error(L.source+":"+W+":"+z+": "+H);if(j.reason=H,j.filename=L.source,j.line=W,j.column=z,j.source=E,!L.silent)throw j}function he(H){var j=H.exec(E);if(j){var Q=j[0];return Y(Q),E=E.slice(Q.length),j}}function fe(){he(r)}function F(H){var j;for(H=H||[];j=K();)j!==!1&&H.push(j);return H}function K(){var H=U();if(!(h!=E.charAt(0)||g!=E.charAt(1))){for(var j=2;m!=E.charAt(j)&&(g!=E.charAt(j)||h!=E.charAt(j+1));)++j;if(j+=2,m===E.charAt(j-1))return se("End of comment missing");var Q=E.slice(2,j-2);return z+=2,Y(Q),E=E.slice(j),z+=2,H({type:x,comment:Q})}}function A(){var H=U(),j=he(i);if(j){if(K(),!he(o))return se("property missing ':'");var Q=he(l),re=H({type:y,property:k(j[0].replace(e,m)),value:Q?k(Q[0].replace(e,m)):m});return he(a),re}}function D(){var H=[];F(H);for(var j;j=A();)j!==!1&&(H.push(j),F(H));return H}return fe(),D()}function k(E){return E?E.replace(c,m):m}return Yc=S,Yc}var gg;function WS(){if(gg)return ns;gg=1;var e=ns&&ns.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ns,"__esModule",{value:!0}),ns.default=r;const t=e($S());function r(i,o){let l=null;if(!i||typeof i!="string")return l;const a=(0,t.default)(i),c=typeof o=="function";return a.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;c?o(h,g,f):g&&(l=l||{},l[h]=g)}),l}return ns}var ao={},_g;function US(){if(_g)return ao;_g=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(h){return!h||r.test(h)||e.test(h)},a=function(h,g){return g.toUpperCase()},c=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(o,c):h=h.replace(i,c),h.replace(t,a))};return ao.camelCase=f,ao}var uo,vg;function VS(){if(vg)return uo;vg=1;var e=uo&&uo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(WS()),r=US();function i(o,l){var a={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(a[(0,r.camelCase)(c,l)]=f)}),a}return i.default=i,uo=i,uo}var KS=VS();const qS=Ha(KS),Uv=Vv("end"),Pd=Vv("start");function Vv(e){return t;function t(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function YS(e){const t=Pd(e),r=Uv(e);if(t&&r)return{start:t,end:r}}function Co(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yg(e.position):"start"in e||"end"in e?yg(e):"line"in e||"column"in e?Rh(e):""}function Rh(e){return xg(e&&e.line)+":"+xg(e&&e.column)}function yg(e){return Rh(e&&e.start)+"-"+Rh(e&&e.end)}function xg(e){return e&&typeof e=="number"?e:1}class Ut extends Error{constructor(t,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let o="",l={},a=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?o=t:!l.cause&&t&&(a=!0,o=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?l.ruleId=i:(l.source=i.slice(0,f),l.ruleId=i.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Co(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ut.prototype.file="";Ut.prototype.name="";Ut.prototype.reason="";Ut.prototype.message="";Ut.prototype.stack="";Ut.prototype.column=void 0;Ut.prototype.line=void 0;Ut.prototype.ancestors=void 0;Ut.prototype.cause=void 0;Ut.prototype.fatal=void 0;Ut.prototype.place=void 0;Ut.prototype.ruleId=void 0;Ut.prototype.source=void 0;const Rd={}.hasOwnProperty,XS=new Map,GS=/[A-Z]/g,QS=new Set(["table","tbody","thead","tfoot","tr"]),JS=new Set(["td","th"]),Kv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=lb(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=ob(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ld:FS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=qv(o,e,void 0);return l&&typeof l!="string"?l:o.create(e,o.Fragment,{children:l||void 0},void 0)}function qv(e,t,r){if(t.type==="element")return eb(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nb(e,t,r);if(t.type==="mdxjsEsm")return rb(e,t);if(t.type==="root")return ib(e,t,r);if(t.type==="text")return sb(e,t)}function eb(e,t,r){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Ld,e.schema=o),e.ancestors.push(t);const l=Xv(e,t.tagName,!1),a=ab(e,t);let c=Td(e,t);return QS.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!RS(f):!0})),Yv(e,a,l,t),Md(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,r)}function tb(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ro(e,t.position)}function rb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ro(e,t.position)}function nb(e,t,r){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Ld,e.schema=o),e.ancestors.push(t);const l=t.name===null?e.Fragment:Xv(e,t.name,!0),a=ub(e,t),c=Td(e,t);return Yv(e,a,l,t),Md(a,c),e.ancestors.pop(),e.schema=i,e.create(t,l,a,r)}function ib(e,t,r){const i={};return Md(i,Td(e,t)),e.create(t,e.Fragment,i,r)}function sb(e,t){return t.value}function Yv(e,t,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=i)}function Md(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function ob(e,t,r){return i;function i(o,l,a,c){const h=Array.isArray(a.children)?r:t;return c?h(l,a,c):h(l,a)}}function lb(e,t){return r;function r(i,o,l,a){const c=Array.isArray(l.children),f=Pd(i);return t(o,l,a,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function ab(e,t){const r={};let i,o;for(o in t.properties)if(o!=="children"&&Rd.call(t.properties,o)){const l=cb(e,o,t.properties[o]);if(l){const[a,c]=l;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&JS.has(t.tagName)?i=c:r[a]=c}}if(i){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function ub(e,t){const r={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const l=i.data.estree.body[0];l.type;const a=l.expression;a.type;const c=a.properties[0];c.type,Object.assign(r,e.evaluater.evaluateExpression(c.argument))}else Ro(e,t.position);else{const o=i.name;let l;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else Ro(e,t.position);else l=i.value===null?!0:i.value;r[o]=l}return r}function Td(e,t){const r=[];let i=-1;const o=e.passKeys?new Map:XS;for(;++io?0:o+t:t=t>o?o:t,r=r>0?r:0,i.length<1e4)a=Array.from(i),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);l0?(mr(e,e.length,0,t),e):t}const bg={}.hasOwnProperty;function Qv(e){const t={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function jr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yt=ei(/[A-Za-z]/),$t=ei(/[\dA-Za-z]/),yb=ei(/[#-'*+\--9=?A-Z^-~]/);function Ra(e){return e!==null&&(e<32||e===127)}const Mh=ei(/\d/),xb=ei(/[\dA-Fa-f]/),wb=ei(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function qe(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const Va=ei(new RegExp("\\p{P}|\\p{S}","u")),Ci=ei(/\s/);function ei(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function _s(e){const t=[];let r=-1,i=0,o=0;for(;++r55295&&l<57344){const c=e.charCodeAt(r+1);l<56320&&c>56319&&c<57344?(a=String.fromCharCode(l,c),o=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(i,r),encodeURIComponent(a)),i=r+o+1,a=""),o&&(r+=o,o=0)}return t.join("")+e.slice(i)}function Oe(e,t,r,i){const o=i?i-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(f){return Ie(f)?(e.enter(r),c(f)):t(f)}function c(f){return Ie(f)&&l++a))return;const se=t.events.length;let he=se,fe,F;for(;he--;)if(t.events[he][0]==="exit"&&t.events[he][1].type==="chunkFlow"){if(fe){F=t.events[he][1].end;break}fe=!0}for(L(i),T=se;Tz;){const U=r[Y];t.containerState=U[1],U[0].exit.call(t,e)}r.length=z}function W(){o.write([null]),l=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Eb(e,t,r){return Oe(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ds(e){if(e===null||qe(e)||Ci(e))return 1;if(Va(e))return 2}function Ka(e,t,r){const i=[];let o=-1;for(;++o1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const m={...e[i][1].end},x={...e[r][1].start};Cg(m,-f),Cg(x,f),a={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},l={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},o={type:f>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[i][1].end={...a.start},e[r][1].start={...c.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=Er(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=Er(h,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",l,t]]),h=Er(h,Ka(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),h=Er(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,h=Er(h,[["enter",e[r][1],t],["exit",e[r][1],t]])):g=0,mr(e,i-1,r-i+3,h),r=i+h.length-g-2;break}}for(r=-1;++r0&&Ie(T)?Oe(e,W,"linePrefix",l+1)(T):W(T)}function W(T){return T===null||be(T)?e.check(Eg,k,Y)(T):(e.enter("codeFlowValue"),z(T))}function z(T){return T===null||be(T)?(e.exit("codeFlowValue"),W(T)):(e.consume(T),z)}function Y(T){return e.exit("codeFenced"),t(T)}function U(T,se,he){let fe=0;return F;function F(j){return T.enter("lineEnding"),T.consume(j),T.exit("lineEnding"),K}function K(j){return T.enter("codeFencedFence"),Ie(j)?Oe(T,A,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):A(j)}function A(j){return j===c?(T.enter("codeFencedFenceSequence"),D(j)):he(j)}function D(j){return j===c?(fe++,T.consume(j),D):fe>=a?(T.exit("codeFencedFenceSequence"),Ie(j)?Oe(T,H,"whitespace")(j):H(j)):he(j)}function H(j){return j===null||be(j)?(T.exit("codeFencedFence"),se(j)):he(j)}}}function zb(e,t,r){const i=this;return o;function o(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return i.parser.lazy[i.now().line]?r(a):t(a)}}const Gc={name:"codeIndented",tokenize:Fb},Ob={partial:!0,tokenize:Hb};function Fb(e,t,r){const i=this;return o;function o(h){return e.enter("codeIndented"),Oe(e,l,"linePrefix",5)(h)}function l(h){const g=i.events[i.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?a(h):r(h)}function a(h){return h===null?f(h):be(h)?e.attempt(Ob,a,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||be(h)?(e.exit("codeFlowValue"),a(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function Hb(e,t,r){const i=this;return o;function o(a){return i.parser.lazy[i.now().line]?r(a):be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):Oe(e,l,"linePrefix",5)(a)}function l(a){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):be(a)?o(a):r(a)}}const $b={name:"codeText",previous:Ub,resolve:Wb,tokenize:Vb};function Wb(e){let t=e.length-4,r=3,i,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=r;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,r,i){const o=r||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&co(this.left,i),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),co(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),co(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(i.parser.constructs.flow,r,t)(a)}}function n0(e,t,r,i,o,l,a,c,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return m;function m(L){return L===60?(e.enter(i),e.enter(o),e.enter(l),e.consume(L),e.exit(l),x):L===null||L===32||L===41||Ra(L)?r(L):(e.enter(i),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(L))}function x(L){return L===62?(e.enter(l),e.consume(L),e.exit(l),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(L))}function y(L){return L===62?(e.exit("chunkString"),e.exit(c),x(L)):L===null||L===60||be(L)?r(L):(e.consume(L),L===92?S:y)}function S(L){return L===60||L===62||L===92?(e.consume(L),y):y(L)}function k(L){return!g&&(L===null||L===41||qe(L))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(i),t(L)):g999||y===null||y===91||y===93&&!f||y===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?r(y):y===93?(e.exit(l),e.enter(o),e.consume(y),e.exit(o),e.exit(i),t):be(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||be(y)||c++>999?(e.exit("chunkString"),g(y)):(e.consume(y),f||(f=!Ie(y)),y===92?x:m)}function x(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function s0(e,t,r,i,o,l){let a;return c;function c(x){return x===34||x===39||x===40?(e.enter(i),e.enter(o),e.consume(x),e.exit(o),a=x===40?41:x,f):r(x)}function f(x){return x===a?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),t):(e.enter(l),h(x))}function h(x){return x===a?(e.exit(l),f(a)):x===null?r(x):be(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Oe(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===a||x===null||be(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?m:g)}function m(x){return x===a||x===92?(e.consume(x),g):g(x)}}function Eo(e,t){let r;return i;function i(o){return be(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,i):Ie(o)?Oe(e,i,r?"linePrefix":"lineSuffix")(o):t(o)}}const Zb={name:"definition",tokenize:tk},ek={partial:!0,tokenize:rk};function tk(e,t,r){const i=this;let o;return l;function l(y){return e.enter("definition"),a(y)}function a(y){return i0.call(i,e,c,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return o=jr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):r(y)}function f(y){return qe(y)?Eo(e,h)(y):h(y)}function h(y){return n0(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(ek,m,m)(y)}function m(y){return Ie(y)?Oe(e,x,"whitespace")(y):x(y)}function x(y){return y===null||be(y)?(e.exit("definition"),i.parser.defined.push(o),t(y)):r(y)}}function rk(e,t,r){return i;function i(c){return qe(c)?Eo(e,o)(c):r(c)}function o(c){return s0(e,l,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Ie(c)?Oe(e,a,"whitespace")(c):a(c)}function a(c){return c===null||be(c)?t(c):r(c)}}const nk={name:"hardBreakEscape",tokenize:ik};function ik(e,t,r){return i;function i(l){return e.enter("hardBreakEscape"),e.consume(l),o}function o(l){return be(l)?(e.exit("hardBreakEscape"),t(l)):r(l)}}const sk={name:"headingAtx",resolve:ok,tokenize:lk};function ok(e,t){let r=e.length-2,i=3,o,l;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},l={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},mr(e,i,r-i+1,[["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t]])),e}function lk(e,t,r){let i=0;return o;function o(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),a(g)}function a(g){return g===35&&i++<6?(e.consume(g),a):g===null||qe(g)?(e.exit("atxHeadingSequence"),c(g)):r(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||be(g)?(e.exit("atxHeading"),t(g)):Ie(g)?Oe(e,c,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),c(g))}function h(g){return g===null||g===35||qe(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),h)}}const ak=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lg=["pre","script","style","textarea"],uk={concrete:!0,name:"htmlFlow",resolveTo:dk,tokenize:fk},ck={partial:!0,tokenize:mk},hk={partial:!0,tokenize:pk};function dk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function fk(e,t,r){const i=this;let o,l,a,c,f;return h;function h(C){return g(C)}function g(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),m}function m(C){return C===33?(e.consume(C),x):C===47?(e.consume(C),l=!0,k):C===63?(e.consume(C),o=3,i.interrupt?t:b):Yt(C)?(e.consume(C),a=String.fromCharCode(C),E):r(C)}function x(C){return C===45?(e.consume(C),o=2,y):C===91?(e.consume(C),o=5,c=0,S):Yt(C)?(e.consume(C),o=4,i.interrupt?t:b):r(C)}function y(C){return C===45?(e.consume(C),i.interrupt?t:b):r(C)}function S(C){const ae="CDATA[";return C===ae.charCodeAt(c++)?(e.consume(C),c===ae.length?i.interrupt?t:A:S):r(C)}function k(C){return Yt(C)?(e.consume(C),a=String.fromCharCode(C),E):r(C)}function E(C){if(C===null||C===47||C===62||qe(C)){const ae=C===47,ve=a.toLowerCase();return!ae&&!l&&Lg.includes(ve)?(o=1,i.interrupt?t(C):A(C)):ak.includes(a.toLowerCase())?(o=6,ae?(e.consume(C),L):i.interrupt?t(C):A(C)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(C):l?W(C):z(C))}return C===45||$t(C)?(e.consume(C),a+=String.fromCharCode(C),E):r(C)}function L(C){return C===62?(e.consume(C),i.interrupt?t:A):r(C)}function W(C){return Ie(C)?(e.consume(C),W):F(C)}function z(C){return C===47?(e.consume(C),F):C===58||C===95||Yt(C)?(e.consume(C),Y):Ie(C)?(e.consume(C),z):F(C)}function Y(C){return C===45||C===46||C===58||C===95||$t(C)?(e.consume(C),Y):U(C)}function U(C){return C===61?(e.consume(C),T):Ie(C)?(e.consume(C),U):z(C)}function T(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),f=C,se):Ie(C)?(e.consume(C),T):he(C)}function se(C){return C===f?(e.consume(C),f=null,fe):C===null||be(C)?r(C):(e.consume(C),se)}function he(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||qe(C)?U(C):(e.consume(C),he)}function fe(C){return C===47||C===62||Ie(C)?z(C):r(C)}function F(C){return C===62?(e.consume(C),K):r(C)}function K(C){return C===null||be(C)?A(C):Ie(C)?(e.consume(C),K):r(C)}function A(C){return C===45&&o===2?(e.consume(C),Q):C===60&&o===1?(e.consume(C),re):C===62&&o===4?(e.consume(C),P):C===63&&o===3?(e.consume(C),b):C===93&&o===5?(e.consume(C),q):be(C)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(ck,V,D)(C)):C===null||be(C)?(e.exit("htmlFlowData"),D(C)):(e.consume(C),A)}function D(C){return e.check(hk,H,V)(C)}function H(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),j}function j(C){return C===null||be(C)?D(C):(e.enter("htmlFlowData"),A(C))}function Q(C){return C===45?(e.consume(C),b):A(C)}function re(C){return C===47?(e.consume(C),a="",I):A(C)}function I(C){if(C===62){const ae=a.toLowerCase();return Lg.includes(ae)?(e.consume(C),P):A(C)}return Yt(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),I):A(C)}function q(C){return C===93?(e.consume(C),b):A(C)}function b(C){return C===62?(e.consume(C),P):C===45&&o===2?(e.consume(C),b):A(C)}function P(C){return C===null||be(C)?(e.exit("htmlFlowData"),V(C)):(e.consume(C),P)}function V(C){return e.exit("htmlFlow"),t(C)}}function pk(e,t,r){const i=this;return o;function o(a){return be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):r(a)}function l(a){return i.parser.lazy[i.now().line]?r(a):t(a)}}function mk(e,t,r){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Oo,t,r)}}const gk={name:"htmlText",tokenize:_k};function _k(e,t,r){const i=this;let o,l,a;return c;function c(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),f}function f(b){return b===33?(e.consume(b),h):b===47?(e.consume(b),U):b===63?(e.consume(b),z):Yt(b)?(e.consume(b),he):r(b)}function h(b){return b===45?(e.consume(b),g):b===91?(e.consume(b),l=0,S):Yt(b)?(e.consume(b),W):r(b)}function g(b){return b===45?(e.consume(b),y):r(b)}function m(b){return b===null?r(b):b===45?(e.consume(b),x):be(b)?(a=m,re(b)):(e.consume(b),m)}function x(b){return b===45?(e.consume(b),y):m(b)}function y(b){return b===62?Q(b):b===45?x(b):m(b)}function S(b){const P="CDATA[";return b===P.charCodeAt(l++)?(e.consume(b),l===P.length?k:S):r(b)}function k(b){return b===null?r(b):b===93?(e.consume(b),E):be(b)?(a=k,re(b)):(e.consume(b),k)}function E(b){return b===93?(e.consume(b),L):k(b)}function L(b){return b===62?Q(b):b===93?(e.consume(b),L):k(b)}function W(b){return b===null||b===62?Q(b):be(b)?(a=W,re(b)):(e.consume(b),W)}function z(b){return b===null?r(b):b===63?(e.consume(b),Y):be(b)?(a=z,re(b)):(e.consume(b),z)}function Y(b){return b===62?Q(b):z(b)}function U(b){return Yt(b)?(e.consume(b),T):r(b)}function T(b){return b===45||$t(b)?(e.consume(b),T):se(b)}function se(b){return be(b)?(a=se,re(b)):Ie(b)?(e.consume(b),se):Q(b)}function he(b){return b===45||$t(b)?(e.consume(b),he):b===47||b===62||qe(b)?fe(b):r(b)}function fe(b){return b===47?(e.consume(b),Q):b===58||b===95||Yt(b)?(e.consume(b),F):be(b)?(a=fe,re(b)):Ie(b)?(e.consume(b),fe):Q(b)}function F(b){return b===45||b===46||b===58||b===95||$t(b)?(e.consume(b),F):K(b)}function K(b){return b===61?(e.consume(b),A):be(b)?(a=K,re(b)):Ie(b)?(e.consume(b),K):fe(b)}function A(b){return b===null||b===60||b===61||b===62||b===96?r(b):b===34||b===39?(e.consume(b),o=b,D):be(b)?(a=A,re(b)):Ie(b)?(e.consume(b),A):(e.consume(b),H)}function D(b){return b===o?(e.consume(b),o=void 0,j):b===null?r(b):be(b)?(a=D,re(b)):(e.consume(b),D)}function H(b){return b===null||b===34||b===39||b===60||b===61||b===96?r(b):b===47||b===62||qe(b)?fe(b):(e.consume(b),H)}function j(b){return b===47||b===62||qe(b)?fe(b):r(b)}function Q(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):r(b)}function re(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),I}function I(b){return Ie(b)?Oe(e,q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):q(b)}function q(b){return e.enter("htmlTextData"),a(b)}}const Bd={name:"labelEnd",resolveAll:wk,resolveTo:Sk,tokenize:bk},vk={tokenize:kk},yk={tokenize:Ck},xk={tokenize:Ek};function wk(e){let t=-1;const r=[];for(;++t=3&&(h===null||be(h))?(e.exit("thematicBreak"),t(h)):r(h)}function f(h){return h===o?(e.consume(h),i++,f):(e.exit("thematicBreakSequence"),Ie(h)?Oe(e,c,"whitespace")(h):c(h))}}const ir={continuation:{tokenize:Ik},exit:zk,name:"list",tokenize:Bk},Dk={partial:!0,tokenize:Ok},Ak={partial:!0,tokenize:jk};function Bk(e,t,r){const i=this,o=i.events[i.events.length-1];let l=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return c;function c(y){const S=i.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||y===i.containerState.marker:Mh(y)){if(i.containerState.type||(i.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(xa,r,h)(y):h(y);if(!i.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return r(y)}function f(y){return Mh(y)&&++a<10?(e.consume(y),f):(!i.interrupt||a<2)&&(i.containerState.marker?y===i.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):r(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||y,e.check(Oo,i.interrupt?r:g,e.attempt(Dk,x,m))}function g(y){return i.containerState.initialBlankLine=!0,l++,x(y)}function m(y){return Ie(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):r(y)}function x(y){return i.containerState.size=l+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function Ik(e,t,r){const i=this;return i.containerState._closeFlow=void 0,e.check(Oo,o,l);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Oe(e,t,"listItemIndent",i.containerState.size+1)(c)}function l(c){return i.containerState.furtherBlankLines||!Ie(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Ak,t,a)(c))}function a(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Oe(e,e.attempt(ir,t,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function jk(e,t,r){const i=this;return Oe(e,o,"listItemIndent",i.containerState.size+1);function o(l){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?t(l):r(l)}}function zk(e){e.exit(this.containerState.type)}function Ok(e,t,r){const i=this;return Oe(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(l){const a=i.events[i.events.length-1];return!Ie(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):r(l)}}const Pg={name:"setextUnderline",resolveTo:Fk,tokenize:Hk};function Fk(e,t){let r=e.length,i,o,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!l&&e[r][1].type==="definition"&&(l=r);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",l?(e.splice(o,0,["enter",a,t]),e.splice(l+1,0,["exit",e[i][1],t]),e[i][1].end={...e[l][1].end}):e[i][1]=a,e.push(["exit",a,t]),e}function Hk(e,t,r){const i=this;let o;return l;function l(h){let g=i.events.length,m;for(;g--;)if(i.events[g][1].type!=="lineEnding"&&i.events[g][1].type!=="linePrefix"&&i.events[g][1].type!=="content"){m=i.events[g][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),o=h,a(h)):r(h)}function a(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===o?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ie(h)?Oe(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||be(h)?(e.exit("setextHeadingLine"),t(h)):r(h)}}const $k={tokenize:Wk};function Wk(e){const t=this,r=e.attempt(Oo,i,e.attempt(this.parser.constructs.flowInitial,o,Oe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Yb,o)),"linePrefix")));return r;function i(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const Uk={resolveAll:l0()},Vk=o0("string"),Kk=o0("text");function o0(e){return{resolveAll:l0(e==="text"?qk:void 0),tokenize:t};function t(r){const i=this,o=this.parser.constructs[e],l=r.attempt(o,a,c);return a;function a(g){return h(g)?l(g):c(g)}function c(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),f}function f(g){return h(g)?(r.exit("data"),l(g)):(r.consume(g),f)}function h(g){if(g===null)return!0;const m=o[g];let x=-1;if(m)for(;++x-1){const c=a[0];typeof c=="string"?a[0]=c.slice(i):a.shift()}l>0&&a.push(e[o].slice(0,l))}return a}function oC(e,t){let r=-1;const i=[];let o;for(;++r0){const Mt=ke.tokenStack[ke.tokenStack.length-1];(Mt[1]||Mg).call(ke,void 0,Mt[0])}for(oe.position={start:Un(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Un(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He0&&(i.className=["language-"+o[0]]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function gC(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _C(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vC(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=_s(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let a,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=l+1,c+=1,e.footnoteCounts.set(i,c);const f={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function yC(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xC(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function l0(e,t){const r=t.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),l=o[0];l&&l.type==="text"?l.value="["+l.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=i:o.push({type:"text",value:i}),o}function wC(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return l0(e,t);const o={src:_s(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const l={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,l),e.applyData(t,l)}function SC(e,t){const r={src:_s(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function bC(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,i),e.applyData(t,i)}function kC(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return l0(e,t);const o={href:_s(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const l={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function CC(e,t){const r={href:_s(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function EC(e,t,r){const i=e.all(t),o=r?NC(r):a0(t),l={},a=[];if(typeof t.checked=="boolean"){const g=i[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c0){const Mt=ke.tokenStack[ke.tokenStack.length-1];(Mt[1]||Mg).call(ke,void 0,Mt[0])}for(le.position={start:Kn(X.length>0?X[0][1].start:{line:1,column:1,offset:0}),end:Kn(X.length>0?X[X.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He0&&(i.className=["language-"+o[0]]);let l={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function xC(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wC(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SC(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=_s(i.toLowerCase()),l=e.footnoteOrder.indexOf(i);let a,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),a=e.footnoteOrder.length):a=l+1,c+=1,e.footnoteCounts.set(i,c);const f={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function bC(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function kC(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function c0(e,t){const r=t.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),l=o[0];l&&l.type==="text"?l.value="["+l.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=i:o.push({type:"text",value:i}),o}function CC(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return c0(e,t);const o={src:_s(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const l={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,l),e.applyData(t,l)}function EC(e,t){const r={src:_s(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function NC(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,i),e.applyData(t,i)}function LC(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return c0(e,t);const o={href:_s(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const l={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function PC(e,t){const r={href:_s(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function RC(e,t,r){const i=e.all(t),o=r?MC(r):h0(t),l={},a=[];if(typeof t.checked=="boolean"){const g=i[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c1}function LC(e,t){const r={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},c=Pd(t.children[1]),f=Hv(t.children[t.children.length-1]);c&&f&&(a.position={start:c,end:f}),o.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)}function TC(e,t,r){const i=r?r.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",a=r&&r.type==="table"?r.align:void 0,c=a?a.length:t.children.length;let f=-1;const h=[];for(;++f0,!0),i[0]),o=i.index+i[0].length,i=r.exec(t);return l.push(Ag(t.slice(o),o>0,!1)),l.join("")}function Ag(e,t,r){let i=0,o=e.length;if(t){let l=e.codePointAt(i);for(;l===Dg||l===Tg;)i++,l=e.codePointAt(i)}if(r){let l=e.codePointAt(o-1);for(;l===Dg||l===Tg;)o--,l=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function IC(e,t){const r={type:"text",value:BC(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function jC(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const zC={blockquote:fC,break:pC,code:mC,delete:gC,emphasis:_C,footnoteReference:vC,heading:yC,html:xC,imageReference:wC,image:SC,inlineCode:bC,linkReference:kC,link:CC,listItem:EC,list:LC,paragraph:PC,root:RC,strong:MC,table:DC,tableCell:AC,tableRow:TC,text:IC,thematicBreak:jC,toml:ia,yaml:ia,definition:ia,footnoteDefinition:ia};function ia(){}const u0=-1,qa=0,No=1,Ma=2,Id=3,jd=4,zd=5,Od=6,c0=7,h0=8,OC=typeof self=="object"?self:globalThis,Bg=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new OC[e](t)},FC=(e,t)=>{const r=(o,l)=>(e.set(l,o),o),i=o=>{if(e.has(o))return e.get(o);const[l,a]=t[o];switch(l){case qa:case u0:return r(a,o);case No:{const c=r([],o);for(const f of a)c.push(i(f));return c}case Ma:{const c=r({},o);for(const[f,h]of a)c[i(f)]=i(h);return c}case Id:return r(new Date(a),o);case jd:{const{source:c,flags:f}=a;return r(new RegExp(c,f),o)}case zd:{const c=r(new Map,o);for(const[f,h]of a)c.set(i(f),i(h));return c}case Od:{const c=r(new Set,o);for(const f of a)c.add(i(f));return c}case c0:{const{name:c,message:f}=a;return r(Bg(c,f),o)}case h0:return r(BigInt(a),o);case"BigInt":return r(Object(BigInt(a)),o);case"ArrayBuffer":return r(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return r(new DataView(c),a)}}return r(Bg(l,a),o)};return i},Ig=e=>FC(new Map,e)(0),is="",{toString:HC}={},{keys:$C}=Object,ho=e=>{const t=typeof e;if(t!=="object"||!e)return[qa,t];const r=HC.call(e).slice(8,-1);switch(r){case"Array":return[No,is];case"Object":return[Ma,is];case"Date":return[Id,is];case"RegExp":return[jd,is];case"Map":return[zd,is];case"Set":return[Od,is];case"DataView":return[No,r]}return r.includes("Array")?[No,r]:r.includes("Error")?[c0,r]:[Ma,r]},sa=([e,t])=>e===qa&&(t==="function"||t==="symbol"),WC=(e,t,r,i)=>{const o=(a,c)=>{const f=i.push(a)-1;return r.set(c,f),f},l=a=>{if(r.has(a))return r.get(a);let[c,f]=ho(a);switch(c){case qa:{let g=a;switch(f){case"bigint":c=h0,g=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return o([u0],a)}return o([c,g],a)}case No:{if(f){let x=a;return f==="DataView"?x=new Uint8Array(a.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(a)),o([f,[...x]],a)}const g=[],m=o([c,g],a);for(const x of a)g.push(l(x));return m}case Ma:{if(f)switch(f){case"BigInt":return o([f,a.toString()],a);case"Boolean":case"Number":case"String":return o([f,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const g=[],m=o([c,g],a);for(const x of $C(a))(e||!sa(ho(a[x])))&&g.push([l(x),l(a[x])]);return m}case Id:return o([c,a.toISOString()],a);case jd:{const{source:g,flags:m}=a;return o([c,{source:g,flags:m}],a)}case zd:{const g=[],m=o([c,g],a);for(const[x,y]of a)(e||!(sa(ho(x))||sa(ho(y))))&&g.push([l(x),l(y)]);return m}case Od:{const g=[],m=o([c,g],a);for(const x of a)(e||!sa(ho(x)))&&g.push(l(x));return m}}const{message:h}=a;return o([c,{name:f,message:h}],a)};return l},jg=(e,{json:t,lossy:r}={})=>{const i=[];return WC(!(t||r),!!t,new Map,i)(e),i},Da=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ig(jg(e,t)):structuredClone(e):(e,t)=>Ig(jg(e,t));function UC(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function VC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function KC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||UC,i=e.options.footnoteBackLabel||VC,o=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f0&&S.push({type:"text",value:" "});let W=typeof r=="string"?r:r(f,y);typeof W=="string"&&(W={type:"text",value:W}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,y),className:["data-footnote-backref"]},children:Array.isArray(W)?W:[W]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const W=E.children[E.children.length-1];W&&W.type==="text"?W.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else g.push(...S);const L={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,L),c.push(L)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Da(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` +`});const h={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,h),e.applyData(t,h)}function MC(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let i=-1;for(;!t&&++i1}function TC(e,t){const r={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},c=Pd(t.children[1]),f=Uv(t.children[t.children.length-1]);c&&f&&(a.position={start:c,end:f}),o.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)}function jC(e,t,r){const i=r?r.children:void 0,l=(i?i.indexOf(t):1)===0?"th":"td",a=r&&r.type==="table"?r.align:void 0,c=a?a.length:t.children.length;let f=-1;const h=[];for(;++f0,!0),i[0]),o=i.index+i[0].length,i=r.exec(t);return l.push(Ag(t.slice(o),o>0,!1)),l.join("")}function Ag(e,t,r){let i=0,o=e.length;if(t){let l=e.codePointAt(i);for(;l===Tg||l===Dg;)i++,l=e.codePointAt(i)}if(r){let l=e.codePointAt(o-1);for(;l===Tg||l===Dg;)o--,l=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function FC(e,t){const r={type:"text",value:OC(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function HC(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const $C={blockquote:_C,break:vC,code:yC,delete:xC,emphasis:wC,footnoteReference:SC,heading:bC,html:kC,imageReference:CC,image:EC,inlineCode:NC,linkReference:LC,link:PC,listItem:RC,list:TC,paragraph:DC,root:AC,strong:BC,table:IC,tableCell:zC,tableRow:jC,text:FC,thematicBreak:HC,toml:ia,yaml:ia,definition:ia,footnoteDefinition:ia};function ia(){}const d0=-1,qa=0,No=1,Ma=2,Id=3,jd=4,zd=5,Od=6,f0=7,p0=8,WC=typeof self=="object"?self:globalThis,Bg=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new WC[e](t)},UC=(e,t)=>{const r=(o,l)=>(e.set(l,o),o),i=o=>{if(e.has(o))return e.get(o);const[l,a]=t[o];switch(l){case qa:case d0:return r(a,o);case No:{const c=r([],o);for(const f of a)c.push(i(f));return c}case Ma:{const c=r({},o);for(const[f,h]of a)c[i(f)]=i(h);return c}case Id:return r(new Date(a),o);case jd:{const{source:c,flags:f}=a;return r(new RegExp(c,f),o)}case zd:{const c=r(new Map,o);for(const[f,h]of a)c.set(i(f),i(h));return c}case Od:{const c=r(new Set,o);for(const f of a)c.add(i(f));return c}case f0:{const{name:c,message:f}=a;return r(Bg(c,f),o)}case p0:return r(BigInt(a),o);case"BigInt":return r(Object(BigInt(a)),o);case"ArrayBuffer":return r(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return r(new DataView(c),a)}}return r(Bg(l,a),o)};return i},Ig=e=>UC(new Map,e)(0),is="",{toString:VC}={},{keys:KC}=Object,ho=e=>{const t=typeof e;if(t!=="object"||!e)return[qa,t];const r=VC.call(e).slice(8,-1);switch(r){case"Array":return[No,is];case"Object":return[Ma,is];case"Date":return[Id,is];case"RegExp":return[jd,is];case"Map":return[zd,is];case"Set":return[Od,is];case"DataView":return[No,r]}return r.includes("Array")?[No,r]:r.includes("Error")?[f0,r]:[Ma,r]},sa=([e,t])=>e===qa&&(t==="function"||t==="symbol"),qC=(e,t,r,i)=>{const o=(a,c)=>{const f=i.push(a)-1;return r.set(c,f),f},l=a=>{if(r.has(a))return r.get(a);let[c,f]=ho(a);switch(c){case qa:{let g=a;switch(f){case"bigint":c=p0,g=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return o([d0],a)}return o([c,g],a)}case No:{if(f){let x=a;return f==="DataView"?x=new Uint8Array(a.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(a)),o([f,[...x]],a)}const g=[],m=o([c,g],a);for(const x of a)g.push(l(x));return m}case Ma:{if(f)switch(f){case"BigInt":return o([f,a.toString()],a);case"Boolean":case"Number":case"String":return o([f,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const g=[],m=o([c,g],a);for(const x of KC(a))(e||!sa(ho(a[x])))&&g.push([l(x),l(a[x])]);return m}case Id:return o([c,a.toISOString()],a);case jd:{const{source:g,flags:m}=a;return o([c,{source:g,flags:m}],a)}case zd:{const g=[],m=o([c,g],a);for(const[x,y]of a)(e||!(sa(ho(x))||sa(ho(y))))&&g.push([l(x),l(y)]);return m}case Od:{const g=[],m=o([c,g],a);for(const x of a)(e||!sa(ho(x)))&&g.push(l(x));return m}}const{message:h}=a;return o([c,{name:f,message:h}],a)};return l},jg=(e,{json:t,lossy:r}={})=>{const i=[];return qC(!(t||r),!!t,new Map,i)(e),i},Ta=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ig(jg(e,t)):structuredClone(e):(e,t)=>Ig(jg(e,t));function YC(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function XC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function GC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||YC,i=e.options.footnoteBackLabel||XC,o=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f0&&S.push({type:"text",value:" "});let W=typeof r=="string"?r:r(f,y);typeof W=="string"&&(W={type:"text",value:W}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(f,y),className:["data-footnote-backref"]},children:Array.isArray(W)?W:[W]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const W=E.children[E.children.length-1];W&&W.type==="text"?W.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...S)}else g.push(...S);const L={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,L),c.push(L)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ta(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:` -`}]}}const Ya=(function(e){if(e==null)return GC;if(typeof e=="function")return Xa(e);if(typeof e=="object")return Array.isArray(e)?qC(e):YC(e);if(typeof e=="string")return XC(e);throw new Error("Expected function, string, or object as test")});function qC(e){const t=[];let r=-1;for(;++r":""))+")"})}return x;function x(){let y=d0,S,k,E;if((!t||l(f,h,g[g.length-1]||void 0))&&(y=e2(r(f,g)),y[0]===Th))return y;if("children"in f&&f.children){const L=f;if(L.children&&y[0]!==ZC)for(k=(i?L.children.length:-1)+a,E=g.concat(L);k>-1&&k":""))+")"})}return x;function x(){let y=m0,S,k,E;if((!t||l(f,h,g[g.length-1]||void 0))&&(y=i2(r(f,g)),y[0]===Dh))return y;if("children"in f&&f.children){const L=f;if(L.children&&y[0]!==n2)for(k=(i?L.children.length:-1)+a,E=g.concat(L);k>-1&&k0&&r.push({type:"text",value:` -`}),r}function zg(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Og(e,t){const r=r2(e,t),i=r.one(e,void 0),o=KC(r),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&l.children.push({type:"text",value:` -`},o),l}function l2(e,t){return e&&"run"in e?async function(r,i){const o=Og(r,{file:i,...t});await e.run(o,i)}:function(r,i){return Og(r,{file:i,...e||t})}}function Fg(e){if(e)throw e}var Jc,Hg;function a2(){if(Hg)return Jc;Hg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},a=function(h,g){r&&g.name==="__proto__"?r(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},c=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(i)return i(h,g).value}else return;return h[g]};return Jc=function f(){var h,g,m,x,y,S,k=arguments[0],E=1,L=arguments.length,W=!1;for(typeof k=="boolean"&&(W=k,k=arguments[1]||{},E=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});Ea.length;let f;c&&a.push(o);try{f=e.apply(this,a)}catch(h){const g=h;if(c&&r)throw g;return o(g)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,o):f instanceof Error?o(f):l(f))}function o(a,...c){r||(r=!0,t(a,...c))}function l(a){o(null,a)}}const qr={basename:d2,dirname:f2,extname:p2,join:m2,sep:"/"};function d2(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fo(e);let r=0,i=-1,o=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else i<0&&(l=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else a<0&&(l=!0,a=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=a));return r===i?i=a:i<0&&(i=e.length),e.slice(r,i)}function f2(e){if(Fo(e),e.length===0)return".";let t=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){t=r;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function p2(e){Fo(e);let t=e.length,r=-1,i=0,o=-1,l=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){i=t+1;break}continue}r<0&&(a=!0,r=t+1),c===46?o<0?o=t:l!==1&&(l=1):o>-1&&(l=-1)}return o<0||r<0||l===0||l===1&&o===r-1&&o===i+1?"":e.slice(o,r)}function m2(...e){let t=-1,r;for(;++t0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function _2(e,t){let r="",i=0,o=-1,l=0,a=-1,c,f;for(;++a<=e.length;){if(a2){if(f=r.lastIndexOf("/"),f!==r.length-1){f<0?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),o=a,l=0;continue}}else if(r.length>0){r="",i=0,o=a,l=0;continue}}t&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,l=0}else c===46&&l>-1?l++:l=-1}return r}function Fo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const v2={cwd:y2};function y2(){return"/"}function Ih(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function x2(e){if(typeof e=="string")e=new URL(e);else if(!Ih(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return w2(e)}function w2(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let r=-1;for(;++r0){let[y,...S]=g;const k=i[x][1];Bh(k)&&Bh(y)&&(y=Zc(!0,k,y)),i[x]=[h,y,...S]}}}}const C2=new Hd().freeze();function nh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wg(e){if(!Bh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ug(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oa(e){return E2(e)?e:new p0(e)}function E2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function N2(e){return typeof e=="string"||L2(e)}function L2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vg=[],Kg={allowDangerousHtml:!0},R2=/^(https?|ircs?|mailto|xmpp)$/i,M2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function D2(e){const t=T2(e),r=A2(e);return B2(t.runSync(t.parse(r),r),e)}function T2(e){const t=e.rehypePlugins||Vg,r=e.remarkPlugins||Vg,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Kg}:Kg;return C2().use(dC).use(r).use(l2,i).use(t)}function A2(e){const t=e.children||"",r=new p0;return typeof t=="string"&&(r.value=t),r}function B2(e,t){const r=t.allowedElements,i=t.allowElement,o=t.components,l=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||I2;for(const g of M2)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+P2+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Fd(e,h),XS(e,{Fragment:_.Fragment,components:o,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function h(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return a?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let y;for(y in Xc)if(Object.hasOwn(Xc,y)&&Object.hasOwn(g.properties,y)){const S=g.properties[y],k=Xc[y];(k===null||k.includes(g.tagName))&&(g.properties[y]=f(String(S||""),y,g))}}if(g.type==="element"){let y=r?!r.includes(g.tagName):l?l.includes(g.tagName):!1;if(!y&&i&&typeof m=="number"&&(y=!i(g,m,x)),y&&x&&typeof m=="number")return c&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function I2(e){const t=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||i!==-1&&t>i||R2.test(e.slice(0,t))?e:""}function qg(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=r.indexOf(t);for(;o!==-1;)i++,o=r.indexOf(t,o+t.length);return i}function j2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function z2(e,t,r){const o=Ya((r||{}).ignore||[]),l=O2(t);let a=-1;for(;++a0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=q+1:(S!==q&&W.push({type:"text",value:h.value.slice(S,q)}),Array.isArray(A)?W.push(...A):A&&W.push(A),S=q+z[0].length,L=!0),!x.global)break;z=x.exec(h.value)}return L?(S?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],i=r.indexOf(")");const o=qg(e,"(");let l=qg(e,")");for(;i!==-1&&o>l;)e+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(")"),l++;return[e,r]}function m0(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Ci(r)||Va(r))&&(!t||r!==47)}g0.peek=aE;function eE(){this.buffer()}function tE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rE(){this.buffer()}function nE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function iE(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=jr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function sE(e){this.exit(e)}function oE(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=jr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function lE(e){this.exit(e)}function aE(){return"["}function g0(e,t,r,i){const o=r.createTracker(i);let l=o.move("[^");const a=r.enter("footnoteReference"),c=r.enter("reference");return l+=o.move(r.safe(r.associationId(e),{after:"]",before:l})),c(),a(),l+=o.move("]"),l}function uE(){return{enter:{gfmFootnoteCallString:eE,gfmFootnoteCall:tE,gfmFootnoteDefinitionLabelString:rE,gfmFootnoteDefinition:nE},exit:{gfmFootnoteCallString:iE,gfmFootnoteCall:sE,gfmFootnoteDefinitionLabelString:oE,gfmFootnoteDefinition:lE}}}function cE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:g0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(i,o,l,a){const c=l.createTracker(a);let f=c.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return f+=c.move(l.safe(l.associationId(i),{before:f,after:"]"})),g(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?` -`:" ")+l.indentLines(l.containerFlow(i,c.current()),t?_0:hE))),h(),f}}function hE(e,t,r){return t===0?e:_0(e,t,r)}function _0(e,t,r){return(r?"":" ")+e}const dE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];v0.peek=_E;function fE(){return{canContainEols:["delete"],enter:{strikethrough:mE},exit:{strikethrough:gE}}}function pE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dE}],handlers:{delete:v0}}}function mE(e){this.enter({type:"delete",children:[]},e)}function gE(e){this.exit(e)}function v0(e,t,r,i){const o=r.createTracker(i),l=r.enter("strikethrough");let a=o.move("~~");return a+=r.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),l(),a}function _E(){return"~"}function vE(e){return e.length}function yE(e,t){const r=t||{},i=(r.align||[]).concat(),o=r.stringLength||vE,l=[],a=[],c=[],f=[];let h=0,g=-1;for(;++gh&&(h=e[g].length);++Lf[L])&&(f[L]=z)}k.push(W)}a[g]=k,c[g]=E}let m=-1;if(typeof i=="object"&&"length"in i)for(;++mf[m]&&(f[m]=W),y[m]=W),x[m]=z}a.splice(1,0,x),c.splice(1,0,y),g=-1;const S=[];for(;++g "),l.shift(2);const a=r.indentLines(r.containerFlow(e,l.current()),SE);return o(),a}function SE(e,t,r){return">"+(r?"":" ")+e}function bE(e,t){return Xg(e,t.inConstruct,!0)&&!Xg(e,t.notInConstruct,!1)}function Xg(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let i=-1;for(;++ia&&(a=l):l=1,o=i+t.length,i=r.indexOf(t,o);return a}function CE(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function EE(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function NE(e,t,r,i){const o=EE(r),l=e.value||"",a=o==="`"?"GraveAccent":"Tilde";if(CE(e,r)){const m=r.enter("codeIndented"),x=r.indentLines(l,LE);return m(),x}const c=r.createTracker(i),f=o.repeat(Math.max(kE(l,o)+1,3)),h=r.enter("codeFenced");let g=c.move(f);if(e.lang){const m=r.enter(`codeFencedLang${a}`);g+=c.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=r.enter(`codeFencedMeta${a}`);g+=c.move(" "),g+=c.move(r.safe(e.meta,{before:g,after:` +`}),r}function zg(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Og(e,t){const r=o2(e,t),i=r.one(e,void 0),o=GC(r),l=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&l.children.push({type:"text",value:` +`},o),l}function h2(e,t){return e&&"run"in e?async function(r,i){const o=Og(r,{file:i,...t});await e.run(o,i)}:function(r,i){return Og(r,{file:i,...e||t})}}function Fg(e){if(e)throw e}var Jc,Hg;function d2(){if(Hg)return Jc;Hg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},a=function(h,g){r&&g.name==="__proto__"?r(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},c=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(i)return i(h,g).value}else return;return h[g]};return Jc=function f(){var h,g,m,x,y,S,k=arguments[0],E=1,L=arguments.length,W=!1;for(typeof k=="boolean"&&(W=k,k=arguments[1]||{},E=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});Ea.length;let f;c&&a.push(o);try{f=e.apply(this,a)}catch(h){const g=h;if(c&&r)throw g;return o(g)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,o):f instanceof Error?o(f):l(f))}function o(a,...c){r||(r=!0,t(a,...c))}function l(a){o(null,a)}}const qr={basename:g2,dirname:_2,extname:v2,join:y2,sep:"/"};function g2(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fo(e);let r=0,i=-1,o=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else i<0&&(l=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(l){r=o+1;break}}else a<0&&(l=!0,a=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=a));return r===i?i=a:i<0&&(i=e.length),e.slice(r,i)}function _2(e){if(Fo(e),e.length===0)return".";let t=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){t=r;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function v2(e){Fo(e);let t=e.length,r=-1,i=0,o=-1,l=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){i=t+1;break}continue}r<0&&(a=!0,r=t+1),c===46?o<0?o=t:l!==1&&(l=1):o>-1&&(l=-1)}return o<0||r<0||l===0||l===1&&o===r-1&&o===i+1?"":e.slice(o,r)}function y2(...e){let t=-1,r;for(;++t0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function w2(e,t){let r="",i=0,o=-1,l=0,a=-1,c,f;for(;++a<=e.length;){if(a2){if(f=r.lastIndexOf("/"),f!==r.length-1){f<0?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),o=a,l=0;continue}}else if(r.length>0){r="",i=0,o=a,l=0;continue}}t&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,l=0}else c===46&&l>-1?l++:l=-1}return r}function Fo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const S2={cwd:b2};function b2(){return"/"}function Ih(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function k2(e){if(typeof e=="string")e=new URL(e);else if(!Ih(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return C2(e)}function C2(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let r=-1;for(;++r0){let[y,...S]=g;const k=i[x][1];Bh(k)&&Bh(y)&&(y=Zc(!0,k,y)),i[x]=[h,y,...S]}}}}const P2=new Hd().freeze();function nh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function sh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wg(e){if(!Bh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ug(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oa(e){return R2(e)?e:new _0(e)}function R2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function M2(e){return typeof e=="string"||T2(e)}function T2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const D2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vg=[],Kg={allowDangerousHtml:!0},A2=/^(https?|ircs?|mailto|xmpp)$/i,B2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function I2(e){const t=j2(e),r=z2(e);return O2(t.runSync(t.parse(r),r),e)}function j2(e){const t=e.rehypePlugins||Vg,r=e.remarkPlugins||Vg,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Kg}:Kg;return P2().use(gC).use(r).use(h2,i).use(t)}function z2(e){const t=e.children||"",r=new _0;return typeof t=="string"&&(r.value=t),r}function O2(e,t){const r=t.allowedElements,i=t.allowElement,o=t.components,l=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||F2;for(const g of B2)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+D2+g.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Fd(e,h),ZS(e,{Fragment:_.Fragment,components:o,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function h(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return a?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let y;for(y in Xc)if(Object.hasOwn(Xc,y)&&Object.hasOwn(g.properties,y)){const S=g.properties[y],k=Xc[y];(k===null||k.includes(g.tagName))&&(g.properties[y]=f(String(S||""),y,g))}}if(g.type==="element"){let y=r?!r.includes(g.tagName):l?l.includes(g.tagName):!1;if(!y&&i&&typeof m=="number"&&(y=!i(g,m,x)),y&&x&&typeof m=="number")return c&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function F2(e){const t=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||i!==-1&&t>i||A2.test(e.slice(0,t))?e:""}function qg(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=r.indexOf(t);for(;o!==-1;)i++,o=r.indexOf(t,o+t.length);return i}function H2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $2(e,t,r){const o=Ya((r||{}).ignore||[]),l=W2(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?x.lastIndex=Y+1:(S!==Y&&W.push({type:"text",value:h.value.slice(S,Y)}),Array.isArray(T)?W.push(...T):T&&W.push(T),S=Y+z[0].length,L=!0),!x.global)break;z=x.exec(h.value)}return L?(S?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],i=r.indexOf(")");const o=qg(e,"(");let l=qg(e,")");for(;i!==-1&&o>l;)e+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(")"),l++;return[e,r]}function v0(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Ci(r)||Va(r))&&(!t||r!==47)}y0.peek=dE;function iE(){this.buffer()}function sE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function oE(){this.buffer()}function lE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function aE(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=jr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function uE(e){this.exit(e)}function cE(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=jr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function hE(e){this.exit(e)}function dE(){return"["}function y0(e,t,r,i){const o=r.createTracker(i);let l=o.move("[^");const a=r.enter("footnoteReference"),c=r.enter("reference");return l+=o.move(r.safe(r.associationId(e),{after:"]",before:l})),c(),a(),l+=o.move("]"),l}function fE(){return{enter:{gfmFootnoteCallString:iE,gfmFootnoteCall:sE,gfmFootnoteDefinitionLabelString:oE,gfmFootnoteDefinition:lE},exit:{gfmFootnoteCallString:aE,gfmFootnoteCall:uE,gfmFootnoteDefinitionLabelString:cE,gfmFootnoteDefinition:hE}}}function pE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:y0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(i,o,l,a){const c=l.createTracker(a);let f=c.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return f+=c.move(l.safe(l.associationId(i),{before:f,after:"]"})),g(),f+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),f+=c.move((t?` +`:" ")+l.indentLines(l.containerFlow(i,c.current()),t?x0:mE))),h(),f}}function mE(e,t,r){return t===0?e:x0(e,t,r)}function x0(e,t,r){return(r?"":" ")+e}const gE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];w0.peek=wE;function _E(){return{canContainEols:["delete"],enter:{strikethrough:yE},exit:{strikethrough:xE}}}function vE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gE}],handlers:{delete:w0}}}function yE(e){this.enter({type:"delete",children:[]},e)}function xE(e){this.exit(e)}function w0(e,t,r,i){const o=r.createTracker(i),l=r.enter("strikethrough");let a=o.move("~~");return a+=r.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),l(),a}function wE(){return"~"}function SE(e){return e.length}function bE(e,t){const r=t||{},i=(r.align||[]).concat(),o=r.stringLength||SE,l=[],a=[],c=[],f=[];let h=0,g=-1;for(;++gh&&(h=e[g].length);++Lf[L])&&(f[L]=z)}k.push(W)}a[g]=k,c[g]=E}let m=-1;if(typeof i=="object"&&"length"in i)for(;++mf[m]&&(f[m]=W),y[m]=W),x[m]=z}a.splice(1,0,x),c.splice(1,0,y),g=-1;const S=[];for(;++g "),l.shift(2);const a=r.indentLines(r.containerFlow(e,l.current()),EE);return o(),a}function EE(e,t,r){return">"+(r?"":" ")+e}function NE(e,t){return Xg(e,t.inConstruct,!0)&&!Xg(e,t.notInConstruct,!1)}function Xg(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let i=-1;for(;++ia&&(a=l):l=1,o=i+t.length,i=r.indexOf(t,o);return a}function PE(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function RE(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ME(e,t,r,i){const o=RE(r),l=e.value||"",a=o==="`"?"GraveAccent":"Tilde";if(PE(e,r)){const m=r.enter("codeIndented"),x=r.indentLines(l,TE);return m(),x}const c=r.createTracker(i),f=o.repeat(Math.max(LE(l,o)+1,3)),h=r.enter("codeFenced");let g=c.move(f);if(e.lang){const m=r.enter(`codeFencedLang${a}`);g+=c.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=r.enter(`codeFencedMeta${a}`);g+=c.move(" "),g+=c.move(r.safe(e.meta,{before:g,after:` `,encode:["`"],...c.current()})),m()}return g+=c.move(` `),l&&(g+=c.move(l+` -`)),g+=c.move(f),h(),g}function LE(e,t,r){return(r?"":" ")+e}function $d(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function PE(e,t,r,i){const o=$d(r),l=o==='"'?"Quote":"Apostrophe",a=r.enter("definition");let c=r.enter("label");const f=r.createTracker(i);let h=f.move("[");return h+=f.move(r.safe(r.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=r.enter("destinationRaw"),h+=f.move(r.safe(e.url,{before:h,after:e.title?" ":` -`,...f.current()}))),c(),e.title&&(c=r.enter(`title${l}`),h+=f.move(" "+o),h+=f.move(r.safe(e.title,{before:h,after:o,...f.current()})),h+=f.move(o),c()),a(),h}function RE(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Mo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ta(e,t,r){const i=ds(e),o=ds(t);return i===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}y0.peek=ME;function y0(e,t,r,i){const o=RE(r),l=r.enter("emphasis"),a=r.createTracker(i),c=a.move(o);let f=a.move(r.containerPhrasing(e,{after:o,before:c,...a.current()}));const h=f.charCodeAt(0),g=Ta(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(f=Mo(h)+f.slice(1));const m=f.charCodeAt(f.length-1),x=Ta(i.after.charCodeAt(0),m,o);x.inside&&(f=f.slice(0,-1)+Mo(m));const y=a.move(o);return l(),r.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+y}function ME(e,t,r){return r.options.emphasis||"*"}function DE(e,t){let r=!1;return Fd(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,Th}),!!((!e.depth||e.depth<3)&&Td(e)&&(t.options.setext||r))}function TE(e,t,r,i){const o=Math.max(Math.min(6,e.depth||1),1),l=r.createTracker(i);if(DE(e,r)){const g=r.enter("headingSetext"),m=r.enter("phrasing"),x=r.containerPhrasing(e,{...l.current(),before:` +`)),g+=c.move(f),h(),g}function TE(e,t,r){return(r?"":" ")+e}function $d(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function DE(e,t,r,i){const o=$d(r),l=o==='"'?"Quote":"Apostrophe",a=r.enter("definition");let c=r.enter("label");const f=r.createTracker(i);let h=f.move("[");return h+=f.move(r.safe(r.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=r.enter("destinationRaw"),h+=f.move(r.safe(e.url,{before:h,after:e.title?" ":` +`,...f.current()}))),c(),e.title&&(c=r.enter(`title${l}`),h+=f.move(" "+o),h+=f.move(r.safe(e.title,{before:h,after:o,...f.current()})),h+=f.move(o),c()),a(),h}function AE(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Mo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Da(e,t,r){const i=ds(e),o=ds(t);return i===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}S0.peek=BE;function S0(e,t,r,i){const o=AE(r),l=r.enter("emphasis"),a=r.createTracker(i),c=a.move(o);let f=a.move(r.containerPhrasing(e,{after:o,before:c,...a.current()}));const h=f.charCodeAt(0),g=Da(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(f=Mo(h)+f.slice(1));const m=f.charCodeAt(f.length-1),x=Da(i.after.charCodeAt(0),m,o);x.inside&&(f=f.slice(0,-1)+Mo(m));const y=a.move(o);return l(),r.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+y}function BE(e,t,r){return r.options.emphasis||"*"}function IE(e,t){let r=!1;return Fd(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return r=!0,Dh}),!!((!e.depth||e.depth<3)&&Dd(e)&&(t.options.setext||r))}function jE(e,t,r,i){const o=Math.max(Math.min(6,e.depth||1),1),l=r.createTracker(i);if(IE(e,r)){const g=r.enter("headingSetext"),m=r.enter("phrasing"),x=r.containerPhrasing(e,{...l.current(),before:` `,after:` `});return m(),g(),x+` `+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(` `))+1))}const a="#".repeat(o),c=r.enter("headingAtx"),f=r.enter("phrasing");l.move(a+" ");let h=r.containerPhrasing(e,{before:"# ",after:` -`,...l.current()});return/^[\t ]/.test(h)&&(h=Mo(h.charCodeAt(0))+h.slice(1)),h=h?a+" "+h:a,r.options.closeAtx&&(h+=" "+a),f(),c(),h}x0.peek=AE;function x0(e){return e.value||""}function AE(){return"<"}w0.peek=BE;function w0(e,t,r,i){const o=$d(r),l=o==='"'?"Quote":"Apostrophe",a=r.enter("image");let c=r.enter("label");const f=r.createTracker(i);let h=f.move("![");return h+=f.move(r.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=r.enter("destinationRaw"),h+=f.move(r.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=r.enter(`title${l}`),h+=f.move(" "+o),h+=f.move(r.safe(e.title,{before:h,after:o,...f.current()})),h+=f.move(o),c()),h+=f.move(")"),a(),h}function BE(){return"!"}S0.peek=IE;function S0(e,t,r,i){const o=e.referenceType,l=r.enter("imageReference");let a=r.enter("label");const c=r.createTracker(i);let f=c.move("![");const h=r.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),a();const g=r.stack;r.stack=[],a=r.enter("reference");const m=r.safe(r.associationId(e),{before:f,after:"]",...c.current()});return a(),r.stack=g,l(),o==="full"||!h||h!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function IE(){return"!"}b0.peek=jE;function b0(e,t,r){let i=e.value||"",o="`",l=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l\u007F]/.test(e.url))}C0.peek=zE;function C0(e,t,r,i){const o=$d(r),l=o==='"'?"Quote":"Apostrophe",a=r.createTracker(i);let c,f;if(k0(e,r)){const g=r.stack;r.stack=[],c=r.enter("autolink");let m=a.move("<");return m+=a.move(r.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),c(),r.stack=g,m}c=r.enter("link"),f=r.enter("label");let h=a.move("[");return h+=a.move(r.containerPhrasing(e,{before:h,after:"](",...a.current()})),h+=a.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=a.move("<"),h+=a.move(r.safe(e.url,{before:h,after:">",...a.current()})),h+=a.move(">")):(f=r.enter("destinationRaw"),h+=a.move(r.safe(e.url,{before:h,after:e.title?" ":")",...a.current()}))),f(),e.title&&(f=r.enter(`title${l}`),h+=a.move(" "+o),h+=a.move(r.safe(e.title,{before:h,after:o,...a.current()})),h+=a.move(o),f()),h+=a.move(")"),c(),h}function zE(e,t,r){return k0(e,r)?"<":"["}E0.peek=OE;function E0(e,t,r,i){const o=e.referenceType,l=r.enter("linkReference");let a=r.enter("label");const c=r.createTracker(i);let f=c.move("[");const h=r.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),a();const g=r.stack;r.stack=[],a=r.enter("reference");const m=r.safe(r.associationId(e),{before:f,after:"]",...c.current()});return a(),r.stack=g,l(),o==="full"||!h||h!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function OE(){return"["}function Wd(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function FE(e){const t=Wd(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function HE(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function N0(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function $E(e,t,r,i){const o=r.enter("list"),l=r.bulletCurrent;let a=e.ordered?HE(r):Wd(r);const c=e.ordered?a==="."?")":".":FE(r);let f=t&&r.bulletLastUsed?a===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(f=!0),N0(r)===a&&g){let m=-1;for(;++m-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const c=r.createTracker(i);c.move(l+" ".repeat(a-l.length)),c.shift(a);const f=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,c.current()),g);return f(),h;function g(m,x,y){return x?(y?"":" ".repeat(a))+m:(y?l:l+" ".repeat(a-l.length))+m}}function VE(e,t,r,i){const o=r.enter("paragraph"),l=r.enter("phrasing"),a=r.containerPhrasing(e,i);return l(),o(),a}const KE=Ya(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qE(e,t,r,i){return(e.children.some(function(a){return KE(a)})?r.containerPhrasing:r.containerFlow).call(r,e,i)}function YE(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}L0.peek=XE;function L0(e,t,r,i){const o=YE(r),l=r.enter("strong"),a=r.createTracker(i),c=a.move(o+o);let f=a.move(r.containerPhrasing(e,{after:o,before:c,...a.current()}));const h=f.charCodeAt(0),g=Ta(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(f=Mo(h)+f.slice(1));const m=f.charCodeAt(f.length-1),x=Ta(i.after.charCodeAt(0),m,o);x.inside&&(f=f.slice(0,-1)+Mo(m));const y=a.move(o+o);return l(),r.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+y}function XE(e,t,r){return r.options.strong||"*"}function GE(e,t,r,i){return r.safe(e.value,i)}function QE(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function JE(e,t,r){const i=(N0(r)+(r.options.ruleSpaces?" ":"")).repeat(QE(r));return r.options.ruleSpaces?i.slice(0,-1):i}const P0={blockquote:wE,break:Gg,code:NE,definition:PE,emphasis:y0,hardBreak:Gg,heading:TE,html:x0,image:w0,imageReference:S0,inlineCode:b0,link:C0,linkReference:E0,list:$E,listItem:UE,paragraph:VE,root:qE,strong:L0,text:GE,thematicBreak:JE};function ZE(){return{enter:{table:e5,tableData:Qg,tableHeader:Qg,tableRow:r5},exit:{codeText:n5,table:t5,tableData:uh,tableHeader:uh,tableRow:uh}}}function e5(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function t5(e){this.exit(e),this.data.inTable=void 0}function r5(e){this.enter({type:"tableRow",children:[]},e)}function uh(e){this.exit(e)}function Qg(e){this.enter({type:"tableCell",children:[]},e)}function n5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,i5));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function i5(e,t){return t==="|"?t:e}function s5(e){const t=e||{},r=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,l=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...l.current()});return/^[\t ]/.test(h)&&(h=Mo(h.charCodeAt(0))+h.slice(1)),h=h?a+" "+h:a,r.options.closeAtx&&(h+=" "+a),f(),c(),h}b0.peek=zE;function b0(e){return e.value||""}function zE(){return"<"}k0.peek=OE;function k0(e,t,r,i){const o=$d(r),l=o==='"'?"Quote":"Apostrophe",a=r.enter("image");let c=r.enter("label");const f=r.createTracker(i);let h=f.move("![");return h+=f.move(r.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=r.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(r.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=r.enter("destinationRaw"),h+=f.move(r.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=r.enter(`title${l}`),h+=f.move(" "+o),h+=f.move(r.safe(e.title,{before:h,after:o,...f.current()})),h+=f.move(o),c()),h+=f.move(")"),a(),h}function OE(){return"!"}C0.peek=FE;function C0(e,t,r,i){const o=e.referenceType,l=r.enter("imageReference");let a=r.enter("label");const c=r.createTracker(i);let f=c.move("![");const h=r.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),a();const g=r.stack;r.stack=[],a=r.enter("reference");const m=r.safe(r.associationId(e),{before:f,after:"]",...c.current()});return a(),r.stack=g,l(),o==="full"||!h||h!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function FE(){return"!"}E0.peek=HE;function E0(e,t,r){let i=e.value||"",o="`",l=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++l\u007F]/.test(e.url))}L0.peek=$E;function L0(e,t,r,i){const o=$d(r),l=o==='"'?"Quote":"Apostrophe",a=r.createTracker(i);let c,f;if(N0(e,r)){const g=r.stack;r.stack=[],c=r.enter("autolink");let m=a.move("<");return m+=a.move(r.containerPhrasing(e,{before:m,after:">",...a.current()})),m+=a.move(">"),c(),r.stack=g,m}c=r.enter("link"),f=r.enter("label");let h=a.move("[");return h+=a.move(r.containerPhrasing(e,{before:h,after:"](",...a.current()})),h+=a.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),h+=a.move("<"),h+=a.move(r.safe(e.url,{before:h,after:">",...a.current()})),h+=a.move(">")):(f=r.enter("destinationRaw"),h+=a.move(r.safe(e.url,{before:h,after:e.title?" ":")",...a.current()}))),f(),e.title&&(f=r.enter(`title${l}`),h+=a.move(" "+o),h+=a.move(r.safe(e.title,{before:h,after:o,...a.current()})),h+=a.move(o),f()),h+=a.move(")"),c(),h}function $E(e,t,r){return N0(e,r)?"<":"["}P0.peek=WE;function P0(e,t,r,i){const o=e.referenceType,l=r.enter("linkReference");let a=r.enter("label");const c=r.createTracker(i);let f=c.move("[");const h=r.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),a();const g=r.stack;r.stack=[],a=r.enter("reference");const m=r.safe(r.associationId(e),{before:f,after:"]",...c.current()});return a(),r.stack=g,l(),o==="full"||!h||h!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function WE(){return"["}function Wd(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function UE(e){const t=Wd(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function VE(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function R0(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function KE(e,t,r,i){const o=r.enter("list"),l=r.bulletCurrent;let a=e.ordered?VE(r):Wd(r);const c=e.ordered?a==="."?")":".":UE(r);let f=t&&r.bulletLastUsed?a===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(f=!0),R0(r)===a&&g){let m=-1;for(;++m-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const c=r.createTracker(i);c.move(l+" ".repeat(a-l.length)),c.shift(a);const f=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,c.current()),g);return f(),h;function g(m,x,y){return x?(y?"":" ".repeat(a))+m:(y?l:l+" ".repeat(a-l.length))+m}}function XE(e,t,r,i){const o=r.enter("paragraph"),l=r.enter("phrasing"),a=r.containerPhrasing(e,i);return l(),o(),a}const GE=Ya(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function QE(e,t,r,i){return(e.children.some(function(a){return GE(a)})?r.containerPhrasing:r.containerFlow).call(r,e,i)}function JE(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}M0.peek=ZE;function M0(e,t,r,i){const o=JE(r),l=r.enter("strong"),a=r.createTracker(i),c=a.move(o+o);let f=a.move(r.containerPhrasing(e,{after:o,before:c,...a.current()}));const h=f.charCodeAt(0),g=Da(i.before.charCodeAt(i.before.length-1),h,o);g.inside&&(f=Mo(h)+f.slice(1));const m=f.charCodeAt(f.length-1),x=Da(i.after.charCodeAt(0),m,o);x.inside&&(f=f.slice(0,-1)+Mo(m));const y=a.move(o+o);return l(),r.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+y}function ZE(e,t,r){return r.options.strong||"*"}function e5(e,t,r,i){return r.safe(e.value,i)}function t5(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function r5(e,t,r){const i=(R0(r)+(r.options.ruleSpaces?" ":"")).repeat(t5(r));return r.options.ruleSpaces?i.slice(0,-1):i}const T0={blockquote:CE,break:Gg,code:ME,definition:DE,emphasis:S0,hardBreak:Gg,heading:jE,html:b0,image:k0,imageReference:C0,inlineCode:E0,link:L0,linkReference:P0,list:KE,listItem:YE,paragraph:XE,root:QE,strong:M0,text:e5,thematicBreak:r5};function n5(){return{enter:{table:i5,tableData:Qg,tableHeader:Qg,tableRow:o5},exit:{codeText:l5,table:s5,tableData:uh,tableHeader:uh,tableRow:uh}}}function i5(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function s5(e){this.exit(e),this.data.inTable=void 0}function o5(e){this.enter({type:"tableRow",children:[]},e)}function uh(e){this.exit(e)}function Qg(e){this.enter({type:"tableCell",children:[]},e)}function l5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,a5));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function a5(e,t){return t==="|"?t:e}function u5(e){const t=e||{},r=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,l=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:a,tableCell:f,tableRow:c}};function a(y,S,k,E){return h(g(y,k,E),y.align)}function c(y,S,k,E){const L=m(y,k,E),W=h([L]);return W.slice(0,W.indexOf(` -`))}function f(y,S,k,E){const L=k.enter("tableCell"),W=k.enter("phrasing"),z=k.containerPhrasing(y,{...E,before:l,after:l});return W(),L(),z}function h(y,S){return yE(y,{align:S,alignDelimiters:i,padding:r,stringLength:o})}function g(y,S,k){const E=y.children;let L=-1;const W=[],z=S.enter("table");for(;++L0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const b5={tokenize:M5,partial:!0};function k5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:L5,continuation:{tokenize:P5},exit:R5}},text:{91:{name:"gfmFootnoteCall",tokenize:N5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:C5,resolveTo:E5}}}}function C5(e,t,r){const i=this;let o=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;o--;){const f=i.events[o][1];if(f.type==="labelImage"){a=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!a||!a._balanced)return r(f);const h=jr(i.sliceSerialize({start:a.end,end:i.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?r(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function E5(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...c),e}function N5(e,t,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,a;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?r(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(l>999||m===93&&!a||m===null||m===91||qe(m))return r(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(jr(i.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(m)}return qe(m)||(a=!0),l++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function L5(e,t,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,a=0,c;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(S)}function g(S){if(a>999||S===93&&!c||S===null||S===91||qe(S))return r(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=jr(i.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return qe(S)||(c=!0),a++,e.consume(S),S===92?m:g}function m(S){return S===91||S===92||S===93?(e.consume(S),a++,g):g(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),o.includes(l)||o.push(l),Oe(e,y,"gfmFootnoteDefinitionWhitespace")):r(S)}function y(S){return t(S)}}function P5(e,t,r){return e.check(Oo,t,e.attempt(b5,t,r))}function R5(e){e.exit("gfmFootnoteDefinition")}function M5(e,t,r){const i=this;return Oe(e,o,"gfmFootnoteDefinitionIndent",5);function o(l){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):r(l)}}function D5(e){let r=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:l,resolveAll:o};return r==null&&(r=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(a,c){let f=-1;for(;++f1?f(S):(a.consume(S),m++,y);if(m<2&&!r)return f(S);const E=a.exit("strikethroughSequenceTemporary"),L=ds(S);return E._open=!L||L===2&&!!k,E._close=!k||k===2&&!!L,c(S)}}}class T5{constructor(){this.map=[]}add(t,r,i){A5(this,t,r,i)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let r=this.map.length;const i=[];for(;r>0;)r-=1,i.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const l of o)t.push(l);o=i.pop()}this.map.length=0}}function A5(e,t,r,i){let o=0;if(!(r===0&&i.length===0)){for(;o-1;){const H=i.events[V][1].type;if(H==="lineEnding"||H==="linePrefix")V--;else break}const T=V>-1?i.events[V][1].type:null,D=T==="tableHead"||T==="tableRow"?A:f;return D===A&&i.parser.lazy[i.now().line]?r(F):D(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(a=!0,l+=1),g(F)}function g(F){return F===null?r(F):be(F)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),y):r(F):Ie(F)?Oe(e,g,"whitespace")(F):(l+=1,a&&(a=!1,o+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),a=!0,g):(e.enter("data"),m(F)))}function m(F){return F===null||F===124||qe(F)?(e.exit("data"),g(F)):(e.consume(F),F===92?x:m)}function x(F){return F===92||F===124?(e.consume(F),m):m(F)}function y(F){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(F):(e.enter("tableDelimiterRow"),a=!1,Ie(F)?Oe(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):S(F))}function S(F){return F===45||F===58?E(F):F===124?(a=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),k):Q(F)}function k(F){return Ie(F)?Oe(e,E,"whitespace")(F):E(F)}function E(F){return F===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),L):F===45?(l+=1,L(F)):F===null||be(F)?q(F):Q(F)}function L(F){return F===45?(e.enter("tableDelimiterFiller"),W(F)):Q(F)}function W(F){return F===45?(e.consume(F),W):F===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return Ie(F)?Oe(e,q,"whitespace")(F):q(F)}function q(F){return F===124?S(F):F===null||be(F)?!a||o!==l?Q(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):Q(F)}function Q(F){return r(F)}function A(F){return e.enter("tableRow"),le(F)}function le(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),le):F===null||be(F)?(e.exit("tableRow"),t(F)):Ie(F)?Oe(e,le,"whitespace")(F):(e.enter("data"),he(F))}function he(F){return F===null||F===124||qe(F)?(e.exit("data"),le(F)):(e.consume(F),F===92?ge:he)}function ge(F){return F===92||F===124?(e.consume(F),he):he(F)}}function z5(e,t){let r=-1,i=!0,o=0,l=[0,0,0,0],a=[0,0,0,0],c=!1,f=0,h,g,m;const x=new T5;for(;++rr[2]+1){const S=r[2]+1,k=r[3]-r[2]-1;e.add(S,k,[])}}e.add(r[3]+1,0,[["exit",m,t]])}return o!==void 0&&(l.end=Object.assign({},as(t.events,o)),e.add(o,0,[["exit",l,t]]),l=void 0),l}function Zg(e,t,r,i,o){const l=[],a=as(t.events,r);o&&(o.end=Object.assign({},a),l.push(["exit",o,t])),i.end=Object.assign({},a),l.push(["exit",i,t]),e.add(r+1,0,l)}function as(e,t){const r=e[t],i=r[0]==="enter"?"start":"end";return r[1][i]}const O5={name:"tasklistCheck",tokenize:H5};function F5(){return{text:{91:O5}}}function H5(e,t,r){const i=this;return o;function o(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return qe(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),a):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),a):r(f)}function a(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):r(f)}function c(f){return be(f)?t(f):Ie(f)?e.check({tokenize:$5},t,r)(f):r(f)}}function $5(e,t,r){return Oe(e,i,"whitespace");function i(o){return o===null?r(o):t(o)}}function W5(e){return Yv([p5(),k5(),D5(e),I5(),F5()])}const U5={};function V5(e){const t=this,r=e||U5,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(W5(r)),l.push(c5()),a.push(h5(r))}function Vd({content:e,className:t,compact:r=!1,muted:i=!1}){const o=new Map;return _.jsx("div",{className:je("prose prose-sm max-w-none break-words dark:prose-invert","prose-headings:font-semibold prose-headings:text-cyber-700 dark:prose-headings:text-cyber-400","prose-h1:border-b prose-h1:border-l-2 prose-h1:border-border prose-h1:border-l-cyber-500 prose-h1:pb-2 prose-h1:pl-3 prose-h1:text-lg","prose-h2:border-l-2 prose-h2:border-l-cyber-500/50 prose-h2:pl-3 prose-h2:text-base","prose-h3:text-sm",i?"prose-p:text-muted-foreground prose-li:text-muted-foreground":"prose-p:text-foreground/85 prose-li:text-foreground/85","prose-p:leading-relaxed","prose-strong:text-foreground","prose-code:rounded prose-code:bg-secondary prose-code:px-1.5 prose-code:py-0.5 prose-code:text-xs prose-code:text-cyber-700 prose-code:before:content-none prose-code:after:content-none dark:prose-code:text-cyber-300","prose-pre:rounded-lg prose-pre:border prose-pre:border-border prose-pre:bg-secondary","prose-table:text-xs","prose-th:border-border prose-th:bg-secondary/50 prose-th:px-3 prose-th:py-2 prose-th:text-foreground","prose-td:border-border prose-td:px-3 prose-td:py-1.5 prose-td:text-muted-foreground","prose-a:text-cyber-700 prose-a:no-underline hover:prose-a:underline dark:prose-a:text-cyber-400","prose-del:text-red-600 prose-del:opacity-60 dark:prose-del:text-red-400",r&&["prose-headings:my-2","prose-h1:border-0 prose-h1:p-0 prose-h1:text-sm","prose-h2:border-0 prose-h2:p-0 prose-h2:text-sm","prose-p:my-1","prose-ul:my-1 prose-ol:my-1","prose-li:my-0","prose-pre:my-2","prose-blockquote:my-2","prose-table:my-2"],t),children:_.jsx(D2,{remarkPlugins:[V5],components:{h1:ss("h1",o),h2:ss("h2",o),h3:ss("h3",o),h4:ss("h4",o),h5:ss("h5",o),h6:ss("h6",o),table:({children:l})=>_.jsx("div",{className:"my-2 overflow-x-auto",children:_.jsx("table",{children:l})})},children:e})})}function ss(e,t){return function({children:i,...o}){const l=zh(i),a=q5(l||"section",t);return _.jsxs(e,{...o,id:a,className:"group scroll-mt-24",children:[i,_.jsx("a",{href:`#${a}`,"aria-label":`Link to ${l}`,className:"ml-2 inline-flex align-middle opacity-0 transition-opacity group-hover:opacity-70 hover:opacity-100",children:_.jsx(wv,{className:"h-3.5 w-3.5"})})]})}}function zh(e){var t;return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(zh).join(""):typeof e=="object"&&"props"in e?zh((t=e.props)==null?void 0:t.children):""}function K5(e){return(e.trim().toLowerCase().replace(/<[^>]*>/g,"").replace(/&[a-z0-9#]+;/g,"").replace(/[^a-z0-9\u4e00-\u9fa5]+/g,"-").replace(/^-+|-+$/g,"")||"section").slice(0,96)}function q5(e,t){const r=K5(e),i=t.get(r)||0;return t.set(r,i+1),i===0?r:`${r}-${i+1}`}function Y5(e,t){const r=[],i=t.loots||[],o=t.assets||[];return r.push("# Penetration Test Report",""),r.push(`**Target:** ${Gn(e.target)}`),r.push(`**Mode:** ${e.mode||"quick"}`),r.push(`**Date:** ${u3(e.updated_at||e.created_at)}`,""),r.push("---",""),X5(r,t),G5(r,i),Q5(r,i),J5(r,o,i.length>0),e3(r,t.errors||[]),`${r.join(` +`))}function f(y,S,k,E){const L=k.enter("tableCell"),W=k.enter("phrasing"),z=k.containerPhrasing(y,{...E,before:l,after:l});return W(),L(),z}function h(y,S){return bE(y,{align:S,alignDelimiters:i,padding:r,stringLength:o})}function g(y,S,k){const E=y.children;let L=-1;const W=[],z=S.enter("table");for(;++L0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const N5={tokenize:B5,partial:!0};function L5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:T5,continuation:{tokenize:D5},exit:A5}},text:{91:{name:"gfmFootnoteCall",tokenize:M5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:P5,resolveTo:R5}}}}function P5(e,t,r){const i=this;let o=i.events.length;const l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;o--;){const f=i.events[o][1];if(f.type==="labelImage"){a=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!a||!a._balanced)return r(f);const h=jr(i.sliceSerialize({start:a.end,end:i.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?r(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function R5(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[r+1],e[r+2],["enter",i,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(r,e.length-r+1,...c),e}function M5(e,t,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l=0,a;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?r(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(l>999||m===93&&!a||m===null||m===91||qe(m))return r(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(jr(i.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(m)}return qe(m)||(a=!0),l++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function T5(e,t,r){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l,a=0,c;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(S)}function g(S){if(a>999||S===93&&!c||S===null||S===91||qe(S))return r(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=jr(i.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return qe(S)||(c=!0),a++,e.consume(S),S===92?m:g}function m(S){return S===91||S===92||S===93?(e.consume(S),a++,g):g(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),o.includes(l)||o.push(l),Oe(e,y,"gfmFootnoteDefinitionWhitespace")):r(S)}function y(S){return t(S)}}function D5(e,t,r){return e.check(Oo,t,e.attempt(N5,t,r))}function A5(e){e.exit("gfmFootnoteDefinition")}function B5(e,t,r){const i=this;return Oe(e,o,"gfmFootnoteDefinitionIndent",5);function o(l){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):r(l)}}function I5(e){let r=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:l,resolveAll:o};return r==null&&(r=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(a,c){let f=-1;for(;++f1?f(S):(a.consume(S),m++,y);if(m<2&&!r)return f(S);const E=a.exit("strikethroughSequenceTemporary"),L=ds(S);return E._open=!L||L===2&&!!k,E._close=!k||k===2&&!!L,c(S)}}}class j5{constructor(){this.map=[]}add(t,r,i){z5(this,t,r,i)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let r=this.map.length;const i=[];for(;r>0;)r-=1,i.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const l of o)t.push(l);o=i.pop()}this.map.length=0}}function z5(e,t,r,i){let o=0;if(!(r===0&&i.length===0)){for(;o-1;){const H=i.events[K][1].type;if(H==="lineEnding"||H==="linePrefix")K--;else break}const A=K>-1?i.events[K][1].type:null,D=A==="tableHead"||A==="tableRow"?T:f;return D===T&&i.parser.lazy[i.now().line]?r(F):D(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(a=!0,l+=1),g(F)}function g(F){return F===null?r(F):be(F)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),y):r(F):Ie(F)?Oe(e,g,"whitespace")(F):(l+=1,a&&(a=!1,o+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),a=!0,g):(e.enter("data"),m(F)))}function m(F){return F===null||F===124||qe(F)?(e.exit("data"),g(F)):(e.consume(F),F===92?x:m)}function x(F){return F===92||F===124?(e.consume(F),m):m(F)}function y(F){return i.interrupt=!1,i.parser.lazy[i.now().line]?r(F):(e.enter("tableDelimiterRow"),a=!1,Ie(F)?Oe(e,S,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):S(F))}function S(F){return F===45||F===58?E(F):F===124?(a=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),k):U(F)}function k(F){return Ie(F)?Oe(e,E,"whitespace")(F):E(F)}function E(F){return F===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),L):F===45?(l+=1,L(F)):F===null||be(F)?Y(F):U(F)}function L(F){return F===45?(e.enter("tableDelimiterFiller"),W(F)):U(F)}function W(F){return F===45?(e.consume(F),W):F===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return Ie(F)?Oe(e,Y,"whitespace")(F):Y(F)}function Y(F){return F===124?S(F):F===null||be(F)?!a||o!==l?U(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):U(F)}function U(F){return r(F)}function T(F){return e.enter("tableRow"),se(F)}function se(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),se):F===null||be(F)?(e.exit("tableRow"),t(F)):Ie(F)?Oe(e,se,"whitespace")(F):(e.enter("data"),he(F))}function he(F){return F===null||F===124||qe(F)?(e.exit("data"),se(F)):(e.consume(F),F===92?fe:he)}function fe(F){return F===92||F===124?(e.consume(F),he):he(F)}}function $5(e,t){let r=-1,i=!0,o=0,l=[0,0,0,0],a=[0,0,0,0],c=!1,f=0,h,g,m;const x=new j5;for(;++rr[2]+1){const S=r[2]+1,k=r[3]-r[2]-1;e.add(S,k,[])}}e.add(r[3]+1,0,[["exit",m,t]])}return o!==void 0&&(l.end=Object.assign({},as(t.events,o)),e.add(o,0,[["exit",l,t]]),l=void 0),l}function Zg(e,t,r,i,o){const l=[],a=as(t.events,r);o&&(o.end=Object.assign({},a),l.push(["exit",o,t])),i.end=Object.assign({},a),l.push(["exit",i,t]),e.add(r+1,0,l)}function as(e,t){const r=e[t],i=r[0]==="enter"?"start":"end";return r[1][i]}const W5={name:"tasklistCheck",tokenize:V5};function U5(){return{text:{91:W5}}}function V5(e,t,r){const i=this;return o;function o(f){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?r(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return qe(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),a):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),a):r(f)}function a(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):r(f)}function c(f){return be(f)?t(f):Ie(f)?e.check({tokenize:K5},t,r)(f):r(f)}}function K5(e,t,r){return Oe(e,i,"whitespace");function i(o){return o===null?r(o):t(o)}}function q5(e){return Qv([v5(),L5(),I5(e),F5(),U5()])}const Y5={};function X5(e){const t=this,r=e||Y5,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),l=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(q5(r)),l.push(p5()),a.push(m5(r))}function Vd({content:e,className:t,compact:r=!1,muted:i=!1}){const o=new Map;return _.jsx("div",{className:je("prose prose-sm max-w-none break-words dark:prose-invert","prose-headings:font-semibold prose-headings:text-cyber-700 dark:prose-headings:text-cyber-400","prose-h1:border-b prose-h1:border-l-2 prose-h1:border-border prose-h1:border-l-cyber-500 prose-h1:pb-2 prose-h1:pl-3 prose-h1:text-lg","prose-h2:border-l-2 prose-h2:border-l-cyber-500/50 prose-h2:pl-3 prose-h2:text-base","prose-h3:text-sm",i?"prose-p:text-muted-foreground prose-li:text-muted-foreground":"prose-p:text-foreground/85 prose-li:text-foreground/85","prose-p:leading-relaxed","prose-strong:text-foreground","prose-code:rounded prose-code:bg-secondary prose-code:px-1.5 prose-code:py-0.5 prose-code:text-xs prose-code:text-cyber-700 prose-code:before:content-none prose-code:after:content-none dark:prose-code:text-cyber-300","prose-pre:rounded-lg prose-pre:border prose-pre:border-border prose-pre:bg-secondary","prose-table:text-xs","prose-th:border-border prose-th:bg-secondary/50 prose-th:px-3 prose-th:py-2 prose-th:text-foreground","prose-td:border-border prose-td:px-3 prose-td:py-1.5 prose-td:text-muted-foreground","prose-a:text-cyber-700 prose-a:no-underline hover:prose-a:underline dark:prose-a:text-cyber-400","prose-del:text-red-600 prose-del:opacity-60 dark:prose-del:text-red-400",r&&["prose-headings:my-2","prose-h1:border-0 prose-h1:p-0 prose-h1:text-sm","prose-h2:border-0 prose-h2:p-0 prose-h2:text-sm","prose-p:my-1","prose-ul:my-1 prose-ol:my-1","prose-li:my-0","prose-pre:my-2","prose-blockquote:my-2","prose-table:my-2"],t),children:_.jsx(I2,{remarkPlugins:[X5],components:{h1:ss("h1",o),h2:ss("h2",o),h3:ss("h3",o),h4:ss("h4",o),h5:ss("h5",o),h6:ss("h6",o),table:({children:l})=>_.jsx("div",{className:"my-2 overflow-x-auto",children:_.jsx("table",{children:l})})},children:e})})}function ss(e,t){return function({children:i,...o}){const l=zh(i),a=Q5(l||"section",t);return _.jsxs(e,{...o,id:a,className:"group scroll-mt-24",children:[i,_.jsx("a",{href:`#${a}`,"aria-label":`Link to ${l}`,className:"ml-2 inline-flex align-middle opacity-0 transition-opacity group-hover:opacity-70 hover:opacity-100",children:_.jsx(bv,{className:"h-3.5 w-3.5"})})]})}}function zh(e){var t;return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(zh).join(""):typeof e=="object"&&"props"in e?zh((t=e.props)==null?void 0:t.children):""}function G5(e){return(e.trim().toLowerCase().replace(/<[^>]*>/g,"").replace(/&[a-z0-9#]+;/g,"").replace(/[^a-z0-9\u4e00-\u9fa5]+/g,"-").replace(/^-+|-+$/g,"")||"section").slice(0,96)}function Q5(e,t){const r=G5(e),i=t.get(r)||0;return t.set(r,i+1),i===0?r:`${r}-${i+1}`}function J5(e,t){const r=[],i=t.loots||[],o=t.assets||[];return r.push("# Penetration Test Report",""),r.push(`**Target:** ${Jn(e.target)}`),r.push(`**Mode:** ${e.mode||"quick"}`),r.push(`**Date:** ${f3(e.updated_at||e.created_at)}`,""),r.push("---",""),Z5(r,t),e3(r,i),t3(r,i),r3(r,o,i.length>0),i3(r,t.errors||[]),`${r.join(` `).trim()} -`}function X5(e,t){const r=t.summary;e.push("## Summary",""),e.push("| Metric | Value |"),e.push("|---|---:|"),e.push(`| Targets | ${r.targets||0} |`),e.push(`| Services | ${r.services||0} |`),e.push(`| Web | ${r.webs||0} |`),e.push(`| Probes | ${r.probes||0} |`),e.push(`| Fingerprints | ${o3(t.assets||[])} |`),e.push(`| Loots | ${r.loots||(t.loots||[]).length||l3(t.assets||[])} |`),e.push(`| Errors | ${r.errors||0} |`),r.duration&&e.push(`| Duration | ${F0(r.duration)} |`),e.push("")}function G5(e,t){const r=t.map(i=>({loot:i,summary:t3(i),content:Kd(i)})).filter(i=>i.content);if(r.length!==0){e.push("## Analysis","");for(const{loot:i,summary:o,content:l}of r){const a=o||`${i.kind||"loot"} ${i.target||""}`.trim();e.push(`### ${Yd(a)}`,""),i.kind&&e.push(`**Kind:** ${Gn(i.kind)}`,""),i.priority&&e.push(`**Priority:** ${Gn(i.priority)}`,""),i.target&&e.push(`**Target:** ${Gn(i.target)}`,""),l&&!O0(o,l)?e.push(l,""):o&&e.push(o,"")}}}function Q5(e,t){if(t.length!==0){e.push("## Loots",""),e.push("| Kind | Target | Priority | Description |"),e.push("|---|---|---|---|");for(const r of t)e.push([ua(r.kind),ua(r.target),ua(r.priority||""),ua(r.description||qd(Kd(r)))].join(" | ").replace(/^/,"| ").replace(/$/," |"));e.push("")}}function J5(e,t,r){if(t.length!==0){e.push("## Assets","");for(const i of t){const o=Qr(i.title,i.target,i.key,"Asset");e.push(`### ${Yd(o)}`,""),i.target&&i.target!==o&&e.push(`- **Target:** ${Gn(i.target)}`),i.status&&e.push(`- **State:** ${Gn(i.status)}`),aa(e,"Services",n3(i.items||[])),aa(e,"HTTP",i3(i.items||[])),aa(e,"Fingers",z0(i.items||[])),aa(e,"Sources",s3(i.items||[]));const l=(i.items||[]).filter(a=>a.kind==="path").length;l>0&&e.push(`- **Paths:** ${l}`),e.push(""),Z5(e,i.items||[],r)}}}function Z5(e,t,r){const i=t.filter(o=>["loot","note","response","error"].includes(o.kind)).filter(o=>!(r&&o.kind==="loot")).map(o=>({item:o,summary:Qr(o.summary,o.title),content:r3(o)})).filter(o=>o.summary||o.content);if(i.length!==0){e.push("#### Analysis","");for(const{item:o,summary:l,content:a}of i){const c=l||qd(a)||o.kind;e.push(`##### ${Yd(c)}`,"");const f=[Qr(o.source,o.kind),o.status].filter(Boolean).join(":");f&&e.push(`**Source:** ${Gn(f)}`,""),a&&!O0(l,a)?e.push(a,""):l&&e.push(l,"")}}}function e3(e,t){if(!(!t||t.length===0)){e.push("## Errors","");for(const r of t)e.push(`- ${Qr(r.source,"scan")}: ${r.message}`);e.push("")}}function aa(e,t,r){r.length!==0&&e.push(`- **${t}:** ${r.map(Gn).join(", ")}`)}function t3(e){return Qr(e.description,qd(Kd(e)))}function Kd(e){var t,r,i,o,l,a,c;return Qr(at((t=e.data)==null?void 0:t.content),at((r=e.data)==null?void 0:r.detail),at((i=e.data)==null?void 0:i.markdown),at((o=e.data)==null?void 0:o.narrative),at((l=e.data)==null?void 0:l.evidence),at((a=e.data)==null?void 0:a.response),at((c=e.data)==null?void 0:c.output))}function r3(e){var t,r,i,o,l,a,c;return Qr(e.detail,at((t=e.data)==null?void 0:t.content),at((r=e.data)==null?void 0:r.detail),at((i=e.data)==null?void 0:i.markdown),at((o=e.data)==null?void 0:o.narrative),at((l=e.data)==null?void 0:l.evidence),at((a=e.data)==null?void 0:a.response),at((c=e.data)==null?void 0:c.output))}function n3(e){return Do(e.filter(t=>t.kind==="service").map(t=>{var r,i,o;return Do([at((r=t.data)==null?void 0:r.protocol),at((i=t.data)==null?void 0:i.service),at((o=t.data)==null?void 0:o.port)]).join(" ")}))}function i3(e){return Do(e.filter(t=>t.kind==="path").map(t=>{var r;return Qr(t.status,at((r=t.data)==null?void 0:r.status))}))}function z0(e){return Do(e.flatMap(t=>{var r,i;return t.kind==="fingerprint"?[Qr(t.title,at((r=t.data)==null?void 0:r.name))]:t.kind==="path"?a3((i=t.data)==null?void 0:i.fingers):[]}))}function s3(e){return Do(e.map(t=>{var r;return Qr(t.source,at((r=t.data)==null?void 0:r.source))}))}function o3(e){return z0(e.flatMap(t=>t.items||[])).length}function l3(e){return e.flatMap(t=>t.items||[]).filter(t=>{var r;return t.kind==="loot"&&at((r=t.data)==null?void 0:r.kind).toLowerCase()!=="fingerprint"}).length}function at(e){return typeof e=="string"?e:typeof e=="number"&&Number.isFinite(e)?String(e):""}function a3(e){return Array.isArray(e)?e.map(at).filter(Boolean):typeof e=="string"?e.split(/[;,]/).map(t=>t.trim()).filter(Boolean):[]}function qd(e){return e.split(` -`).map(t=>t.trim()).find(Boolean)||""}function Qr(...e){var t;return((t=e.find(r=>r&&r.trim()))==null?void 0:t.trim())||""}function Do(e){const t=new Set,r=[];for(const i of e){const o=i.trim(),l=o.toLowerCase();!o||t.has(l)||(t.add(l),r.push(o))}return r}function O0(e,t){return e.trim()===t.trim()}function Gn(e){return`\`${String(e).replace(/`/g,"'")}\``}function Yd(e){return e.trim().replace(/\s*\n+\s*/g," ").replace(/^#+\s*/,"")||"Analysis"}function ua(e){return F0(e.replace(/\s*\n+\s*/g," ").trim())}function F0(e){return e.replace(/\|/g,"\\|")}function u3(e){if(!e)return new Date().toLocaleString();const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function c3({report:e="",result:t,scan:r}){const i=t?Y5(r,t):e;return i?_.jsx("div",{className:"rounded-lg border border-border bg-card/50 p-6 overflow-auto",children:_.jsx(Vd,{content:i,className:"prose-h2:mt-6"})}):_.jsx("div",{className:"text-muted-foreground text-center py-12 text-sm",children:"No report available yet."})}const Wt={service:"service",path:"path",fingerprint:"fingerprint",loot:"loot",note:"note",response:"response",error:"error"};function h3(e){var i;const t=d3(e.assets||[]),r=f3(t);return{hosts:r,metrics:{assets:t.length,hosts:r.length,services:e.summary.services,web:e.summary.webs,probes:e.summary.probes,fingers:L3(t),loots:e.summary.loots||((i=e.loots)==null?void 0:i.length)||N3(t),errors:e.summary.errors,duration:e.summary.duration}}}function d3(e){return e.map(t=>({...t,id:t.id||`asset:${t.key||t.target||"scan"}`,key:t.key||To(t.target||"scan"),target:t.target||t.key||"Scan",items:t.items||[]}))}function f3(e){const t=new Map;for(const r of e){const i=p3(r),o=To(i.host||"Scan");let l=t.get(o);l||(l={id:`host:${o}`,host:i.host||"Scan",services:[]},t.set(o,l)),l.services.push(i)}return Array.from(t.values()).map(r=>({...r,services:r.services.sort(P3)})).sort((r,i)=>r.host.localeCompare(i.host))}function p3(e){const t=e.items.find(S=>S.kind===Wt.service),r=e.items.filter(S=>S.kind===Wt.path),i=e.items.filter(Aa),o=e.items.filter(S=>S.kind!==Wt.path&&!Aa(S)),l=Nr(Pt(t,"protocol"),Pt(t,"service")),a=Nr(Pt(t,"service"),t==null?void 0:t.title,l),c=Pt(t,"ip")||"Scan",f=Pt(t,"port"),h=Nr(t==null?void 0:t.target,e.target),g=C3(e,t,a),m=E3(e,t,g,a),x=l.toLowerCase(),y=r.length>0||M3(t,"is_web")||x.startsWith("http");return{id:e.id||`service:${e.key||e.target}`,asset:e,host:c,port:f,protocol:l,service:a,target:h,title:g,summary:m,sources:U0(e.items),states:W0(e.items),statuses:$0(r),fingers:Xd(e.items),paths:r,analysisItems:i,detailItems:o,pathCount:r.length,web:y}}function H0(e){return{statuses:$0([e]),states:W0([e]),fingers:Xd([e]),sources:U0([e])}}function m3(e){const t=H0(e);return[...t.statuses,...t.states,...t.fingers,...t.sources]}function Aa(e){return e.kind===Wt.note||e.kind===Wt.response||e.kind===Wt.error?!0:!(e.kind!==Wt.loot||Pt(e,"kind").toLowerCase()==="fingerprint")}function g3(e){const t={children:[]};for(const r of e)R3(t,r);return q0(t.children)}function e_(e){const t=new Set;return Gd(e,(r,i)=>{i<1&&t.add(r.id)}),t}function _3(e){const t=[];return Gd(e,r=>t.push(r.id)),t}function v3(e){const t=Pt(e,"path")||Qd(e.target),r=t.split("?")[0]||"/";if(r==="/")return"/";const i=r.split("/").filter(Boolean),o=i[i.length-1]||"/";return t.includes("?")?`${o}?${t.split("?").slice(1).join("?")}`:o}function y3(e){const t=Pt(e,"path")||Qd(e.target),r=t.indexOf("?");return r>=0?t.slice(r):""}function t_(e){return`${To(Pt(e,"url")||e.target||Pt(e,"path"))}|host=${Pt(e,"host_header")}`}function x3(e){return Nr(e.summary,e.title)}function w3(e,t){return To(n_(e)||e)===To(n_(t)||t)}function $0(e){return Ho(e.filter(t=>t.kind===Wt.path).map(t=>Nr(t.status,Pt(t,"status"))).filter(t=>t&&Y0(t)))}function W0(e){return Ho(e.filter(t=>t.kind!==Wt.path).map(t=>t.status).filter(t=>t&&!Y0(t)))}function Xd(e){return Ho(e.filter(t=>t.kind===Wt.fingerprint||t.kind===Wt.path).flatMap(t=>t.kind===Wt.fingerprint?[Nr(t.title,Pt(t,"name"))]:D3(t,"fingers")).filter(Boolean))}function U0(e){return Ho(e.map(t=>Nr(t.source,Pt(t,"source"))).filter(Boolean))}function S3(e,t,r){const i=new Set(t.map(pn).filter(Boolean));return B3((e||[]).filter(o=>!i.has(pn(o))).map(o=>({id:`tag:${o}`,label:o,tone:r})))}function b3(e){return e===Wt.loot?"red":e===Wt.note||e===Wt.response?"cyan":"muted"}function V0(e){switch((e||"").toLowerCase()){case"confirmed":case"critical":case"high":case"loot":case"error":case"failed":return"red";case"medium":case"inconclusive":return"yellow";case"low":return"green";default:return"muted"}}function K0(e){const t=Number(e);return Number.isFinite(t)?t>=500?"red":t>=400?"yellow":t>=200&&t<400?"green":"muted":"muted"}function k3(e,t){return`${e} ${e===1?t:`${t}s`}`}function C3(e,t,r){const i=Nr(e.title);return i&&i!==e.target&&pn(i)!==pn(r)?i:Nr(Pt(t,"banner"),t==null?void 0:t.summary)}function E3(e,t,r,i){const o=[Pt(t,"banner"),t==null?void 0:t.summary,e.status];return Nr(...o.filter(l=>pn(l)!==pn(r)&&pn(l)!==pn(i)))}function N3(e){return e.reduce((t,r)=>t+r.items.filter(i=>i.kind===Wt.loot&&Pt(i,"kind").toLowerCase()!=="fingerprint").length,0)}function L3(e){return Ho(e.flatMap(t=>Xd(t.items))).length}function P3(e,t){const r=Number.parseInt(e.port,10),i=Number.parseInt(t.port,10);return Number.isFinite(r)&&Number.isFinite(i)&&r!==i?r-i:`${e.port}|${e.service}|${e.target}`.localeCompare(`${t.port}|${t.service}|${t.target}`)}function R3(e,t){const i=(Pt(t,"path")||Qd(t.target)).split("?")[0]||"/";if(i==="/"){r_(e,"/","/").items.push(t);return}const o=i.split("/").filter(Boolean);let l=e,a="";o.forEach((c,f)=>{a+=`/${c}`;const h=r_(l,c,a);if(f===o.length-1){h.items.push(t);return}l=h})}function r_(e,t,r){let i=e.children.find(o=>o.path===r);return i||(i={id:r,name:t,path:r,children:[],items:[]},e.children.push(i)),i}function q0(e){return e.map(t=>({...t,children:q0(t.children)})).sort((t,r)=>{const i=t.children.length>0?0:1,o=r.children.length>0?0:1;return`${i}|${t.name}`.localeCompare(`${o}|${r.name}`)})}function Gd(e,t,r=0){for(const i of e)i.children.length!==0&&(t(i,r),Gd(i.children,t,r+1))}function Pt(e,t){var i;const r=(i=e==null?void 0:e.data)==null?void 0:i[t];return typeof r=="string"?r:typeof r=="number"&&r>0?String(r):""}function M3(e,t){var r;return((r=e==null?void 0:e.data)==null?void 0:r[t])===!0}function D3(e,t){var i;const r=(i=e.data)==null?void 0:i[t];return Array.isArray(r)?r.map(o=>typeof o=="string"?o:typeof o=="number"&&o>0?String(o):"").filter(Boolean):typeof r=="string"?T3(r):[]}function T3(e){return e.split(";").flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}function Y0(e){const t=Number(e);return Number.isInteger(t)&&t>=100&&t<=599}function Qd(e){const t=X0(e);return t?`${t.pathname||"/"}${t.search||""}`:e||"/"}function n_(e){const t=X0(e);return t?t.origin.toLowerCase():""}function X0(e){if(!e)return null;try{return new URL(e)}catch{return null}}function To(e){return A3((e||"").trim()).toLowerCase()}function A3(e){let t=e.length;for(;t>1&&e[t-1]==="/";)t-=1;return e.slice(0,t)}function Nr(...e){var t;return((t=e.find(r=>r&&r.trim()))==null?void 0:t.trim())||""}function Ho(e){return Array.from(new Set(e.filter(t=>!!t)))}function B3(e){const t=new Set,r=[];for(const i of e){const o=pn(i.label);!o||t.has(o)||(t.add(o),r.push(i))}return r}function pn(e){return String(e||"").trim().toLowerCase()}const fs=["critical","high","medium","low","info"];function I3(e){return e.analysisItems.some(t=>t.source==="verify"&&t.status==="confirmed")?"verified":e.analysisItems.some(t=>t.source==="sniper")?"sniper":e.analysisItems.some(t=>t.source==="deep")?"deep":null}function Jd(e){const t=[],r=new Set;for(const i of e.loots||[]){const o=`loot:${i.target}:${i.kind}:${i.description||""}`;r.has(o)||(r.add(o),t.push({id:o,kind:z3(i.kind),priority:F3(i.priority),title:i.description||i.kind||"Finding",target:i.target,description:i.description,tags:i.tags||[],source:void 0,status:void 0,detail:$3(i),raw:i}))}for(const i of e.assets||[])for(const o of i.items||[]){if(!Aa(o)||o.kind==="error")continue;const l=`item:${i.target}:${o.source}:${o.kind}:${o.title||o.summary||""}`;if(r.has(l))continue;r.add(l);const a=H3(o);t.push({id:l,kind:O3(o.kind),priority:a,title:Nr(o.summary,o.title)||o.kind,target:o.target||i.target,description:o.summary||o.title,source:o.source,status:o.status,tags:o.tags||[],detail:G0(o),raw:o})}return t.sort((i,o)=>{const l=fs.indexOf(i.priority),a=fs.indexOf(o.priority);if(l!==a)return l-a;const c=i.source==="verify"&&i.status==="confirmed"?0:1,f=o.source==="verify"&&o.status==="confirmed"?0:1;return c-f}),t}function j3(e){var l;const t=Jd(e);if(t.length===0)return null;const r={},i={};for(const a of t)if((r[l=a.priority]||(r[l]=[])).push(a),a.source){const c=a.status||"unknown";(i[c]||(i[c]=[])).push(a)}const o=t.filter(a=>a.source==="verify"&&a.status==="confirmed").length;return{byPriority:r,byStatus:i,aiVerifiedCount:o,totalFindings:t.length,topFinding:t[0]}}function z3(e){switch(e==null?void 0:e.toLowerCase()){case"vuln":return"vuln";case"weakpass":return"weakpass";case"fingerprint":return"fingerprint";default:return"other"}}function O3(e){switch(e==null?void 0:e.toLowerCase()){case"loot":return"vuln";case"note":return"note";default:return"other"}}function F3(e){const t=(e||"").toLowerCase();return fs.includes(t)?t:"info"}function H3(e){const t=(e.status||"").toLowerCase();return t==="confirmed"||t==="critical"?"critical":t==="high"?"high":t==="medium"||t==="inconclusive"?"medium":t==="low"?"low":"info"}function G0(e){var t,r,i,o,l,a,c;return Nr(e.detail,mi((t=e.data)==null?void 0:t.content),mi((r=e.data)==null?void 0:r.detail),mi((i=e.data)==null?void 0:i.markdown),mi((o=e.data)==null?void 0:o.narrative),mi((l=e.data)==null?void 0:l.evidence),mi((a=e.data)==null?void 0:a.response),mi((c=e.data)==null?void 0:c.output))}function mi(e){return typeof e=="string"?e:""}function $3(e){if(!e.data)return;const t=e.data.detail||e.data.evidence||e.data.markdown||e.data.narrative;return typeof t=="string"?t:void 0}const Q0={critical:{label:"Critical",bg:"bg-red-500/15",text:"text-red-600 dark:text-red-400",border:"border-red-500/30"},high:{label:"High",bg:"bg-orange-500/15",text:"text-orange-600 dark:text-orange-400",border:"border-orange-500/30"},medium:{label:"Medium",bg:"bg-yellow-500/15",text:"text-yellow-600 dark:text-yellow-400",border:"border-yellow-500/30"},low:{label:"Low",bg:"bg-green-500/15",text:"text-green-600 dark:text-green-400",border:"border-green-500/30"},info:{label:"Info",bg:"bg-blue-500/15",text:"text-blue-600 dark:text-blue-400",border:"border-blue-500/30"}};function W3({result:e}){const t=te.useMemo(()=>j3(e),[e]);return t?_.jsxs("div",{className:"rounded-lg border border-border bg-card/50 p-4 space-y-4",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-cyber-700 dark:text-cyber-400",children:[_.jsx(kw,{className:"h-4 w-4"}),_.jsx("span",{children:"AI Analysis Summary"})]}),_.jsx(U3,{summary:t}),Object.keys(t.byStatus).length>0&&_.jsx(V3,{summary:t}),t.topFinding&&_.jsx(K3,{summary:t})]}):null}function U3({summary:e}){return _.jsx("div",{className:"grid grid-cols-5 gap-2",children:fs.map(t=>{var o;const r=Q0[t],i=((o=e.byPriority[t])==null?void 0:o.length)||0;return _.jsxs("div",{className:je("rounded-md border p-2.5 text-center",r.bg,r.border,i===0&&"opacity-40"),children:[_.jsx("div",{className:je("text-lg font-bold tabular-nums",r.text),children:i}),_.jsx("div",{className:"text-[10px] uppercase text-muted-foreground",children:r.label})]},t)})})}function V3({summary:e}){var c,f,h,g;const t=((c=e.byStatus.confirmed)==null?void 0:c.length)||0,r=((f=e.byStatus.info)==null?void 0:f.length)||0,i=((h=e.byStatus.inconclusive)==null?void 0:h.length)||0,o=((g=e.byStatus.not_confirmed)==null?void 0:g.length)||0,l=t+r+i+o;if(l===0)return null;const a=l>0?t/l*100:0;return _.jsxs("div",{className:"space-y-2",children:[_.jsxs("div",{className:"flex items-center justify-between text-xs",children:[_.jsx("span",{className:"text-muted-foreground",children:"AI Verification"}),_.jsxs("span",{className:"font-medium text-foreground",children:[t,"/",l," confirmed"]})]}),_.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:_.jsx("div",{className:"h-full rounded-full bg-green-500 transition-all",style:{width:`${a}%`}})}),_.jsxs("div",{className:"flex flex-wrap gap-3 text-[11px]",children:[t>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[_.jsx(gn,{className:"h-3 w-3"}),t," confirmed"]}),r>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[_.jsx(xv,{className:"h-3 w-3"}),r," info"]}),i>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[_.jsx(cw,{className:"h-3 w-3"}),i," inconclusive"]}),o>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[_.jsx(hw,{className:"h-3 w-3"}),o," not confirmed"]})]})]})}function K3({summary:e}){const t=e.topFinding,r=Q0[t.priority];return _.jsx("div",{className:je("rounded-md border p-3",r.border,r.bg),children:_.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx(Pa,{className:je("h-4 w-4 mt-0.5 shrink-0",r.text)}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx("span",{className:je("text-xs font-semibold uppercase",r.text),children:t.priority}),_.jsx("span",{className:"text-xs font-medium text-foreground break-words",children:t.title})]}),_.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[_.jsx("span",{className:"font-mono break-all",children:t.target}),t.source==="verify"&&t.status==="confirmed"&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[_.jsx(gn,{className:"h-3 w-3"}),"AI Verified"]}),t.tags.slice(0,3).map(i=>_.jsx("span",{className:"rounded bg-background/50 px-1.5 py-0.5 text-[10px]",children:i},i))]})]})]})})}function q3({result:e}){const t=te.useMemo(()=>h3(e),[e]);return _.jsxs("div",{className:"space-y-4 animate-fade-in",children:[_.jsx("div",{className:"rounded-lg border border-border bg-card/50 p-4",children:_.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs sm:grid-cols-3 lg:grid-cols-9",children:[_.jsx(dn,{label:"Hosts",value:t.metrics.hosts}),_.jsx(dn,{label:"Assets",value:t.metrics.assets}),_.jsx(dn,{label:"Services",value:t.metrics.services}),_.jsx(dn,{label:"Web",value:t.metrics.web}),_.jsx(dn,{label:"Probes",value:t.metrics.probes}),_.jsx(dn,{label:"Fingers",value:t.metrics.fingers}),_.jsx(dn,{label:"Loots",value:t.metrics.loots}),_.jsx(dn,{label:"Errors",value:t.metrics.errors}),_.jsx(dn,{label:"Duration",value:t.metrics.duration})]})}),_.jsx(W3,{result:e}),_.jsx(c4,{title:"Hosts",children:t.hosts.length>0?_.jsx(Y3,{hosts:t.hosts}):_.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:"No hosts."})})]})}function Y3({hosts:e}){return _.jsx("div",{className:"divide-y divide-border/70",children:e.map(t=>_.jsx(X3,{host:t},t.id))})}function X3({host:e}){const[t,r]=te.useState(!0),i=e.services.filter(l=>l.web).length,o=Ga("host",e.id);return _.jsxs("details",{id:o,className:"group scroll-mt-24 py-3 first:pt-0 last:pb-0",open:t,onToggle:l=>r(l.currentTarget.open),children:[_.jsxs("summary",{className:"flex cursor-pointer list-none items-start gap-2 [&::-webkit-details-marker]:hidden",children:[_.jsx($a,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-open:rotate-90"}),_.jsx(vw,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}),_.jsx("div",{className:"min-w-0 flex-1",children:_.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[_.jsx("span",{className:"break-all font-mono text-sm font-semibold text-foreground",children:e.host}),_.jsx(Zd,{id:o,label:`Link to ${e.host}`}),_.jsx(Yr,{children:k3(e.services.length,"service")}),i>0&&_.jsx(Yr,{tone:"cyan",children:J0(i)})]})})]}),_.jsx("div",{className:"ml-6 mt-3 border-l border-border/70 pl-3",children:_.jsx(G3,{services:e.services})})]})}function G3({services:e}){return _.jsx("div",{className:"divide-y divide-border/60",children:e.map(t=>_.jsx(Q3,{service:t},t.id))})}function Q3({service:e}){const t=te.useMemo(()=>Z3(e),[e]),[r,i]=te.useState(!1),[o,l]=te.useState(()=>s_(t)),a=t.find(h=>h.id===o)||t[0],c=Ga("service",e.id);te.useEffect(()=>{t.some(h=>h.id===o)||l(s_(t))},[o,t]);const f=h=>g=>{g.preventDefault(),g.stopPropagation(),l(h),i(!0)};return t.length===0?_.jsx("div",{id:c,className:"scroll-mt-24 py-3 first:pt-0 last:pb-0",children:_.jsx(i_,{service:e})}):_.jsxs("details",{id:c,className:"group/service scroll-mt-24 py-3 first:pt-0 last:pb-0",open:r,onToggle:h=>i(h.currentTarget.open),children:[_.jsxs("summary",{className:"cursor-pointer list-none [&::-webkit-details-marker]:hidden",children:[_.jsx(i_,{service:e,expandable:!0}),_.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:t.map(h=>_.jsx(u4,{active:r&&(a==null?void 0:a.id)===h.id,label:h.label,count:h.count,onClick:f(h.id)},h.id))})]}),a&&_.jsx("div",{className:"mt-3",children:a.render()})]})}function i_({service:e,expandable:t=!1}){const r=e.web?e.asset.target:e.target,i=I3(e);return _.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_auto]",children:[_.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[t?_.jsx($a,{className:"mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-open/service:rotate-90"}):_.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),_.jsx("span",{className:"w-[4.75rem] shrink-0 break-words font-mono text-sm font-semibold leading-5 text-foreground",children:e.port||"-"}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[_.jsx(J3,{service:e}),_.jsx("span",{className:"font-medium text-foreground",children:e.service||e.protocol||"service"}),_.jsx(Zd,{id:Ga("service",e.id),label:`Link to ${e.target||e.service||e.port}`}),e.protocol&&e.protocol!==e.service&&_.jsx(Yr,{children:e.protocol}),e.web&&_.jsx(Yr,{tone:"cyan",children:e.pathCount>0?J0(e.pathCount):"web"}),i==="verified"&&_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-green-400/10 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[_.jsx(gn,{className:"h-3 w-3"}),"AI Verified"]}),i==="sniper"&&_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-400/10 px-1.5 py-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[_.jsx(Wa,{className:"h-3 w-3"}),"CVE Intel"]}),i==="deep"&&_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:[_.jsx(Ua,{className:"h-3 w-3"}),"Deep Test"]}),e.title&&_.jsx("span",{className:"min-w-0 break-words text-xs text-muted-foreground",children:e.title})]}),_.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground",children:[r&&_.jsx("span",{className:"break-all font-mono",children:r}),e.summary&&_.jsx("span",{className:"break-words",children:e.summary}),e.statuses.slice(0,5).map(o=>_.jsx(Yr,{tone:K0(o),children:o},`http:${o}`)),e.states.slice(0,3).map(o=>_.jsx(Yr,{tone:V0(o),children:o},`state:${o}`)),_.jsx(ry,{fingers:e.fingers}),e.analysisItems.length>0&&_.jsxs("span",{className:"text-cyber-700 dark:text-cyber-300",children:[e.analysisItems.length," analysis"]})]})]})]}),_.jsx(ty,{sources:e.sources,className:"justify-start sm:justify-end"})]})}function J3({service:e}){return e.web?_.jsx(pw,{className:"h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}):e.fingers.length>0?_.jsx(kd,{className:"h-3.5 w-3.5 shrink-0 text-yellow-700 dark:text-yellow-300"}):_.jsx(Cd,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})}function Z3(e){const t=[];return e.paths.length>0&&t.push({id:"sitemap",label:"Sitemap",count:e.paths.length,preferred:!0,render:()=>_.jsx(a4,{items:e.paths})}),e.analysisItems.length>0&&t.push({id:"analysis",label:"Analysis",count:e.analysisItems.length,render:()=>_.jsx(e4,{asset:e.asset,items:e.analysisItems})}),t}function s_(e){var t,r;return((t=e.find(i=>i.preferred))==null?void 0:t.id)||((r=e[0])==null?void 0:r.id)||""}function J0(e){return`${e} web`}function Z0({item:e,search:t,className:r}){const i=H0(e);return i.statuses.length===0&&i.states.length===0&&i.fingers.length===0&&i.sources.length===0&&!t?null:_.jsxs("div",{className:je("flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[11px]",r),children:[i.statuses.map(o=>_.jsx(Yr,{tone:K0(o),children:o},`http:${o}`)),i.states.map(o=>_.jsx(Yr,{tone:V0(o),children:o},`state:${o}`)),_.jsx(ry,{fingers:i.fingers}),_.jsx(ty,{sources:i.sources}),t&&_.jsx("span",{className:"break-all font-mono text-muted-foreground",children:t})]})}function e4({asset:e,items:t}){return _.jsx("div",{className:"space-y-2",children:t.map((r,i)=>_.jsx(t4,{item:r,asset:e},`${r.kind}-${r.source}-${r.target}-${r.title}-${i}`))})}function t4({item:e,asset:t}){const r=Aa(e),i=r?o4(e.summary,e.title):x3(e),o=s4(e),l=Ga("item",n4(e,t)),a=e.target&&!w3(e.target,t.target),c=[{id:`kind:${e.kind}`,label:e.kind,tone:b3(e.kind)}],f=S3(e.tags,[...c.map(g=>g.label),...m3(e)]),h=e.source==="verify"||e.source==="sniper"||e.source==="deep";return _.jsxs("div",{id:l,className:je("scroll-mt-24 rounded-md border p-3 text-xs",h&&e.status==="confirmed"&&"border-l-4 border-l-green-500",h&&e.source==="sniper"&&"border-l-4 border-l-red-500",h&&e.source==="deep"&&"border-l-4 border-l-yellow-500",e.kind==="error"?"border-red-400/20 bg-red-400/10":e.kind==="loot"?"border-red-400/20 bg-red-400/5":"border-border/70 bg-background/30"),children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx(l4,{kind:e.kind}),c.map(g=>_.jsx(Yr,{tone:g.tone,children:g.label},g.id)),_.jsx(r4,{source:e.source,status:e.status}),_.jsx(Zd,{id:l,label:`Link to ${i||e.kind}`}),a&&_.jsx("span",{className:"break-all font-mono text-muted-foreground",children:e.target})]}),i&&_.jsx("div",{className:"mt-1 break-words text-foreground",children:i}),_.jsx(Z0,{item:e,className:"mt-2"}),o&&_.jsxs("div",{className:je("mt-2 max-h-96 overflow-auto rounded-md p-3 text-muted-foreground",h?"border-l-4 border-l-cyber-400 bg-cyber-500/5":"border border-border bg-background/50"),children:[h&&_.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase text-cyber-700 dark:text-cyber-400",children:e.source==="verify"?"AI Verification":e.source==="sniper"?"CVE Intelligence":"Dynamic Analysis"}),r?_.jsx(Vd,{content:o,compact:!0,muted:!0}):_.jsx("div",{className:"whitespace-pre-wrap",children:o})]}),f.length>0&&_.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:f.map(g=>_.jsx(Yr,{tone:g.tone,children:g.label},g.id))})]})}function r4({source:e,status:t}){return e==="verify"?t==="confirmed"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-green-400/10 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[_.jsx(gn,{className:"h-3 w-3"}),"Confirmed"]}):t==="not_confirmed"?_.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not Confirmed"}):t==="inconclusive"?_.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:"Inconclusive"}):_.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-blue-400/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 dark:text-blue-400",children:"Info"}):e==="sniper"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-400/10 px-1.5 py-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[_.jsx(Wa,{className:"h-3 w-3"}),"CVE Intel"]}):e==="deep"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:[_.jsx(Ua,{className:"h-3 w-3"}),"Deep Test"]}):null}function Zd({id:e,label:t}){return _.jsx("a",{href:`#${e}`,"aria-label":t,title:t,onClick:r=>r.stopPropagation(),className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground opacity-60 hover:bg-accent hover:text-foreground hover:opacity-100",children:_.jsx(wv,{className:"h-3 w-3"})})}function Ga(e,t){return`asset-${e}-${i4(t)}`}function n4(e,t){return[t.key,e.kind,e.source,e.target,e.status,e.title,e.summary].filter(Boolean).join("|")}function i4(e){return(e.trim().toLowerCase().replace(/<[^>]*>/g,"").replace(/&[a-z0-9#]+;/g,"").replace(/[^a-z0-9\u4e00-\u9fa5]+/g,"-").replace(/^-+|-+$/g,"")||"section").slice(0,96)}function s4(e){return G0(e)}function o4(...e){var t;return((t=e.find(r=>r&&r.trim()))==null?void 0:t.trim())||""}function l4({kind:e}){return e==="loot"?_.jsx(mv,{className:"h-3.5 w-3.5 text-red-700 dark:text-red-300"}):e==="note"||e==="response"?_.jsx(pv,{className:"h-3.5 w-3.5 text-cyber-700 dark:text-cyber-300"}):e==="fingerprint"?_.jsx(kd,{className:"h-3.5 w-3.5 text-yellow-700 dark:text-yellow-300"}):_.jsx(Cd,{className:"h-3.5 w-3.5 text-muted-foreground"})}function a4({items:e}){const t=te.useMemo(()=>g3(e),[e]),r=te.useMemo(()=>_3(t),[t]),[i,o]=te.useState(()=>e_(t));te.useEffect(()=>{o(e_(t))},[t]);const l=a=>{o(c=>{const f=new Set(c);return f.has(a)?f.delete(a):f.add(a),f})};return _.jsxs("div",{className:"overflow-hidden rounded-md border border-border/70 bg-background/30",children:[r.length>0&&_.jsxs("div",{className:"flex items-center justify-end gap-1 border-b border-border/70 px-2 py-1",children:[_.jsx(l_,{label:"Expand all",onClick:()=>o(new Set(r)),children:_.jsx(_v,{className:"h-3.5 w-3.5"})}),_.jsx(l_,{label:"Collapse all",onClick:()=>o(new Set),children:_.jsx(vv,{className:"h-3.5 w-3.5"})})]}),_.jsx("div",{role:"tree","aria-label":"Sitemap",children:t.map(a=>_.jsx(ey,{node:a,depth:0,openIDs:i,onToggle:l},a.id))})]})}function ey({node:e,depth:t,openIDs:r,onToggle:i}){const o=e.children.length>0,l=r.has(e.id),a=`${.6+t*1.15}rem`,c=e.children.length+e.items.length;return o?_.jsxs("div",{role:"treeitem","aria-expanded":l,children:[_.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 py-1.5 pr-3 text-left text-xs hover:bg-secondary/40",style:{paddingLeft:a},onClick:()=>i(e.id),children:[_.jsx($a,{className:je("h-3 w-3 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")}),l?_.jsx(_v,{className:"h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}):_.jsx(vv,{className:"h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}),_.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",children:e.name}),_.jsx("span",{className:"shrink-0 text-muted-foreground",children:c})]}),l&&_.jsxs("div",{role:"group",children:[e.items.map((f,h)=>_.jsx(o_,{item:f,depth:t+1},`${t_(f)}:${h}`)),e.children.map(f=>_.jsx(ey,{node:f,depth:t+1,openIDs:r,onToggle:i},f.id))]})]}):_.jsx(_.Fragment,{children:e.items.map((f,h)=>_.jsx(o_,{item:f,depth:t},`${t_(f)}:${h}`))})}function o_({item:e,depth:t}){const r=`${.6+t*1.15}rem`,i=v3(e),o=y3(e);return _.jsxs("div",{role:"treeitem",className:"py-1.5 pr-3 text-xs hover:bg-secondary/30",style:{paddingLeft:r},children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx(fw,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),_.jsx("span",{className:"break-all font-mono text-foreground",children:i}),e.title&&_.jsx("span",{className:"text-muted-foreground",children:e.title})]}),_.jsx(Z0,{item:e,search:o,className:"mt-1 pl-5"})]})}function ty({sources:e,className:t}){if(e.length===0)return null;const r=e.slice(0,5),i=e.length-r.length;return _.jsxs("span",{className:je("inline-flex min-w-0 flex-wrap items-center gap-1 text-cyber-700 dark:text-cyber-300",t),title:"Sources",children:[_.jsx(Cd,{className:"h-3 w-3 shrink-0"}),r.map(o=>_.jsx("span",{className:"rounded bg-cyber-500/10 px-1.5 py-0.5 text-[10px]",children:o},`source:${o}`)),i>0&&_.jsxs("span",{className:"rounded bg-cyber-500/10 px-1.5 py-0.5 text-[10px]",children:["+",i]})]})}function ry({fingers:e}){if(e.length===0)return null;const t=e.slice(0,5),r=e.length-t.length;return _.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-center gap-1 text-yellow-700 dark:text-yellow-300",title:"Fingerprints",children:[_.jsx(kd,{className:"h-3 w-3 shrink-0"}),t.map(i=>_.jsx("span",{className:"rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px]",children:i},`finger:${i}`)),r>0&&_.jsxs("span",{className:"rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px]",children:["+",r]})]})}function l_({children:e,label:t,onClick:r}){return _.jsx("button",{type:"button","aria-label":t,title:t,onClick:r,className:"inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-background text-muted-foreground hover:border-cyber-400/30 hover:text-foreground",children:e})}function u4({active:e,count:t,label:r,onClick:i}){return _.jsxs("button",{type:"button",onClick:i,className:je("rounded border px-2 py-1 text-[10px] font-medium transition-colors",e?"border-cyber-400/40 bg-cyber-500/15 text-cyber-800 dark:text-cyber-200":"border-border bg-background text-muted-foreground hover:border-cyber-400/30 hover:text-foreground"),children:[r,typeof t=="number"&&t>0&&_.jsxs(_.Fragment,{children:[" ",_.jsx("span",{className:"opacity-70",children:t})]})]})}function dn({label:e,value:t}){return _.jsxs("div",{children:[_.jsx("div",{className:"text-[10px] uppercase text-muted-foreground",children:e}),_.jsx("div",{className:"mt-1 font-mono text-sm text-foreground",children:t})]})}function c4({title:e,children:t}){return _.jsxs("div",{className:"rounded-lg border border-border bg-card/50",children:[_.jsx("div",{className:"border-b border-border px-4 py-2 text-sm font-medium text-cyber-700 dark:text-cyber-400",children:e}),_.jsx("div",{className:"p-4",children:t})]})}function Yr({children:e,tone:t="muted"}){return _.jsx("span",{className:je("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium",t==="cyan"&&"bg-cyber-500/10 text-cyber-700 dark:text-cyber-300",t==="yellow"&&"bg-yellow-400/10 text-yellow-700 dark:text-yellow-300",t==="green"&&"bg-green-400/10 text-green-700 dark:text-green-300",t==="red"&&"bg-red-400/10 text-red-700 dark:text-red-300",t==="muted"&&"bg-background text-muted-foreground"),children:e})}const a_={critical:{bg:"bg-red-500/15",text:"text-red-600 dark:text-red-400",border:"border-red-500/30",dot:"bg-red-500"},high:{bg:"bg-orange-500/15",text:"text-orange-600 dark:text-orange-400",border:"border-orange-500/30",dot:"bg-orange-500"},medium:{bg:"bg-yellow-500/15",text:"text-yellow-600 dark:text-yellow-400",border:"border-yellow-500/30",dot:"bg-yellow-500"},low:{bg:"bg-green-500/15",text:"text-green-600 dark:text-green-400",border:"border-green-500/30",dot:"bg-green-500"},info:{bg:"bg-blue-500/15",text:"text-blue-600 dark:text-blue-400",border:"border-blue-500/30",dot:"bg-blue-500"}};function h4({result:e}){const t=te.useMemo(()=>Jd(e),[e]),[r,i]=te.useState("all"),o=te.useMemo(()=>r==="all"?t:r==="ai_verified"?t.filter(c=>c.source==="verify"&&c.status==="confirmed"):t.filter(c=>c.priority===r),[t,r]),l=te.useMemo(()=>{var f;const c={};for(const h of o)(c[f=h.priority]||(c[f]=[])).push(h);return c},[o]);if(t.length===0)return _.jsxs("div",{className:"py-12 text-center text-sm text-muted-foreground",children:[_.jsx(ki,{className:"mx-auto mb-3 h-8 w-8 opacity-40"}),_.jsx("p",{children:"No findings yet."})]});const a=t.filter(c=>c.source==="verify"&&c.status==="confirmed").length;return _.jsxs("div",{className:"space-y-4 animate-fade-in",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[_.jsxs(ch,{active:r==="all",onClick:()=>i("all"),children:["All (",t.length,")"]}),fs.map(c=>{const f=t.filter(h=>h.priority===c).length;return f===0?null:_.jsxs(ch,{active:r===c,onClick:()=>i(c),children:[_.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",a_[c].dot)}),c.charAt(0).toUpperCase()+c.slice(1)," (",f,")"]},c)}),a>0&&_.jsxs(ch,{active:r==="ai_verified",onClick:()=>i("ai_verified"),children:[_.jsx(gn,{className:"h-3 w-3 text-green-600 dark:text-green-400"}),"AI Verified (",a,")"]})]}),fs.map(c=>{const f=l[c];if(!f||f.length===0)return null;const h=a_[c];return _.jsxs("div",{className:je("rounded-lg border",h.border),children:[_.jsxs("div",{className:je("flex items-center gap-2 border-b px-4 py-2 text-xs font-semibold uppercase",h.border,h.bg,h.text),children:[_.jsx("span",{className:je("h-2.5 w-2.5 rounded-full",h.dot)}),c," (",f.length,")"]}),_.jsx("div",{className:"divide-y divide-border/50",children:f.map(g=>_.jsx(d4,{item:g},g.id))})]},c)})]})}function d4({item:e}){const[t,r]=te.useState(!1);return _.jsxs("div",{className:"p-3 text-xs",children:[_.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx(f4,{kind:e.kind}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx("span",{className:"font-medium text-foreground break-words",children:e.title}),_.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e.kind}),_.jsx(p4,{source:e.source,status:e.status})]}),_.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[_.jsx("span",{className:"break-all font-mono",children:e.target}),e.tags.slice(0,5).map(i=>_.jsx("span",{className:"rounded bg-secondary/80 px-1.5 py-0.5 text-[10px]",children:i},i)),e.tags.length>5&&_.jsxs("span",{className:"text-[10px]",children:["+",e.tags.length-5]})]})]})]}),e.detail&&_.jsx("div",{className:"mt-2",children:t?_.jsxs("div",{className:"mt-1 rounded-md border-l-4 border-l-cyber-400 bg-cyber-500/5 p-3",children:[_.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[_.jsx("span",{className:"text-[10px] font-medium uppercase text-cyber-700 dark:text-cyber-400",children:e.source==="verify"?"AI Verification":e.source==="sniper"?"CVE Intelligence":"Analysis"}),_.jsx("button",{type:"button",className:"text-[10px] text-muted-foreground hover:text-foreground",onClick:()=>r(!1),children:"Hide"})]}),_.jsx("div",{className:"max-h-72 overflow-auto text-muted-foreground",children:_.jsx(Vd,{content:e.detail,compact:!0,muted:!0})})]}):_.jsx("button",{type:"button",className:"text-[11px] text-cyber-700 dark:text-cyber-400 hover:underline",onClick:()=>r(!0),children:"Show AI Analysis"})})]})}function f4({kind:e}){switch(e){case"vuln":return _.jsx(mv,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400"});case"weakpass":return _.jsx(mw,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-600 dark:text-orange-400"});case"fingerprint":return _.jsx(ki,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-yellow-600 dark:text-yellow-400"});default:return _.jsx(ki,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"})}}function p4({source:e,status:t}){return e==="verify"&&t==="confirmed"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-green-400/10 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[_.jsx(gn,{className:"h-3 w-3"}),"AI Verified"]}):e==="verify"&&t==="not_confirmed"?_.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not Confirmed"}):e==="verify"&&t==="inconclusive"?_.jsx("span",{className:"rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:"Inconclusive"}):e==="sniper"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-400/10 px-1.5 py-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[_.jsx(Wa,{className:"h-3 w-3"}),"CVE Intel"]}):e==="deep"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:[_.jsx(Ua,{className:"h-3 w-3"}),"Deep Test"]}):null}function ch({active:e,onClick:t,children:r}){return _.jsx("button",{type:"button",onClick:t,className:je("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors",e?"border-cyber-400/40 bg-cyber-500/15 text-cyber-800 dark:text-cyber-200":"border-border bg-background text-muted-foreground hover:border-cyber-400/30 hover:text-foreground"),children:r})}function m4({scan:e,lines:t,report:r,result:i,logCollapsed:o,onToggleLog:l}){const a=!!r,c=!!i,f=c||a,h=e.status==="running",g=!!e.verify||!!e.ai&&!e.sniper,m=!!e.sniper||!!e.ai&&!e.verify,x=g||m||!!e.deep,y=te.useMemo(()=>i?Jd(i).length:0,[i]),S=y>0,[k,E]=te.useState("assets");return te.useEffect(()=>{!c&&f?E("report"):c&&S&&x?E("findings"):c&&E("assets")},[f,c,S,x,e.id]),_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[_.jsx("span",{className:"font-mono text-sm text-foreground",children:e.target}),_.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-secondary",children:e.mode}),g&&_.jsx("span",{className:"text-xs text-cyber-700 dark:text-cyber-300 px-2 py-0.5 rounded bg-cyber-500/10",children:"Verify"}),m&&_.jsx("span",{className:"text-xs text-red-700 dark:text-red-300 px-2 py-0.5 rounded bg-red-400/10",children:"Sniper"}),e.deep&&_.jsx("span",{className:"text-xs text-yellow-700 dark:text-yellow-300 px-2 py-0.5 rounded bg-yellow-400/10",children:"Deep"}),_.jsx(g4,{status:e.status})]}),(t.length>0||h)&&_.jsx(yS,{lines:t,status:e.status,collapsed:o,onToggleCollapse:l}),f&&_.jsxs("div",{className:"space-y-3",children:[c&&f&&_.jsxs("div",{className:"inline-flex items-center rounded-md border border-input bg-secondary/50 p-0.5",children:[_.jsxs(hh,{active:k==="assets",onClick:()=>E("assets"),children:[_.jsx(Nw,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:"Assets"})]}),S&&_.jsxs(hh,{active:k==="findings",onClick:()=>E("findings"),children:[_.jsx(ki,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:"Findings"}),_.jsx("span",{className:"ml-1 rounded-full bg-red-500/20 px-1.5 py-0.5 text-[10px] font-bold text-red-600 dark:text-red-400",children:y})]}),_.jsxs(hh,{active:k==="report",onClick:()=>E("report"),children:[_.jsx(dw,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:"Report"})]})]}),c&&k==="assets"&&_.jsx(q3,{result:i}),c&&k==="findings"&&_.jsx(h4,{result:i}),f&&k==="report"&&_.jsx("div",{className:"animate-fade-in",children:_.jsx(c3,{scan:e,report:r,result:i})})]})]})}function hh({active:e,children:t,onClick:r}){return _.jsx("button",{type:"button",onClick:r,className:je("inline-flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-xs font-medium transition-all",e?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t})}function g4({status:e}){const t={queued:{label:"Queued",className:"text-gray-600 bg-gray-400/10 dark:text-gray-400"},running:{label:"Running",className:"text-blue-700 bg-blue-400/10 dark:text-blue-400 animate-pulse"},completed:{label:"Completed",className:"text-cyber-700 bg-cyber-400/10 dark:text-cyber-400"},failed:{label:"Failed",className:"text-red-700 bg-red-400/10 dark:text-red-400"},canceled:{label:"Canceled",className:"text-yellow-700 bg-yellow-400/10 dark:text-yellow-400"}},{label:r,className:i}=t[e]||t.queued;return _.jsx("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${i}`,children:r})}async function _4(){return Pi("/api/status","Failed to load status")}async function v4(){return Pi("/api/agents","Failed to list agents")}async function y4(){return Pi("/api/config/llm","Failed to load LLM config")}async function x4(e){return Pi("/api/config/llm","Failed to save LLM config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function w4(e,t,r){return Pi("/api/scans","Failed to submit scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:e,mode:t,...r})})}async function Oh(e){return Pi(`/api/scans/${encodeURIComponent(e)}`,"Scan not found")}async function S4(){return Pi("/api/scans","Failed to list scans")}function b4(e,t){const r=new EventSource(`/api/scans/${encodeURIComponent(e)}/events`),i=o=>l=>{const a="data"in l?l.data:void 0;if(typeof a!="string"||a===""){o==="error"&&Oh(e).then(f=>{f.status==="completed"?(t({type:"complete",scan_id:e,status:f.status}),r.close()):(f.status==="failed"||f.status==="canceled")&&(t({type:"error",scan_id:e,error:f.error||`Scan ${f.status}`}),r.close())}).catch(()=>{});return}let c;try{const f=JSON.parse(a),h=o==="output"?"progress":o,g=(f==null?void 0:f.type)==="output"?"progress":(f==null?void 0:f.type)||h;c={scan_id:e,...f,type:g}}catch{c={type:o==="output"?"progress":o,scan_id:e,data:a}}t(c),(c.type==="complete"||c.type==="error")&&r.close()};return r.addEventListener("progress",i("progress")),r.addEventListener("status",i("status")),r.addEventListener("complete",i("complete")),r.addEventListener("error",i("error")),r.addEventListener("output",i("output")),()=>r.close()}function k4(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/agents/${encodeURIComponent(e)}/terminal/ws`}async function Pi(e,t,r){const i=await fetch(e,r);if(!i.ok)throw new Error(await C4(i,t));return i.json()}async function C4(e,t){try{const r=await e.json();return(r==null?void 0:r.error)||t}catch{return t}}const E4={config_loaded:!1,provider:"",base_url:"",api_key:"",api_key_configured:!1,model:"",proxy:""};function N4({open:e,status:t,onClose:r,onSaved:i}){const[o,l]=te.useState(E4),[a,c]=te.useState(!1),[f,h]=te.useState(!1),[g,m]=te.useState(""),[x,y]=te.useState(!1);if(te.useEffect(()=>{e&&(c(!0),m(""),y(!1),y4().then(E=>l({...E,api_key:""})).catch(E=>m(E.message||"Failed to load LLM config")).finally(()=>c(!1)))},[e]),!e)return null;const S=(E,L)=>{l(W=>({...W,[E]:L}))},k=async E=>{E.preventDefault(),h(!0),m(""),y(!1);try{const L=await x4(o);l({...L,api_key:""}),y(!0),i()}catch(L){m(L.message||"Failed to save LLM config")}finally{h(!1)}};return _.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-background/80 px-4 py-8 backdrop-blur-sm",children:_.jsxs("form",{onSubmit:k,className:"w-full max-w-2xl rounded-lg border border-border bg-card shadow-xl",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(kv,{className:"h-4 w-4 text-cyber-400"}),_.jsxs("div",{children:[_.jsx("div",{className:"text-sm font-medium text-foreground",children:"LLM Config"}),_.jsx("div",{className:"text-xs text-muted-foreground",children:o.config_path||(t==null?void 0:t.config_path)||"config.yaml"})]})]}),_.jsx("button",{type:"button",onClick:r,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:_.jsx(jo,{className:"h-4 w-4"})})]}),_.jsxs("div",{className:"space-y-4 p-4",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[_.jsx(dh,{active:!!(t!=null&&t.llm_available),label:t!=null&&t.llm_available?"LLM Ready":"LLM Offline"}),_.jsx(dh,{active:!!o.config_loaded,label:o.config_loaded?"Config Loaded":"Config Missing"}),_.jsx(dh,{active:!!o.api_key_configured,label:o.api_key_configured?"API Key Set":"API Key Empty"})]}),a?_.jsxs("div",{className:"flex h-48 items-center justify-center text-muted-foreground",children:[_.jsx(Na,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading"]}):_.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[_.jsx(fo,{label:"Provider",children:_.jsxs("select",{value:o.provider,onChange:E=>S("provider",E.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[_.jsx("option",{value:"",children:"Select provider"}),_.jsx("option",{value:"deepseek",children:"deepseek"}),_.jsx("option",{value:"openai",children:"openai"}),_.jsx("option",{value:"openrouter",children:"openrouter"}),_.jsx("option",{value:"ollama",children:"ollama"}),_.jsx("option",{value:"groq",children:"groq"}),_.jsx("option",{value:"moonshot",children:"moonshot"}),_.jsx("option",{value:"anthropic",children:"anthropic"})]})}),_.jsx(fo,{label:"Model",children:_.jsx(yi,{value:o.model,onChange:E=>S("model",E.target.value),placeholder:"deepseek-v4-pro / gpt-4.1 / qwen2.5"})}),_.jsx(fo,{label:"Base URL",children:_.jsx(yi,{value:o.base_url,onChange:E=>S("base_url",E.target.value),placeholder:"leave empty for provider default"})}),_.jsx(fo,{label:"Proxy",children:_.jsx(yi,{value:o.proxy,onChange:E=>S("proxy",E.target.value),placeholder:"http://127.0.0.1:7890"})}),_.jsx("div",{className:"sm:col-span-2",children:_.jsx(fo,{label:"API Key",children:_.jsx(yi,{type:"password",value:o.api_key||"",onChange:E=>S("api_key",E.target.value),placeholder:o.api_key_configured?"configured; leave blank to keep current key":"required unless provider is ollama"})})})]}),g&&_.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:g}),x&&_.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-cyber-400/30 bg-cyber-400/10 px-3 py-2 text-sm text-cyber-700 dark:text-cyber-300",children:[_.jsx(uw,{className:"h-4 w-4"}),"Saved and runtime reloaded"]})]}),_.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-4 py-3",children:[_.jsx(Jn,{type:"button",variant:"outline",onClick:r,children:"Close"}),_.jsxs(Jn,{type:"submit",disabled:a||f,className:"bg-cyber-600 text-white hover:bg-cyber-500",children:[f&&_.jsx(Na,{className:"h-4 w-4 animate-spin"}),"Save"]})]})]})})}function fo({label:e,children:t}){return _.jsxs("label",{className:"block space-y-1.5",children:[_.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e}),t]})}function dh({active:e,label:t}){return _.jsx("span",{className:`rounded-full border px-2.5 py-1 ${e?"border-cyber-400/30 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300":"border-yellow-400/30 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"}`,children:t})}/** +`}function Z5(e,t){const r=t.summary;e.push("## Summary",""),e.push("| Metric | Value |"),e.push("|---|---:|"),e.push(`| Targets | ${r.targets||0} |`),e.push(`| Services | ${r.services||0} |`),e.push(`| Web | ${r.webs||0} |`),e.push(`| Probes | ${r.probes||0} |`),e.push(`| Fingerprints | ${c3(t.assets||[])} |`),e.push(`| Loots | ${r.loots||(t.loots||[]).length||h3(t.assets||[])} |`),e.push(`| Errors | ${r.errors||0} |`),r.duration&&e.push(`| Duration | ${W0(r.duration)} |`),e.push("")}function e3(e,t){const r=t.map(i=>({loot:i,summary:s3(i),content:Kd(i)})).filter(i=>i.content);if(r.length!==0){e.push("## Analysis","");for(const{loot:i,summary:o,content:l}of r){const a=o||`${i.kind||"loot"} ${i.target||""}`.trim();e.push(`### ${Yd(a)}`,""),i.kind&&e.push(`**Kind:** ${Jn(i.kind)}`,""),i.priority&&e.push(`**Priority:** ${Jn(i.priority)}`,""),i.target&&e.push(`**Target:** ${Jn(i.target)}`,""),l&&!$0(o,l)?e.push(l,""):o&&e.push(o,"")}}}function t3(e,t){if(t.length!==0){e.push("## Loots",""),e.push("| Kind | Target | Priority | Description |"),e.push("|---|---|---|---|");for(const r of t)e.push([ua(r.kind),ua(r.target),ua(r.priority||""),ua(r.description||qd(Kd(r)))].join(" | ").replace(/^/,"| ").replace(/$/," |"));e.push("")}}function r3(e,t,r){if(t.length!==0){e.push("## Assets","");for(const i of t){const o=Jr(i.title,i.target,i.key,"Asset");e.push(`### ${Yd(o)}`,""),i.target&&i.target!==o&&e.push(`- **Target:** ${Jn(i.target)}`),i.status&&e.push(`- **State:** ${Jn(i.status)}`),aa(e,"Services",l3(i.items||[])),aa(e,"HTTP",a3(i.items||[])),aa(e,"Fingers",H0(i.items||[])),aa(e,"Sources",u3(i.items||[]));const l=(i.items||[]).filter(a=>a.kind==="path").length;l>0&&e.push(`- **Paths:** ${l}`),e.push(""),n3(e,i.items||[],r)}}}function n3(e,t,r){const i=t.filter(o=>["loot","note","response","error"].includes(o.kind)).filter(o=>!(r&&o.kind==="loot")).map(o=>({item:o,summary:Jr(o.summary,o.title),content:o3(o)})).filter(o=>o.summary||o.content);if(i.length!==0){e.push("#### Analysis","");for(const{item:o,summary:l,content:a}of i){const c=l||qd(a)||o.kind;e.push(`##### ${Yd(c)}`,"");const f=[Jr(o.source,o.kind),o.status].filter(Boolean).join(":");f&&e.push(`**Source:** ${Jn(f)}`,""),a&&!$0(l,a)?e.push(a,""):l&&e.push(l,"")}}}function i3(e,t){if(!(!t||t.length===0)){e.push("## Errors","");for(const r of t)e.push(`- ${Jr(r.source,"scan")}: ${r.message}`);e.push("")}}function aa(e,t,r){r.length!==0&&e.push(`- **${t}:** ${r.map(Jn).join(", ")}`)}function s3(e){return Jr(e.description,qd(Kd(e)))}function Kd(e){var t,r,i,o,l,a,c;return Jr(at((t=e.data)==null?void 0:t.content),at((r=e.data)==null?void 0:r.detail),at((i=e.data)==null?void 0:i.markdown),at((o=e.data)==null?void 0:o.narrative),at((l=e.data)==null?void 0:l.evidence),at((a=e.data)==null?void 0:a.response),at((c=e.data)==null?void 0:c.output))}function o3(e){var t,r,i,o,l,a,c;return Jr(e.detail,at((t=e.data)==null?void 0:t.content),at((r=e.data)==null?void 0:r.detail),at((i=e.data)==null?void 0:i.markdown),at((o=e.data)==null?void 0:o.narrative),at((l=e.data)==null?void 0:l.evidence),at((a=e.data)==null?void 0:a.response),at((c=e.data)==null?void 0:c.output))}function l3(e){return To(e.filter(t=>t.kind==="service").map(t=>{var r,i,o;return To([at((r=t.data)==null?void 0:r.protocol),at((i=t.data)==null?void 0:i.service),at((o=t.data)==null?void 0:o.port)]).join(" ")}))}function a3(e){return To(e.filter(t=>t.kind==="path").map(t=>{var r;return Jr(t.status,at((r=t.data)==null?void 0:r.status))}))}function H0(e){return To(e.flatMap(t=>{var r,i;return t.kind==="fingerprint"?[Jr(t.title,at((r=t.data)==null?void 0:r.name))]:t.kind==="path"?d3((i=t.data)==null?void 0:i.fingers):[]}))}function u3(e){return To(e.map(t=>{var r;return Jr(t.source,at((r=t.data)==null?void 0:r.source))}))}function c3(e){return H0(e.flatMap(t=>t.items||[])).length}function h3(e){return e.flatMap(t=>t.items||[]).filter(t=>{var r;return t.kind==="loot"&&at((r=t.data)==null?void 0:r.kind).toLowerCase()!=="fingerprint"}).length}function at(e){return typeof e=="string"?e:typeof e=="number"&&Number.isFinite(e)?String(e):""}function d3(e){return Array.isArray(e)?e.map(at).filter(Boolean):typeof e=="string"?e.split(/[;,]/).map(t=>t.trim()).filter(Boolean):[]}function qd(e){return e.split(` +`).map(t=>t.trim()).find(Boolean)||""}function Jr(...e){var t;return((t=e.find(r=>r&&r.trim()))==null?void 0:t.trim())||""}function To(e){const t=new Set,r=[];for(const i of e){const o=i.trim(),l=o.toLowerCase();!o||t.has(l)||(t.add(l),r.push(o))}return r}function $0(e,t){return e.trim()===t.trim()}function Jn(e){return`\`${String(e).replace(/`/g,"'")}\``}function Yd(e){return e.trim().replace(/\s*\n+\s*/g," ").replace(/^#+\s*/,"")||"Analysis"}function ua(e){return W0(e.replace(/\s*\n+\s*/g," ").trim())}function W0(e){return e.replace(/\|/g,"\\|")}function f3(e){if(!e)return new Date().toLocaleString();const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function p3({report:e="",result:t,scan:r}){const i=t?J5(r,t):e;return i?_.jsx("div",{className:"rounded-lg border border-border bg-card/50 p-6 overflow-auto",children:_.jsx(Vd,{content:i,className:"prose-h2:mt-6"})}):_.jsx("div",{className:"text-muted-foreground text-center py-12 text-sm",children:"No report available yet."})}const Wt={service:"service",path:"path",fingerprint:"fingerprint",loot:"loot",note:"note",response:"response",error:"error"};function m3(e){var i;const t=g3(e.assets||[]),r=_3(t);return{hosts:r,metrics:{assets:t.length,hosts:r.length,services:e.summary.services,web:e.summary.webs,probes:e.summary.probes,fingers:T3(t),loots:e.summary.loots||((i=e.loots)==null?void 0:i.length)||M3(t),errors:e.summary.errors,duration:e.summary.duration}}}function g3(e){return e.map(t=>({...t,id:t.id||`asset:${t.key||t.target||"scan"}`,key:t.key||Do(t.target||"scan"),target:t.target||t.key||"Scan",items:t.items||[]}))}function _3(e){const t=new Map;for(const r of e){const i=v3(r),o=Do(i.host||"Scan");let l=t.get(o);l||(l={id:`host:${o}`,host:i.host||"Scan",services:[]},t.set(o,l)),l.services.push(i)}return Array.from(t.values()).map(r=>({...r,services:r.services.sort(D3)})).sort((r,i)=>r.host.localeCompare(i.host))}function v3(e){const t=e.items.find(S=>S.kind===Wt.service),r=e.items.filter(S=>S.kind===Wt.path),i=e.items.filter(Aa),o=e.items.filter(S=>S.kind!==Wt.path&&!Aa(S)),l=Nr(Pt(t,"protocol"),Pt(t,"service")),a=Nr(Pt(t,"service"),t==null?void 0:t.title,l),c=Pt(t,"ip")||"Scan",f=Pt(t,"port"),h=Nr(t==null?void 0:t.target,e.target),g=P3(e,t,a),m=R3(e,t,g,a),x=l.toLowerCase(),y=r.length>0||B3(t,"is_web")||x.startsWith("http");return{id:e.id||`service:${e.key||e.target}`,asset:e,host:c,port:f,protocol:l,service:a,target:h,title:g,summary:m,sources:q0(e.items),states:K0(e.items),statuses:V0(r),fingers:Xd(e.items),paths:r,analysisItems:i,detailItems:o,pathCount:r.length,web:y}}function U0(e){return{statuses:V0([e]),states:K0([e]),fingers:Xd([e]),sources:q0([e])}}function y3(e){const t=U0(e);return[...t.statuses,...t.states,...t.fingers,...t.sources]}function Aa(e){return e.kind===Wt.note||e.kind===Wt.response||e.kind===Wt.error?!0:!(e.kind!==Wt.loot||Pt(e,"kind").toLowerCase()==="fingerprint")}function x3(e){const t={children:[]};for(const r of e)A3(t,r);return G0(t.children)}function e_(e){const t=new Set;return Gd(e,(r,i)=>{i<1&&t.add(r.id)}),t}function w3(e){const t=[];return Gd(e,r=>t.push(r.id)),t}function S3(e){const t=Pt(e,"path")||Qd(e.target),r=t.split("?")[0]||"/";if(r==="/")return"/";const i=r.split("/").filter(Boolean),o=i[i.length-1]||"/";return t.includes("?")?`${o}?${t.split("?").slice(1).join("?")}`:o}function b3(e){const t=Pt(e,"path")||Qd(e.target),r=t.indexOf("?");return r>=0?t.slice(r):""}function t_(e){return`${Do(Pt(e,"url")||e.target||Pt(e,"path"))}|host=${Pt(e,"host_header")}`}function k3(e){return Nr(e.summary,e.title)}function C3(e,t){return Do(n_(e)||e)===Do(n_(t)||t)}function V0(e){return Ho(e.filter(t=>t.kind===Wt.path).map(t=>Nr(t.status,Pt(t,"status"))).filter(t=>t&&Q0(t)))}function K0(e){return Ho(e.filter(t=>t.kind!==Wt.path).map(t=>t.status).filter(t=>t&&!Q0(t)))}function Xd(e){return Ho(e.filter(t=>t.kind===Wt.fingerprint||t.kind===Wt.path).flatMap(t=>t.kind===Wt.fingerprint?[Nr(t.title,Pt(t,"name"))]:I3(t,"fingers")).filter(Boolean))}function q0(e){return Ho(e.map(t=>Nr(t.source,Pt(t,"source"))).filter(Boolean))}function E3(e,t,r){const i=new Set(t.map(gn).filter(Boolean));return O3((e||[]).filter(o=>!i.has(gn(o))).map(o=>({id:`tag:${o}`,label:o,tone:r})))}function N3(e){return e===Wt.loot?"red":e===Wt.note||e===Wt.response?"cyan":"muted"}function Y0(e){switch((e||"").toLowerCase()){case"confirmed":case"critical":case"high":case"loot":case"error":case"failed":return"red";case"medium":case"inconclusive":return"yellow";case"low":return"green";default:return"muted"}}function X0(e){const t=Number(e);return Number.isFinite(t)?t>=500?"red":t>=400?"yellow":t>=200&&t<400?"green":"muted":"muted"}function L3(e,t){return`${e} ${e===1?t:`${t}s`}`}function P3(e,t,r){const i=Nr(e.title);return i&&i!==e.target&&gn(i)!==gn(r)?i:Nr(Pt(t,"banner"),t==null?void 0:t.summary)}function R3(e,t,r,i){const o=[Pt(t,"banner"),t==null?void 0:t.summary,e.status];return Nr(...o.filter(l=>gn(l)!==gn(r)&&gn(l)!==gn(i)))}function M3(e){return e.reduce((t,r)=>t+r.items.filter(i=>i.kind===Wt.loot&&Pt(i,"kind").toLowerCase()!=="fingerprint").length,0)}function T3(e){return Ho(e.flatMap(t=>Xd(t.items))).length}function D3(e,t){const r=Number.parseInt(e.port,10),i=Number.parseInt(t.port,10);return Number.isFinite(r)&&Number.isFinite(i)&&r!==i?r-i:`${e.port}|${e.service}|${e.target}`.localeCompare(`${t.port}|${t.service}|${t.target}`)}function A3(e,t){const i=(Pt(t,"path")||Qd(t.target)).split("?")[0]||"/";if(i==="/"){r_(e,"/","/").items.push(t);return}const o=i.split("/").filter(Boolean);let l=e,a="";o.forEach((c,f)=>{a+=`/${c}`;const h=r_(l,c,a);if(f===o.length-1){h.items.push(t);return}l=h})}function r_(e,t,r){let i=e.children.find(o=>o.path===r);return i||(i={id:r,name:t,path:r,children:[],items:[]},e.children.push(i)),i}function G0(e){return e.map(t=>({...t,children:G0(t.children)})).sort((t,r)=>{const i=t.children.length>0?0:1,o=r.children.length>0?0:1;return`${i}|${t.name}`.localeCompare(`${o}|${r.name}`)})}function Gd(e,t,r=0){for(const i of e)i.children.length!==0&&(t(i,r),Gd(i.children,t,r+1))}function Pt(e,t){var i;const r=(i=e==null?void 0:e.data)==null?void 0:i[t];return typeof r=="string"?r:typeof r=="number"&&r>0?String(r):""}function B3(e,t){var r;return((r=e==null?void 0:e.data)==null?void 0:r[t])===!0}function I3(e,t){var i;const r=(i=e.data)==null?void 0:i[t];return Array.isArray(r)?r.map(o=>typeof o=="string"?o:typeof o=="number"&&o>0?String(o):"").filter(Boolean):typeof r=="string"?j3(r):[]}function j3(e){return e.split(";").flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}function Q0(e){const t=Number(e);return Number.isInteger(t)&&t>=100&&t<=599}function Qd(e){const t=J0(e);return t?`${t.pathname||"/"}${t.search||""}`:e||"/"}function n_(e){const t=J0(e);return t?t.origin.toLowerCase():""}function J0(e){if(!e)return null;try{return new URL(e)}catch{return null}}function Do(e){return z3((e||"").trim()).toLowerCase()}function z3(e){let t=e.length;for(;t>1&&e[t-1]==="/";)t-=1;return e.slice(0,t)}function Nr(...e){var t;return((t=e.find(r=>r&&r.trim()))==null?void 0:t.trim())||""}function Ho(e){return Array.from(new Set(e.filter(t=>!!t)))}function O3(e){const t=new Set,r=[];for(const i of e){const o=gn(i.label);!o||t.has(o)||(t.add(o),r.push(i))}return r}function gn(e){return String(e||"").trim().toLowerCase()}const fs=["critical","high","medium","low","info"];function F3(e){return e.analysisItems.some(t=>t.source==="verify"&&t.status==="confirmed")?"verified":e.analysisItems.some(t=>t.source==="sniper")?"sniper":e.analysisItems.some(t=>t.source==="deep")?"deep":null}function Jd(e){const t=[],r=new Set;for(const i of e.loots||[]){const o=`loot:${i.target}:${i.kind}:${i.description||""}`;r.has(o)||(r.add(o),t.push({id:o,kind:$3(i.kind),priority:U3(i.priority),title:i.description||i.kind||"Finding",target:i.target,description:i.description,tags:i.tags||[],source:void 0,status:void 0,detail:K3(i),raw:i}))}for(const i of e.assets||[])for(const o of i.items||[]){if(!Aa(o)||o.kind==="error")continue;const l=`item:${i.target}:${o.source}:${o.kind}:${o.title||o.summary||""}`;if(r.has(l))continue;r.add(l);const a=V3(o);t.push({id:l,kind:W3(o.kind),priority:a,title:Nr(o.summary,o.title)||o.kind,target:o.target||i.target,description:o.summary||o.title,source:o.source,status:o.status,tags:o.tags||[],detail:Z0(o),raw:o})}return t.sort((i,o)=>{const l=fs.indexOf(i.priority),a=fs.indexOf(o.priority);if(l!==a)return l-a;const c=i.source==="verify"&&i.status==="confirmed"?0:1,f=o.source==="verify"&&o.status==="confirmed"?0:1;return c-f}),t}function H3(e){var l;const t=Jd(e);if(t.length===0)return null;const r={},i={};for(const a of t)if((r[l=a.priority]||(r[l]=[])).push(a),a.source){const c=a.status||"unknown";(i[c]||(i[c]=[])).push(a)}const o=t.filter(a=>a.source==="verify"&&a.status==="confirmed").length;return{byPriority:r,byStatus:i,aiVerifiedCount:o,totalFindings:t.length,topFinding:t[0]}}function $3(e){switch(e==null?void 0:e.toLowerCase()){case"vuln":return"vuln";case"weakpass":return"weakpass";case"fingerprint":return"fingerprint";default:return"other"}}function W3(e){switch(e==null?void 0:e.toLowerCase()){case"loot":return"vuln";case"note":return"note";default:return"other"}}function U3(e){const t=(e||"").toLowerCase();return fs.includes(t)?t:"info"}function V3(e){const t=(e.status||"").toLowerCase();return t==="confirmed"||t==="critical"?"critical":t==="high"?"high":t==="medium"||t==="inconclusive"?"medium":t==="low"?"low":"info"}function Z0(e){var t,r,i,o,l,a,c;return Nr(e.detail,gi((t=e.data)==null?void 0:t.content),gi((r=e.data)==null?void 0:r.detail),gi((i=e.data)==null?void 0:i.markdown),gi((o=e.data)==null?void 0:o.narrative),gi((l=e.data)==null?void 0:l.evidence),gi((a=e.data)==null?void 0:a.response),gi((c=e.data)==null?void 0:c.output))}function gi(e){return typeof e=="string"?e:""}function K3(e){if(!e.data)return;const t=e.data.detail||e.data.evidence||e.data.markdown||e.data.narrative;return typeof t=="string"?t:void 0}const ey={critical:{label:"Critical",bg:"bg-red-500/15",text:"text-red-600 dark:text-red-400",border:"border-red-500/30"},high:{label:"High",bg:"bg-orange-500/15",text:"text-orange-600 dark:text-orange-400",border:"border-orange-500/30"},medium:{label:"Medium",bg:"bg-yellow-500/15",text:"text-yellow-600 dark:text-yellow-400",border:"border-yellow-500/30"},low:{label:"Low",bg:"bg-green-500/15",text:"text-green-600 dark:text-green-400",border:"border-green-500/30"},info:{label:"Info",bg:"bg-blue-500/15",text:"text-blue-600 dark:text-blue-400",border:"border-blue-500/30"}};function q3({result:e}){const t=te.useMemo(()=>H3(e),[e]);return t?_.jsxs("div",{className:"rounded-lg border border-border bg-card/50 p-4 space-y-4",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-cyber-700 dark:text-cyber-400",children:[_.jsx(Nw,{className:"h-4 w-4"}),_.jsx("span",{children:"AI Analysis Summary"})]}),_.jsx(Y3,{summary:t}),Object.keys(t.byStatus).length>0&&_.jsx(X3,{summary:t}),t.topFinding&&_.jsx(G3,{summary:t})]}):null}function Y3({summary:e}){return _.jsx("div",{className:"grid grid-cols-5 gap-2",children:fs.map(t=>{var o;const r=ey[t],i=((o=e.byPriority[t])==null?void 0:o.length)||0;return _.jsxs("div",{className:je("rounded-md border p-2.5 text-center",r.bg,r.border,i===0&&"opacity-40"),children:[_.jsx("div",{className:je("text-lg font-bold tabular-nums",r.text),children:i}),_.jsx("div",{className:"text-[10px] uppercase text-muted-foreground",children:r.label})]},t)})})}function X3({summary:e}){var c,f,h,g;const t=((c=e.byStatus.confirmed)==null?void 0:c.length)||0,r=((f=e.byStatus.info)==null?void 0:f.length)||0,i=((h=e.byStatus.inconclusive)==null?void 0:h.length)||0,o=((g=e.byStatus.not_confirmed)==null?void 0:g.length)||0,l=t+r+i+o;if(l===0)return null;const a=l>0?t/l*100:0;return _.jsxs("div",{className:"space-y-2",children:[_.jsxs("div",{className:"flex items-center justify-between text-xs",children:[_.jsx("span",{className:"text-muted-foreground",children:"AI Verification"}),_.jsxs("span",{className:"font-medium text-foreground",children:[t,"/",l," confirmed"]})]}),_.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:_.jsx("div",{className:"h-full rounded-full bg-green-500 transition-all",style:{width:`${a}%`}})}),_.jsxs("div",{className:"flex flex-wrap gap-3 text-[11px]",children:[t>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[_.jsx(vn,{className:"h-3 w-3"}),t," confirmed"]}),r>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-blue-600 dark:text-blue-400",children:[_.jsx(Sv,{className:"h-3 w-3"}),r," info"]}),i>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[_.jsx(pw,{className:"h-3 w-3"}),i," inconclusive"]}),o>0&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[_.jsx(mw,{className:"h-3 w-3"}),o," not confirmed"]})]})]})}function G3({summary:e}){const t=e.topFinding,r=ey[t.priority];return _.jsx("div",{className:je("rounded-md border p-3",r.border,r.bg),children:_.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx(Pa,{className:je("h-4 w-4 mt-0.5 shrink-0",r.text)}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx("span",{className:je("text-xs font-semibold uppercase",r.text),children:t.priority}),_.jsx("span",{className:"text-xs font-medium text-foreground break-words",children:t.title})]}),_.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[_.jsx("span",{className:"font-mono break-all",children:t.target}),t.source==="verify"&&t.status==="confirmed"&&_.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[_.jsx(vn,{className:"h-3 w-3"}),"AI Verified"]}),t.tags.slice(0,3).map(i=>_.jsx("span",{className:"rounded bg-background/50 px-1.5 py-0.5 text-[10px]",children:i},i))]})]})]})})}function Q3({result:e}){const t=te.useMemo(()=>m3(e),[e]);return _.jsxs("div",{className:"space-y-4 animate-fade-in",children:[_.jsx("div",{className:"rounded-lg border border-border bg-card/50 p-4",children:_.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs sm:grid-cols-3 lg:grid-cols-9",children:[_.jsx(fn,{label:"Hosts",value:t.metrics.hosts}),_.jsx(fn,{label:"Assets",value:t.metrics.assets}),_.jsx(fn,{label:"Services",value:t.metrics.services}),_.jsx(fn,{label:"Web",value:t.metrics.web}),_.jsx(fn,{label:"Probes",value:t.metrics.probes}),_.jsx(fn,{label:"Fingers",value:t.metrics.fingers}),_.jsx(fn,{label:"Loots",value:t.metrics.loots}),_.jsx(fn,{label:"Errors",value:t.metrics.errors}),_.jsx(fn,{label:"Duration",value:t.metrics.duration})]})}),_.jsx(q3,{result:e}),_.jsx(p4,{title:"Hosts",children:t.hosts.length>0?_.jsx(J3,{hosts:t.hosts}):_.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:"No hosts."})})]})}function J3({hosts:e}){return _.jsx("div",{className:"divide-y divide-border/70",children:e.map(t=>_.jsx(Z3,{host:t},t.id))})}function Z3({host:e}){const[t,r]=te.useState(!0),i=e.services.filter(l=>l.web).length,o=Ga("host",e.id);return _.jsxs("details",{id:o,className:"group scroll-mt-24 py-3 first:pt-0 last:pb-0",open:t,onToggle:l=>r(l.currentTarget.open),children:[_.jsxs("summary",{className:"flex cursor-pointer list-none items-start gap-2 [&::-webkit-details-marker]:hidden",children:[_.jsx($a,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-open:rotate-90"}),_.jsx(Sw,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}),_.jsx("div",{className:"min-w-0 flex-1",children:_.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[_.jsx("span",{className:"break-all font-mono text-sm font-semibold text-foreground",children:e.host}),_.jsx(Zd,{id:o,label:`Link to ${e.host}`}),_.jsx(Xr,{children:L3(e.services.length,"service")}),i>0&&_.jsx(Xr,{tone:"cyan",children:ty(i)})]})})]}),_.jsx("div",{className:"ml-6 mt-3 border-l border-border/70 pl-3",children:_.jsx(e4,{services:e.services})})]})}function e4({services:e}){return _.jsx("div",{className:"divide-y divide-border/60",children:e.map(t=>_.jsx(t4,{service:t},t.id))})}function t4({service:e}){const t=te.useMemo(()=>n4(e),[e]),[r,i]=te.useState(!1),[o,l]=te.useState(()=>s_(t)),a=t.find(h=>h.id===o)||t[0],c=Ga("service",e.id);te.useEffect(()=>{t.some(h=>h.id===o)||l(s_(t))},[o,t]);const f=h=>g=>{g.preventDefault(),g.stopPropagation(),l(h),i(!0)};return t.length===0?_.jsx("div",{id:c,className:"scroll-mt-24 py-3 first:pt-0 last:pb-0",children:_.jsx(i_,{service:e})}):_.jsxs("details",{id:c,className:"group/service scroll-mt-24 py-3 first:pt-0 last:pb-0",open:r,onToggle:h=>i(h.currentTarget.open),children:[_.jsxs("summary",{className:"cursor-pointer list-none [&::-webkit-details-marker]:hidden",children:[_.jsx(i_,{service:e,expandable:!0}),_.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:t.map(h=>_.jsx(f4,{active:r&&(a==null?void 0:a.id)===h.id,label:h.label,count:h.count,onClick:f(h.id)},h.id))})]}),a&&_.jsx("div",{className:"mt-3",children:a.render()})]})}function i_({service:e,expandable:t=!1}){const r=e.web?e.asset.target:e.target,i=F3(e);return _.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_auto]",children:[_.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[t?_.jsx($a,{className:"mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-open/service:rotate-90"}):_.jsx("span",{className:"h-3.5 w-3.5 shrink-0"}),_.jsx("span",{className:"w-[4.75rem] shrink-0 break-words font-mono text-sm font-semibold leading-5 text-foreground",children:e.port||"-"}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[_.jsx(r4,{service:e}),_.jsx("span",{className:"font-medium text-foreground",children:e.service||e.protocol||"service"}),_.jsx(Zd,{id:Ga("service",e.id),label:`Link to ${e.target||e.service||e.port}`}),e.protocol&&e.protocol!==e.service&&_.jsx(Xr,{children:e.protocol}),e.web&&_.jsx(Xr,{tone:"cyan",children:e.pathCount>0?ty(e.pathCount):"web"}),i==="verified"&&_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-green-400/10 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[_.jsx(vn,{className:"h-3 w-3"}),"AI Verified"]}),i==="sniper"&&_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-400/10 px-1.5 py-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[_.jsx(Wa,{className:"h-3 w-3"}),"CVE Intel"]}),i==="deep"&&_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:[_.jsx(Ua,{className:"h-3 w-3"}),"Deep Test"]}),e.title&&_.jsx("span",{className:"min-w-0 break-words text-xs text-muted-foreground",children:e.title})]}),_.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground",children:[r&&_.jsx("span",{className:"break-all font-mono",children:r}),e.summary&&_.jsx("span",{className:"break-words",children:e.summary}),e.statuses.slice(0,5).map(o=>_.jsx(Xr,{tone:X0(o),children:o},`http:${o}`)),e.states.slice(0,3).map(o=>_.jsx(Xr,{tone:Y0(o),children:o},`state:${o}`)),_.jsx(sy,{fingers:e.fingers}),e.analysisItems.length>0&&_.jsxs("span",{className:"text-cyber-700 dark:text-cyber-300",children:[e.analysisItems.length," analysis"]})]})]})]}),_.jsx(iy,{sources:e.sources,className:"justify-start sm:justify-end"})]})}function r4({service:e}){return e.web?_.jsx(vw,{className:"h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}):e.fingers.length>0?_.jsx(kd,{className:"h-3.5 w-3.5 shrink-0 text-yellow-700 dark:text-yellow-300"}):_.jsx(Cd,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})}function n4(e){const t=[];return e.paths.length>0&&t.push({id:"sitemap",label:"Sitemap",count:e.paths.length,preferred:!0,render:()=>_.jsx(d4,{items:e.paths})}),e.analysisItems.length>0&&t.push({id:"analysis",label:"Analysis",count:e.analysisItems.length,render:()=>_.jsx(i4,{asset:e.asset,items:e.analysisItems})}),t}function s_(e){var t,r;return((t=e.find(i=>i.preferred))==null?void 0:t.id)||((r=e[0])==null?void 0:r.id)||""}function ty(e){return`${e} web`}function ry({item:e,search:t,className:r}){const i=U0(e);return i.statuses.length===0&&i.states.length===0&&i.fingers.length===0&&i.sources.length===0&&!t?null:_.jsxs("div",{className:je("flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[11px]",r),children:[i.statuses.map(o=>_.jsx(Xr,{tone:X0(o),children:o},`http:${o}`)),i.states.map(o=>_.jsx(Xr,{tone:Y0(o),children:o},`state:${o}`)),_.jsx(sy,{fingers:i.fingers}),_.jsx(iy,{sources:i.sources}),t&&_.jsx("span",{className:"break-all font-mono text-muted-foreground",children:t})]})}function i4({asset:e,items:t}){return _.jsx("div",{className:"space-y-2",children:t.map((r,i)=>_.jsx(s4,{item:r,asset:e},`${r.kind}-${r.source}-${r.target}-${r.title}-${i}`))})}function s4({item:e,asset:t}){const r=Aa(e),i=r?c4(e.summary,e.title):k3(e),o=u4(e),l=Ga("item",l4(e,t)),a=e.target&&!C3(e.target,t.target),c=[{id:`kind:${e.kind}`,label:e.kind,tone:N3(e.kind)}],f=E3(e.tags,[...c.map(g=>g.label),...y3(e)]),h=e.source==="verify"||e.source==="sniper"||e.source==="deep";return _.jsxs("div",{id:l,className:je("scroll-mt-24 rounded-md border p-3 text-xs",h&&e.status==="confirmed"&&"border-l-4 border-l-green-500",h&&e.source==="sniper"&&"border-l-4 border-l-red-500",h&&e.source==="deep"&&"border-l-4 border-l-yellow-500",e.kind==="error"?"border-red-400/20 bg-red-400/10":e.kind==="loot"?"border-red-400/20 bg-red-400/5":"border-border/70 bg-background/30"),children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx(h4,{kind:e.kind}),c.map(g=>_.jsx(Xr,{tone:g.tone,children:g.label},g.id)),_.jsx(o4,{source:e.source,status:e.status}),_.jsx(Zd,{id:l,label:`Link to ${i||e.kind}`}),a&&_.jsx("span",{className:"break-all font-mono text-muted-foreground",children:e.target})]}),i&&_.jsx("div",{className:"mt-1 break-words text-foreground",children:i}),_.jsx(ry,{item:e,className:"mt-2"}),o&&_.jsxs("div",{className:je("mt-2 max-h-96 overflow-auto rounded-md p-3 text-muted-foreground",h?"border-l-4 border-l-cyber-400 bg-cyber-500/5":"border border-border bg-background/50"),children:[h&&_.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase text-cyber-700 dark:text-cyber-400",children:e.source==="verify"?"AI Verification":e.source==="sniper"?"CVE Intelligence":"Dynamic Analysis"}),r?_.jsx(Vd,{content:o,compact:!0,muted:!0}):_.jsx("div",{className:"whitespace-pre-wrap",children:o})]}),f.length>0&&_.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:f.map(g=>_.jsx(Xr,{tone:g.tone,children:g.label},g.id))})]})}function o4({source:e,status:t}){return e==="verify"?t==="confirmed"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-green-400/10 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[_.jsx(vn,{className:"h-3 w-3"}),"Confirmed"]}):t==="not_confirmed"?_.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not Confirmed"}):t==="inconclusive"?_.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:"Inconclusive"}):_.jsx("span",{className:"inline-flex items-center gap-1 rounded bg-blue-400/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 dark:text-blue-400",children:"Info"}):e==="sniper"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-400/10 px-1.5 py-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[_.jsx(Wa,{className:"h-3 w-3"}),"CVE Intel"]}):e==="deep"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:[_.jsx(Ua,{className:"h-3 w-3"}),"Deep Test"]}):null}function Zd({id:e,label:t}){return _.jsx("a",{href:`#${e}`,"aria-label":t,title:t,onClick:r=>r.stopPropagation(),className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground opacity-60 hover:bg-accent hover:text-foreground hover:opacity-100",children:_.jsx(bv,{className:"h-3 w-3"})})}function Ga(e,t){return`asset-${e}-${a4(t)}`}function l4(e,t){return[t.key,e.kind,e.source,e.target,e.status,e.title,e.summary].filter(Boolean).join("|")}function a4(e){return(e.trim().toLowerCase().replace(/<[^>]*>/g,"").replace(/&[a-z0-9#]+;/g,"").replace(/[^a-z0-9\u4e00-\u9fa5]+/g,"-").replace(/^-+|-+$/g,"")||"section").slice(0,96)}function u4(e){return Z0(e)}function c4(...e){var t;return((t=e.find(r=>r&&r.trim()))==null?void 0:t.trim())||""}function h4({kind:e}){return e==="loot"?_.jsx(_v,{className:"h-3.5 w-3.5 text-red-700 dark:text-red-300"}):e==="note"||e==="response"?_.jsx(gv,{className:"h-3.5 w-3.5 text-cyber-700 dark:text-cyber-300"}):e==="fingerprint"?_.jsx(kd,{className:"h-3.5 w-3.5 text-yellow-700 dark:text-yellow-300"}):_.jsx(Cd,{className:"h-3.5 w-3.5 text-muted-foreground"})}function d4({items:e}){const t=te.useMemo(()=>x3(e),[e]),r=te.useMemo(()=>w3(t),[t]),[i,o]=te.useState(()=>e_(t));te.useEffect(()=>{o(e_(t))},[t]);const l=a=>{o(c=>{const f=new Set(c);return f.has(a)?f.delete(a):f.add(a),f})};return _.jsxs("div",{className:"overflow-hidden rounded-md border border-border/70 bg-background/30",children:[r.length>0&&_.jsxs("div",{className:"flex items-center justify-end gap-1 border-b border-border/70 px-2 py-1",children:[_.jsx(l_,{label:"Expand all",onClick:()=>o(new Set(r)),children:_.jsx(yv,{className:"h-3.5 w-3.5"})}),_.jsx(l_,{label:"Collapse all",onClick:()=>o(new Set),children:_.jsx(xv,{className:"h-3.5 w-3.5"})})]}),_.jsx("div",{role:"tree","aria-label":"Sitemap",children:t.map(a=>_.jsx(ny,{node:a,depth:0,openIDs:i,onToggle:l},a.id))})]})}function ny({node:e,depth:t,openIDs:r,onToggle:i}){const o=e.children.length>0,l=r.has(e.id),a=`${.6+t*1.15}rem`,c=e.children.length+e.items.length;return o?_.jsxs("div",{role:"treeitem","aria-expanded":l,children:[_.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 py-1.5 pr-3 text-left text-xs hover:bg-secondary/40",style:{paddingLeft:a},onClick:()=>i(e.id),children:[_.jsx($a,{className:je("h-3 w-3 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")}),l?_.jsx(yv,{className:"h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}):_.jsx(xv,{className:"h-3.5 w-3.5 shrink-0 text-cyber-700 dark:text-cyber-300"}),_.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-foreground",children:e.name}),_.jsx("span",{className:"shrink-0 text-muted-foreground",children:c})]}),l&&_.jsxs("div",{role:"group",children:[e.items.map((f,h)=>_.jsx(o_,{item:f,depth:t+1},`${t_(f)}:${h}`)),e.children.map(f=>_.jsx(ny,{node:f,depth:t+1,openIDs:r,onToggle:i},f.id))]})]}):_.jsx(_.Fragment,{children:e.items.map((f,h)=>_.jsx(o_,{item:f,depth:t},`${t_(f)}:${h}`))})}function o_({item:e,depth:t}){const r=`${.6+t*1.15}rem`,i=S3(e),o=b3(e);return _.jsxs("div",{role:"treeitem",className:"py-1.5 pr-3 text-xs hover:bg-secondary/30",style:{paddingLeft:r},children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx(_w,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),_.jsx("span",{className:"break-all font-mono text-foreground",children:i}),e.title&&_.jsx("span",{className:"text-muted-foreground",children:e.title})]}),_.jsx(ry,{item:e,search:o,className:"mt-1 pl-5"})]})}function iy({sources:e,className:t}){if(e.length===0)return null;const r=e.slice(0,5),i=e.length-r.length;return _.jsxs("span",{className:je("inline-flex min-w-0 flex-wrap items-center gap-1 text-cyber-700 dark:text-cyber-300",t),title:"Sources",children:[_.jsx(Cd,{className:"h-3 w-3 shrink-0"}),r.map(o=>_.jsx("span",{className:"rounded bg-cyber-500/10 px-1.5 py-0.5 text-[10px]",children:o},`source:${o}`)),i>0&&_.jsxs("span",{className:"rounded bg-cyber-500/10 px-1.5 py-0.5 text-[10px]",children:["+",i]})]})}function sy({fingers:e}){if(e.length===0)return null;const t=e.slice(0,5),r=e.length-t.length;return _.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-center gap-1 text-yellow-700 dark:text-yellow-300",title:"Fingerprints",children:[_.jsx(kd,{className:"h-3 w-3 shrink-0"}),t.map(i=>_.jsx("span",{className:"rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px]",children:i},`finger:${i}`)),r>0&&_.jsxs("span",{className:"rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px]",children:["+",r]})]})}function l_({children:e,label:t,onClick:r}){return _.jsx("button",{type:"button","aria-label":t,title:t,onClick:r,className:"inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-background text-muted-foreground hover:border-cyber-400/30 hover:text-foreground",children:e})}function f4({active:e,count:t,label:r,onClick:i}){return _.jsxs("button",{type:"button",onClick:i,className:je("rounded border px-2 py-1 text-[10px] font-medium transition-colors",e?"border-cyber-400/40 bg-cyber-500/15 text-cyber-800 dark:text-cyber-200":"border-border bg-background text-muted-foreground hover:border-cyber-400/30 hover:text-foreground"),children:[r,typeof t=="number"&&t>0&&_.jsxs(_.Fragment,{children:[" ",_.jsx("span",{className:"opacity-70",children:t})]})]})}function fn({label:e,value:t}){return _.jsxs("div",{children:[_.jsx("div",{className:"text-[10px] uppercase text-muted-foreground",children:e}),_.jsx("div",{className:"mt-1 font-mono text-sm text-foreground",children:t})]})}function p4({title:e,children:t}){return _.jsxs("div",{className:"rounded-lg border border-border bg-card/50",children:[_.jsx("div",{className:"border-b border-border px-4 py-2 text-sm font-medium text-cyber-700 dark:text-cyber-400",children:e}),_.jsx("div",{className:"p-4",children:t})]})}function Xr({children:e,tone:t="muted"}){return _.jsx("span",{className:je("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium",t==="cyan"&&"bg-cyber-500/10 text-cyber-700 dark:text-cyber-300",t==="yellow"&&"bg-yellow-400/10 text-yellow-700 dark:text-yellow-300",t==="green"&&"bg-green-400/10 text-green-700 dark:text-green-300",t==="red"&&"bg-red-400/10 text-red-700 dark:text-red-300",t==="muted"&&"bg-background text-muted-foreground"),children:e})}const a_={critical:{bg:"bg-red-500/15",text:"text-red-600 dark:text-red-400",border:"border-red-500/30",dot:"bg-red-500"},high:{bg:"bg-orange-500/15",text:"text-orange-600 dark:text-orange-400",border:"border-orange-500/30",dot:"bg-orange-500"},medium:{bg:"bg-yellow-500/15",text:"text-yellow-600 dark:text-yellow-400",border:"border-yellow-500/30",dot:"bg-yellow-500"},low:{bg:"bg-green-500/15",text:"text-green-600 dark:text-green-400",border:"border-green-500/30",dot:"bg-green-500"},info:{bg:"bg-blue-500/15",text:"text-blue-600 dark:text-blue-400",border:"border-blue-500/30",dot:"bg-blue-500"}};function m4({result:e}){const t=te.useMemo(()=>Jd(e),[e]),[r,i]=te.useState("all"),o=te.useMemo(()=>r==="all"?t:r==="ai_verified"?t.filter(c=>c.source==="verify"&&c.status==="confirmed"):t.filter(c=>c.priority===r),[t,r]),l=te.useMemo(()=>{var f;const c={};for(const h of o)(c[f=h.priority]||(c[f]=[])).push(h);return c},[o]);if(t.length===0)return _.jsxs("div",{className:"py-12 text-center text-sm text-muted-foreground",children:[_.jsx(ki,{className:"mx-auto mb-3 h-8 w-8 opacity-40"}),_.jsx("p",{children:"No findings yet."})]});const a=t.filter(c=>c.source==="verify"&&c.status==="confirmed").length;return _.jsxs("div",{className:"space-y-4 animate-fade-in",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[_.jsxs(ch,{active:r==="all",onClick:()=>i("all"),children:["All (",t.length,")"]}),fs.map(c=>{const f=t.filter(h=>h.priority===c).length;return f===0?null:_.jsxs(ch,{active:r===c,onClick:()=>i(c),children:[_.jsx("span",{className:je("inline-block h-2 w-2 rounded-full",a_[c].dot)}),c.charAt(0).toUpperCase()+c.slice(1)," (",f,")"]},c)}),a>0&&_.jsxs(ch,{active:r==="ai_verified",onClick:()=>i("ai_verified"),children:[_.jsx(vn,{className:"h-3 w-3 text-green-600 dark:text-green-400"}),"AI Verified (",a,")"]})]}),fs.map(c=>{const f=l[c];if(!f||f.length===0)return null;const h=a_[c];return _.jsxs("div",{className:je("rounded-lg border",h.border),children:[_.jsxs("div",{className:je("flex items-center gap-2 border-b px-4 py-2 text-xs font-semibold uppercase",h.border,h.bg,h.text),children:[_.jsx("span",{className:je("h-2.5 w-2.5 rounded-full",h.dot)}),c," (",f.length,")"]}),_.jsx("div",{className:"divide-y divide-border/50",children:f.map(g=>_.jsx(g4,{item:g},g.id))})]},c)})]})}function g4({item:e}){const[t,r]=te.useState(!1);return _.jsxs("div",{className:"p-3 text-xs",children:[_.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx(_4,{kind:e.kind}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_.jsx("span",{className:"font-medium text-foreground break-words",children:e.title}),_.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e.kind}),_.jsx(v4,{source:e.source,status:e.status})]}),_.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[_.jsx("span",{className:"break-all font-mono",children:e.target}),e.tags.slice(0,5).map(i=>_.jsx("span",{className:"rounded bg-secondary/80 px-1.5 py-0.5 text-[10px]",children:i},i)),e.tags.length>5&&_.jsxs("span",{className:"text-[10px]",children:["+",e.tags.length-5]})]})]})]}),e.detail&&_.jsx("div",{className:"mt-2",children:t?_.jsxs("div",{className:"mt-1 rounded-md border-l-4 border-l-cyber-400 bg-cyber-500/5 p-3",children:[_.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[_.jsx("span",{className:"text-[10px] font-medium uppercase text-cyber-700 dark:text-cyber-400",children:e.source==="verify"?"AI Verification":e.source==="sniper"?"CVE Intelligence":"Analysis"}),_.jsx("button",{type:"button",className:"text-[10px] text-muted-foreground hover:text-foreground",onClick:()=>r(!1),children:"Hide"})]}),_.jsx("div",{className:"max-h-72 overflow-auto text-muted-foreground",children:_.jsx(Vd,{content:e.detail,compact:!0,muted:!0})})]}):_.jsx("button",{type:"button",className:"text-[11px] text-cyber-700 dark:text-cyber-400 hover:underline",onClick:()=>r(!0),children:"Show AI Analysis"})})]})}function _4({kind:e}){switch(e){case"vuln":return _.jsx(_v,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400"});case"weakpass":return _.jsx(yw,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-600 dark:text-orange-400"});case"fingerprint":return _.jsx(ki,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-yellow-600 dark:text-yellow-400"});default:return _.jsx(ki,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"})}}function v4({source:e,status:t}){return e==="verify"&&t==="confirmed"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-green-400/10 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[_.jsx(vn,{className:"h-3 w-3"}),"AI Verified"]}):e==="verify"&&t==="not_confirmed"?_.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not Confirmed"}):e==="verify"&&t==="inconclusive"?_.jsx("span",{className:"rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:"Inconclusive"}):e==="sniper"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-red-400/10 px-1.5 py-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[_.jsx(Wa,{className:"h-3 w-3"}),"CVE Intel"]}):e==="deep"?_.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-yellow-400/10 px-1.5 py-0.5 text-[10px] font-medium text-yellow-700 dark:text-yellow-400",children:[_.jsx(Ua,{className:"h-3 w-3"}),"Deep Test"]}):null}function ch({active:e,onClick:t,children:r}){return _.jsx("button",{type:"button",onClick:t,className:je("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors",e?"border-cyber-400/40 bg-cyber-500/15 text-cyber-800 dark:text-cyber-200":"border-border bg-background text-muted-foreground hover:border-cyber-400/30 hover:text-foreground"),children:r})}function y4({scan:e,lines:t,report:r,result:i,logCollapsed:o,onToggleLog:l}){const a=!!r,c=!!i,f=c||a,h=e.status==="running",g=!!e.verify||!!e.ai&&!e.sniper,m=!!e.sniper||!!e.ai&&!e.verify,x=g||m||!!e.deep,y=te.useMemo(()=>i?Jd(i).length:0,[i]),S=y>0,[k,E]=te.useState("assets");return te.useEffect(()=>{!c&&f?E("report"):c&&S&&x?E("findings"):c&&E("assets")},[f,c,S,x,e.id]),_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[_.jsx("span",{className:"font-mono text-sm text-foreground",children:e.target}),_.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-secondary",children:e.mode}),g&&_.jsx("span",{className:"text-xs text-cyber-700 dark:text-cyber-300 px-2 py-0.5 rounded bg-cyber-500/10",children:"Verify"}),m&&_.jsx("span",{className:"text-xs text-red-700 dark:text-red-300 px-2 py-0.5 rounded bg-red-400/10",children:"Sniper"}),e.deep&&_.jsx("span",{className:"text-xs text-yellow-700 dark:text-yellow-300 px-2 py-0.5 rounded bg-yellow-400/10",children:"Deep"}),_.jsx(x4,{status:e.status})]}),(t.length>0||h)&&_.jsx(bS,{lines:t,status:e.status,collapsed:o,onToggleCollapse:l}),f&&_.jsxs("div",{className:"space-y-3",children:[c&&f&&_.jsxs("div",{className:"inline-flex items-center rounded-md border border-input bg-secondary/50 p-0.5",children:[_.jsxs(hh,{active:k==="assets",onClick:()=>E("assets"),children:[_.jsx(Rw,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:"Assets"})]}),S&&_.jsxs(hh,{active:k==="findings",onClick:()=>E("findings"),children:[_.jsx(ki,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:"Findings"}),_.jsx("span",{className:"ml-1 rounded-full bg-red-500/20 px-1.5 py-0.5 text-[10px] font-bold text-red-600 dark:text-red-400",children:y})]}),_.jsxs(hh,{active:k==="report",onClick:()=>E("report"),children:[_.jsx(gw,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:"Report"})]})]}),c&&k==="assets"&&_.jsx(Q3,{result:i}),c&&k==="findings"&&_.jsx(m4,{result:i}),f&&k==="report"&&_.jsx("div",{className:"animate-fade-in",children:_.jsx(p3,{scan:e,report:r,result:i})})]})]})}function hh({active:e,children:t,onClick:r}){return _.jsx("button",{type:"button",onClick:r,className:je("inline-flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-xs font-medium transition-all",e?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t})}function x4({status:e}){const t={queued:{label:"Queued",className:"text-gray-600 bg-gray-400/10 dark:text-gray-400"},running:{label:"Running",className:"text-blue-700 bg-blue-400/10 dark:text-blue-400 animate-pulse"},completed:{label:"Completed",className:"text-cyber-700 bg-cyber-400/10 dark:text-cyber-400"},failed:{label:"Failed",className:"text-red-700 bg-red-400/10 dark:text-red-400"},canceled:{label:"Canceled",className:"text-yellow-700 bg-yellow-400/10 dark:text-yellow-400"}},{label:r,className:i}=t[e]||t.queued;return _.jsx("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${i}`,children:r})}async function w4(){return Pi("/api/status","Failed to load status")}async function S4(){return Pi("/api/agents","Failed to list agents")}async function b4(){return Pi("/api/config/llm","Failed to load LLM config")}async function k4(e){return Pi("/api/config/llm","Failed to save LLM config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function C4(e,t,r){return Pi("/api/scans","Failed to submit scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:e,mode:t,...r})})}async function Oh(e){return Pi(`/api/scans/${encodeURIComponent(e)}`,"Scan not found")}async function E4(){return Pi("/api/scans","Failed to list scans")}function N4(e,t){const r=new EventSource(`/api/scans/${encodeURIComponent(e)}/events`),i=o=>l=>{const a="data"in l?l.data:void 0;if(typeof a!="string"||a===""){o==="error"&&Oh(e).then(f=>{f.status==="completed"?(t({type:"complete",scan_id:e,status:f.status}),r.close()):(f.status==="failed"||f.status==="canceled")&&(t({type:"error",scan_id:e,error:f.error||`Scan ${f.status}`}),r.close())}).catch(()=>{});return}let c;try{const f=JSON.parse(a),h=o==="output"?"progress":o,g=(f==null?void 0:f.type)==="output"?"progress":(f==null?void 0:f.type)||h;c={scan_id:e,...f,type:g}}catch{c={type:o==="output"?"progress":o,scan_id:e,data:a}}t(c),(c.type==="complete"||c.type==="error")&&r.close()};return r.addEventListener("progress",i("progress")),r.addEventListener("status",i("status")),r.addEventListener("complete",i("complete")),r.addEventListener("error",i("error")),r.addEventListener("output",i("output")),()=>r.close()}function L4(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/agents/${encodeURIComponent(e)}/terminal/ws`}async function Pi(e,t,r){const i=await fetch(e,r);if(!i.ok)throw new Error(await P4(i,t));return i.json()}async function P4(e,t){try{const r=await e.json();return(r==null?void 0:r.error)||t}catch{return t}}const R4={config_loaded:!1,provider:"",base_url:"",api_key:"",api_key_configured:!1,model:"",proxy:"",headers:{}};let u_=0;function oy(e="",t=""){return u_+=1,{id:`header-${u_}`,key:e,value:t}}function c_(e){return Object.entries(e||{}).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>oy(t,r))}function M4(e){const t={};for(const r of e){const i=r.key.trim(),o=r.value.trim();!i||!o||(t[i]=o)}return t}function T4({open:e,status:t,onClose:r,onSaved:i}){const[o,l]=te.useState(R4),[a,c]=te.useState([]),[f,h]=te.useState(!1),[g,m]=te.useState(!1),[x,y]=te.useState(""),[S,k]=te.useState(!1);if(te.useEffect(()=>{e&&(h(!0),y(""),k(!1),b4().then(U=>{l({...U,api_key:"",headers:U.headers||{}}),c(c_(U.headers))}).catch(U=>y(U.message||"Failed to load LLM config")).finally(()=>h(!1)))},[e]),!e)return null;const E=(U,T)=>{l(se=>({...se,[U]:T}))},L=(U,T,se)=>{c(he=>he.map(fe=>fe.id===U?{...fe,[T]:se}:fe))},W=()=>{c(U=>[...U,oy()])},z=U=>{c(T=>T.filter(se=>se.id!==U))},Y=async U=>{U.preventDefault(),m(!0),y(""),k(!1);try{const T=await k4({...o,headers:M4(a)});l({...T,api_key:"",headers:T.headers||{}}),c(c_(T.headers)),k(!0),i()}catch(T){y(T.message||"Failed to save LLM config")}finally{m(!1)}};return _.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-background/80 px-4 py-8 backdrop-blur-sm",children:_.jsxs("form",{onSubmit:Y,className:"w-full max-w-2xl rounded-lg border border-border bg-card shadow-xl",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Nv,{className:"h-4 w-4 text-cyber-400"}),_.jsxs("div",{children:[_.jsx("div",{className:"text-sm font-medium text-foreground",children:"LLM Config"}),_.jsx("div",{className:"text-xs text-muted-foreground",children:o.config_path||(t==null?void 0:t.config_path)||"config.yaml"})]})]}),_.jsx("button",{type:"button",onClick:r,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:_.jsx(jo,{className:"h-4 w-4"})})]}),_.jsxs("div",{className:"space-y-4 p-4",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[_.jsx(dh,{active:!!(t!=null&&t.llm_available),label:t!=null&&t.llm_available?"LLM Ready":"LLM Offline"}),_.jsx(dh,{active:!!o.config_loaded,label:o.config_loaded?"Config Loaded":"Config Missing"}),_.jsx(dh,{active:!!o.api_key_configured,label:o.api_key_configured?"API Key Set":"API Key Empty"})]}),f?_.jsxs("div",{className:"flex h-48 items-center justify-center text-muted-foreground",children:[_.jsx(Na,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading"]}):_.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[_.jsx(fo,{label:"Provider",children:_.jsxs("select",{value:o.provider,onChange:U=>E("provider",U.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[_.jsx("option",{value:"",children:"Select provider"}),_.jsx("option",{value:"deepseek",children:"deepseek"}),_.jsx("option",{value:"openai",children:"openai"}),_.jsx("option",{value:"openrouter",children:"openrouter"}),_.jsx("option",{value:"ollama",children:"ollama"}),_.jsx("option",{value:"groq",children:"groq"}),_.jsx("option",{value:"moonshot",children:"moonshot"}),_.jsx("option",{value:"anthropic",children:"anthropic"})]})}),_.jsx(fo,{label:"Model",children:_.jsx(mn,{value:o.model,onChange:U=>E("model",U.target.value),placeholder:"deepseek-v4-pro / gpt-4.1 / qwen2.5"})}),_.jsx(fo,{label:"Base URL",children:_.jsx(mn,{value:o.base_url,onChange:U=>E("base_url",U.target.value),placeholder:"leave empty for provider default"})}),_.jsx(fo,{label:"Proxy",children:_.jsx(mn,{value:o.proxy,onChange:U=>E("proxy",U.target.value),placeholder:"http://127.0.0.1:7890"})}),_.jsx("div",{className:"sm:col-span-2",children:_.jsx(fo,{label:"API Key",children:_.jsx(mn,{type:"password",value:o.api_key||"",onChange:U=>E("api_key",U.target.value),placeholder:o.api_key_configured?"configured; leave blank to keep current key":"required unless provider is ollama"})})}),_.jsx("div",{className:"sm:col-span-2",children:_.jsxs("div",{className:"space-y-2",children:[_.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Custom Headers"}),_.jsxs(Yr,{type:"button",variant:"outline",size:"sm",onClick:W,children:[_.jsx(kv,{className:"h-3.5 w-3.5"}),"Add"]})]}),a.length>0&&_.jsx("div",{className:"space-y-2",children:a.map(U=>_.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_2.25rem]",children:[_.jsx(mn,{value:U.key,onChange:T=>L(U.id,"key",T.target.value),placeholder:"User-Agent"}),_.jsx(mn,{value:U.value,onChange:T=>L(U.id,"value",T.target.value),placeholder:"Version: 5.10.0 openwarp"}),_.jsx(Yr,{type:"button",variant:"outline",size:"icon",onClick:()=>z(U.id),"aria-label":"Remove header",children:_.jsx(Mw,{className:"h-4 w-4"})})]},U.id))})]})})]}),x&&_.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}),S&&_.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-cyber-400/30 bg-cyber-400/10 px-3 py-2 text-sm text-cyber-700 dark:text-cyber-300",children:[_.jsx(fw,{className:"h-4 w-4"}),"Saved and runtime reloaded"]})]}),_.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-4 py-3",children:[_.jsx(Yr,{type:"button",variant:"outline",onClick:r,children:"Close"}),_.jsxs(Yr,{type:"submit",disabled:f||g,className:"bg-cyber-600 text-white hover:bg-cyber-500",children:[g&&_.jsx(Na,{className:"h-4 w-4 animate-spin"}),"Save"]})]})]})})}function fo({label:e,children:t}){return _.jsxs("label",{className:"block space-y-1.5",children:[_.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e}),t]})}function dh({active:e,label:t}){return _.jsx("span",{className:`rounded-full border px-2.5 py-1 ${e?"border-cyber-400/30 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300":"border-yellow-400/30 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"}`,children:t})}/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -314,7 +319,7 @@ Error generating stack: `+v.message+` * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var L4=2,P4=1,R4=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),o=Math.max(0,parseInt(r.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),a={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},c=a.top+a.bottom,f=a.right+a.left,h=i-c,g=o-f-t;return{cols:Math.max(L4,Math.floor(g/e.css.cell.width)),rows:Math.max(P4,Math.floor(h/e.css.cell.height))}}};/** + */var D4=2,A4=1,B4=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),o=Math.max(0,parseInt(r.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),a={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},c=a.top+a.bottom,f=a.right+a.left,h=i-c,g=o-f-t;return{cols:Math.max(D4,Math.floor(g/e.css.cell.width)),rows:Math.max(A4,Math.floor(h/e.css.cell.height))}}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -325,25 +330,25 @@ Error generating stack: `+v.message+` * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var ny=Object.defineProperty,M4=Object.getOwnPropertyDescriptor,D4=(e,t)=>{for(var r in t)ny(e,r,{get:t[r],enumerable:!0})},ut=(e,t,r,i)=>{for(var o=i>1?void 0:i?M4(t,r):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(o=(i?a(t,r,o):a(o))||o);return i&&o&&ny(t,r,o),o},ue=(e,t)=>(r,i)=>t(r,i,e),u_="Terminal input",Fh={get:()=>u_,set:e=>u_=e},c_="Too much output to announce, navigate to rows manually to read",Hh={get:()=>c_,set:e=>c_=e};function T4(e){return e.replace(/\r?\n/g,"\r")}function A4(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function B4(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function I4(e,t,r,i){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");iy(o,t,r,i)}}function iy(e,t,r,i){e=T4(e),e=A4(e,r.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function sy(e,t,r){let i=r.getBoundingClientRect(),o=e.clientX-i.left-10,l=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function h_(e,t,r,i,o){sy(e,t,r),o&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function Yn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Qa(e,t=0,r=e.length){let i="";for(let o=t;o65535?(l-=65536,i+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):i+=String.fromCharCode(l)}return i}var j4=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let i=0,o=0;if(this._interim){let l=e.charCodeAt(o++);56320<=l&&l<=57343?t[i++]=(this._interim-55296)*1024+l-56320+65536:(t[i++]=this._interim,t[i++]=l),this._interim=0}for(let l=o;l=r)return this._interim=a,i;let c=e.charCodeAt(l);56320<=c&&c<=57343?t[i++]=(a-55296)*1024+c-56320+65536:(t[i++]=a,t[i++]=c);continue}a!==65279&&(t[i++]=a)}return i}},z4=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let i=0,o,l,a,c,f=0,h=0;if(this.interim[0]){let x=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,k;for(;(k=this.interim[++S]&63)&&S<4;)y<<=6,y|=k;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,L=E-S;for(;h=r)return 0;if(k=e[h++],(k&192)!==128){h--,x=!0;break}else this.interim[S++]=k,y<<=6,y|=k&63}x||(E===2?y<128?h--:t[i++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[i++]=y):y<65536||y>1114111||(t[i++]=y)),this.interim.fill(0)}let g=r-4,m=h;for(;m=r)return this.interim[0]=o,i;if(l=e[m++],(l&192)!==128){m--;continue}if(f=(o&31)<<6|l&63,f<128){m--;continue}t[i++]=f}else if((o&240)===224){if(m>=r)return this.interim[0]=o,i;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=r)return this.interim[0]=o,this.interim[1]=l,i;if(a=e[m++],(a&192)!==128){m--;continue}if(f=(o&15)<<12|(l&63)<<6|a&63,f<2048||f>=55296&&f<=57343||f===65279)continue;t[i++]=f}else if((o&248)===240){if(m>=r)return this.interim[0]=o,i;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=r)return this.interim[0]=o,this.interim[1]=l,i;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=r)return this.interim[0]=o,this.interim[1]=l,this.interim[2]=a,i;if(c=e[m++],(c&192)!==128){m--;continue}if(f=(o&7)<<18|(l&63)<<12|(a&63)<<6|c&63,f<65536||f>1114111)continue;t[i++]=f}}return i}},oy="",Xn=" ",$o=class ly{constructor(){this.fg=0,this.bg=0,this.extended=new Ba}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new ly;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ba=class ay{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new ay(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Lr=class uy extends $o{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ba,this.combinedData=""}static fromCharData(t){let r=new uy;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Yn(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(i-55296)*1024+o-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},d_="di$target",$h="di$dependencies",fh=new Map;function O4(e){return e[$h]||[]}function Rt(e){if(fh.has(e))return fh.get(e);let t=function(r,i,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");F4(t,r,o)};return t._id=e,fh.set(e,t),t}function F4(e,t,r){t[d_]===t?t[$h].push({id:e,index:r}):(t[$h]=[{id:e,index:r}],t[d_]=t)}var Xt=Rt("BufferService"),cy=Rt("CoreMouseService"),Ri=Rt("CoreService"),H4=Rt("CharsetService"),ef=Rt("InstantiationService"),hy=Rt("LogService"),Gt=Rt("OptionsService"),dy=Rt("OscLinkService"),$4=Rt("UnicodeService"),Wo=Rt("DecorationService"),Wh=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var g;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let i=[],o=this._optionsService.rawOptions.linkHandler,l=new Lr,a=r.getTrimmedLength(),c=-1,f=-1,h=!1;for(let m=0;mo?o.activate(k,E,y):W4(k,E),hover:(k,E)=>{var L;return(L=o==null?void 0:o.hover)==null?void 0:L.call(o,k,E,y)},leave:(k,E)=>{var L;return(L=o==null?void 0:o.leave)==null?void 0:L.call(o,k,E,y)}})}h=!1,l.hasExtendedAttrs()&&l.extended.urlId?(f=m,c=l.extended.urlId):(f=-1,c=-1)}}t(i)}};Wh=ut([ue(0,Xt),ue(1,Gt),ue(2,dy)],Wh);function W4(e,t){if(confirm(`Do you want to navigate to ${t}? + */var ly=Object.defineProperty,I4=Object.getOwnPropertyDescriptor,j4=(e,t)=>{for(var r in t)ly(e,r,{get:t[r],enumerable:!0})},ut=(e,t,r,i)=>{for(var o=i>1?void 0:i?I4(t,r):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(o=(i?a(t,r,o):a(o))||o);return i&&o&&ly(t,r,o),o},ue=(e,t)=>(r,i)=>t(r,i,e),h_="Terminal input",Fh={get:()=>h_,set:e=>h_=e},d_="Too much output to announce, navigate to rows manually to read",Hh={get:()=>d_,set:e=>d_=e};function z4(e){return e.replace(/\r?\n/g,"\r")}function O4(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function F4(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function H4(e,t,r,i){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");ay(o,t,r,i)}}function ay(e,t,r,i){e=z4(e),e=O4(e,r.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function uy(e,t,r){let i=r.getBoundingClientRect(),o=e.clientX-i.left-10,l=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function f_(e,t,r,i,o){uy(e,t,r),o&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function Gn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Qa(e,t=0,r=e.length){let i="";for(let o=t;o65535?(l-=65536,i+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):i+=String.fromCharCode(l)}return i}var $4=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let i=0,o=0;if(this._interim){let l=e.charCodeAt(o++);56320<=l&&l<=57343?t[i++]=(this._interim-55296)*1024+l-56320+65536:(t[i++]=this._interim,t[i++]=l),this._interim=0}for(let l=o;l=r)return this._interim=a,i;let c=e.charCodeAt(l);56320<=c&&c<=57343?t[i++]=(a-55296)*1024+c-56320+65536:(t[i++]=a,t[i++]=c);continue}a!==65279&&(t[i++]=a)}return i}},W4=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let i=0,o,l,a,c,f=0,h=0;if(this.interim[0]){let x=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let S=0,k;for(;(k=this.interim[++S]&63)&&S<4;)y<<=6,y|=k;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,L=E-S;for(;h=r)return 0;if(k=e[h++],(k&192)!==128){h--,x=!0;break}else this.interim[S++]=k,y<<=6,y|=k&63}x||(E===2?y<128?h--:t[i++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[i++]=y):y<65536||y>1114111||(t[i++]=y)),this.interim.fill(0)}let g=r-4,m=h;for(;m=r)return this.interim[0]=o,i;if(l=e[m++],(l&192)!==128){m--;continue}if(f=(o&31)<<6|l&63,f<128){m--;continue}t[i++]=f}else if((o&240)===224){if(m>=r)return this.interim[0]=o,i;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=r)return this.interim[0]=o,this.interim[1]=l,i;if(a=e[m++],(a&192)!==128){m--;continue}if(f=(o&15)<<12|(l&63)<<6|a&63,f<2048||f>=55296&&f<=57343||f===65279)continue;t[i++]=f}else if((o&248)===240){if(m>=r)return this.interim[0]=o,i;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=r)return this.interim[0]=o,this.interim[1]=l,i;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=r)return this.interim[0]=o,this.interim[1]=l,this.interim[2]=a,i;if(c=e[m++],(c&192)!==128){m--;continue}if(f=(o&7)<<18|(l&63)<<12|(a&63)<<6|c&63,f<65536||f>1114111)continue;t[i++]=f}}return i}},cy="",Qn=" ",$o=class hy{constructor(){this.fg=0,this.bg=0,this.extended=new Ba}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new hy;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ba=class dy{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new dy(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Lr=class fy extends $o{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ba,this.combinedData=""}static fromCharData(t){let r=new fy;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Gn(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(i-55296)*1024+o-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},p_="di$target",$h="di$dependencies",fh=new Map;function U4(e){return e[$h]||[]}function Rt(e){if(fh.has(e))return fh.get(e);let t=function(r,i,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");V4(t,r,o)};return t._id=e,fh.set(e,t),t}function V4(e,t,r){t[p_]===t?t[$h].push({id:e,index:r}):(t[$h]=[{id:e,index:r}],t[p_]=t)}var Xt=Rt("BufferService"),py=Rt("CoreMouseService"),Ri=Rt("CoreService"),K4=Rt("CharsetService"),ef=Rt("InstantiationService"),my=Rt("LogService"),Gt=Rt("OptionsService"),gy=Rt("OscLinkService"),q4=Rt("UnicodeService"),Wo=Rt("DecorationService"),Wh=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var g;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let i=[],o=this._optionsService.rawOptions.linkHandler,l=new Lr,a=r.getTrimmedLength(),c=-1,f=-1,h=!1;for(let m=0;mo?o.activate(k,E,y):Y4(k,E),hover:(k,E)=>{var L;return(L=o==null?void 0:o.hover)==null?void 0:L.call(o,k,E,y)},leave:(k,E)=>{var L;return(L=o==null?void 0:o.leave)==null?void 0:L.call(o,k,E,y)}})}h=!1,l.hasExtendedAttrs()&&l.extended.urlId?(f=m,c=l.extended.urlId):(f=-1,c=-1)}}t(i)}};Wh=ut([ue(0,Xt),ue(1,Gt),ue(2,gy)],Wh);function Y4(e,t){if(confirm(`Do you want to navigate to ${t}? -WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ja=Rt("CharSizeService"),vn=Rt("CoreBrowserService"),tf=Rt("MouseService"),yn=Rt("RenderService"),U4=Rt("SelectionService"),fy=Rt("CharacterJoinerService"),vs=Rt("ThemeService"),py=Rt("LinkProviderService"),V4=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?f_.isErrorNoTelemetry(e)?new f_(e.message+` +WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ja=Rt("CharSizeService"),xn=Rt("CoreBrowserService"),tf=Rt("MouseService"),wn=Rt("RenderService"),X4=Rt("SelectionService"),_y=Rt("CharacterJoinerService"),vs=Rt("ThemeService"),vy=Rt("LinkProviderService"),G4=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?m_.isErrorNoTelemetry(e)?new m_(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},K4=new V4;function wa(e){q4(e)||K4.onUnexpectedError(e)}var Uh="Canceled";function q4(e){return e instanceof Y4?!0:e instanceof Error&&e.name===Uh&&e.message===Uh}var Y4=class extends Error{constructor(){super(Uh),this.name=this.message}};function X4(e){return new Error(`Illegal argument: ${e}`)}var f_=class Vh extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Vh)return t;let r=new Vh;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Kh=class my extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,my.prototype)}};function dr(e,t=0){return e[e.length-(1+t)]}var G4;(e=>{function t(l){return l<0}e.isLessThan=t;function r(l){return l<=0}e.isLessThanOrEqual=r;function i(l){return l>0}e.isGreaterThan=i;function o(l){return l===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(G4||(G4={}));function Q4(e,t){let r=this,i=!1,o;return function(){return i||(i=!0,t||(o=e.apply(r,arguments))),o}}var gy;(e=>{function t(q){return q&&typeof q=="object"&&typeof q[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function i(){return r}e.empty=i;function*o(q){yield q}e.single=o;function l(q){return t(q)?q:o(q)}e.wrap=l;function a(q){return q||r}e.from=a;function*c(q){for(let Q=q.length-1;Q>=0;Q--)yield q[Q]}e.reverse=c;function f(q){return!q||q[Symbol.iterator]().next().done===!0}e.isEmpty=f;function h(q){return q[Symbol.iterator]().next().value}e.first=h;function g(q,Q){let A=0;for(let le of q)if(Q(le,A++))return!0;return!1}e.some=g;function m(q,Q){for(let A of q)if(Q(A))return A}e.find=m;function*x(q,Q){for(let A of q)Q(A)&&(yield A)}e.filter=x;function*y(q,Q){let A=0;for(let le of q)yield Q(le,A++)}e.map=y;function*S(q,Q){let A=0;for(let le of q)yield*Q(le,A++)}e.flatMap=S;function*k(...q){for(let Q of q)yield*Q}e.concat=k;function E(q,Q,A){let le=A;for(let he of q)le=Q(le,he);return le}e.reduce=E;function*L(q,Q,A=q.length){for(Q<0&&(Q+=q.length),A<0?A+=q.length:A>q.length&&(A=q.length);Q1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function J4(...e){return tt(()=>Ei(e))}function tt(e){return{dispose:Q4(()=>{e()})}}var _y=class vy{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ei(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?vy.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};_y.DISABLE_DISPOSED_WARNING=!1;var Qn=_y,De=class{constructor(){this._store=new Qn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};De.None=Object.freeze({dispose(){}});var ps=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},mn=typeof window=="object"?window:globalThis,qh=class Yh{constructor(t){this.element=t,this.next=Yh.Undefined,this.prev=Yh.Undefined}};qh.Undefined=new qh(void 0);var it=qh,p_=class{constructor(){this._first=it.Undefined,this._last=it.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===it.Undefined}clear(){let e=this._first;for(;e!==it.Undefined;){let t=e.next;e.prev=it.Undefined,e.next=it.Undefined,e=t}this._first=it.Undefined,this._last=it.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new it(e);if(this._first===it.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==it.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==it.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==it.Undefined&&e.next!==it.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===it.Undefined&&e.next===it.Undefined?(this._first=it.Undefined,this._last=it.Undefined):e.next===it.Undefined?(this._last=this._last.prev,this._last.next=it.Undefined):e.prev===it.Undefined&&(this._first=this._first.next,this._first.prev=it.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==it.Undefined;)yield e.element,e=e.next}},Z4=globalThis.performance&&typeof globalThis.performance.now=="function",eN=class yy{static create(t){return new yy(t)}constructor(t){this._now=Z4&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},It;(e=>{e.None=()=>De.None;function t(T,D){return m(T,()=>{},0,void 0,!0,void 0,D)}e.defer=t;function r(T){return(D,H=null,j)=>{let G=!1,re;return re=T(I=>{if(!G)return re?re.dispose():G=!0,D.call(H,I)},null,j),G&&re.dispose(),re}}e.once=r;function i(T,D,H){return h((j,G=null,re)=>T(I=>j.call(G,D(I)),null,re),H)}e.map=i;function o(T,D,H){return h((j,G=null,re)=>T(I=>{D(I),j.call(G,I)},null,re),H)}e.forEach=o;function l(T,D,H){return h((j,G=null,re)=>T(I=>D(I)&&j.call(G,I),null,re),H)}e.filter=l;function a(T){return T}e.signal=a;function c(...T){return(D,H=null,j)=>{let G=J4(...T.map(re=>re(I=>D.call(H,I))));return g(G,j)}}e.any=c;function f(T,D,H,j){let G=H;return i(T,re=>(G=D(G,re),G),j)}e.reduce=f;function h(T,D){let H,j={onWillAddFirstListener(){H=T(G.fire,G)},onDidRemoveLastListener(){H==null||H.dispose()}},G=new se(j);return D==null||D.add(G),G.event}function g(T,D){return D instanceof Array?D.push(T):D&&D.add(T),T}function m(T,D,H=100,j=!1,G=!1,re,I){let K,b,P,U=0,C,ae={leakWarningThreshold:re,onWillAddFirstListener(){K=T(fe=>{U++,b=D(b,fe),j&&!P&&(ve.fire(b),b=void 0),C=()=>{let Le=b;b=void 0,P=void 0,(!j||U>1)&&ve.fire(Le),U=0},typeof H=="number"?(clearTimeout(P),P=setTimeout(C,H)):P===void 0&&(P=0,queueMicrotask(C))})},onWillRemoveListener(){G&&U>0&&(C==null||C())},onDidRemoveLastListener(){C=void 0,K.dispose()}},ve=new se(ae);return I==null||I.add(ve),ve.event}e.debounce=m;function x(T,D=0,H){return e.debounce(T,(j,G)=>j?(j.push(G),j):[G],D,void 0,!0,void 0,H)}e.accumulate=x;function y(T,D=(j,G)=>j===G,H){let j=!0,G;return l(T,re=>{let I=j||!D(re,G);return j=!1,G=re,I},H)}e.latch=y;function S(T,D,H){return[e.filter(T,D,H),e.filter(T,j=>!D(j),H)]}e.split=S;function k(T,D=!1,H=[],j){let G=H.slice(),re=T(b=>{G?G.push(b):K.fire(b)});j&&j.add(re);let I=()=>{G==null||G.forEach(b=>K.fire(b)),G=null},K=new se({onWillAddFirstListener(){re||(re=T(b=>K.fire(b)),j&&j.add(re))},onDidAddFirstListener(){G&&(D?setTimeout(I):I())},onDidRemoveLastListener(){re&&re.dispose(),re=null}});return j&&j.add(K),K.event}e.buffer=k;function E(T,D){return(H,j,G)=>{let re=D(new W);return T(function(I){let K=re.evaluate(I);K!==L&&H.call(j,K)},void 0,G)}}e.chain=E;let L=Symbol("HaltChainable");class W{constructor(){this.steps=[]}map(D){return this.steps.push(D),this}forEach(D){return this.steps.push(H=>(D(H),H)),this}filter(D){return this.steps.push(H=>D(H)?H:L),this}reduce(D,H){let j=H;return this.steps.push(G=>(j=D(j,G),j)),this}latch(D=(H,j)=>H===j){let H=!0,j;return this.steps.push(G=>{let re=H||!D(G,j);return H=!1,j=G,re?G:L}),this}evaluate(D){for(let H of this.steps)if(D=H(D),D===L)break;return D}}function z(T,D,H=j=>j){let j=(...K)=>I.fire(H(...K)),G=()=>T.on(D,j),re=()=>T.removeListener(D,j),I=new se({onWillAddFirstListener:G,onDidRemoveLastListener:re});return I.event}e.fromNodeEventEmitter=z;function q(T,D,H=j=>j){let j=(...K)=>I.fire(H(...K)),G=()=>T.addEventListener(D,j),re=()=>T.removeEventListener(D,j),I=new se({onWillAddFirstListener:G,onDidRemoveLastListener:re});return I.event}e.fromDOMEventEmitter=q;function Q(T){return new Promise(D=>r(T)(D))}e.toPromise=Q;function A(T){let D=new se;return T.then(H=>{D.fire(H)},()=>{D.fire(void 0)}).finally(()=>{D.dispose()}),D.event}e.fromPromise=A;function le(T,D){return T(H=>D.fire(H))}e.forward=le;function he(T,D,H){return D(H),T(j=>D(j))}e.runAndSubscribe=he;class ge{constructor(D,H){this._observable=D,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{D.addObserver(this)},onDidRemoveLastListener:()=>{D.removeObserver(this)}};this.emitter=new se(j),H&&H.add(this.emitter)}beginUpdate(D){this._counter++}handlePossibleChange(D){}handleChange(D,H){this._hasChanged=!0}endUpdate(D){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function F(T,D){return new ge(T,D).emitter.event}e.fromObservable=F;function V(T){return(D,H,j)=>{let G=0,re=!1,I={beginUpdate(){G++},endUpdate(){G--,G===0&&(T.reportChanges(),re&&(re=!1,D.call(H)))},handlePossibleChange(){},handleChange(){re=!0}};T.addObserver(I),T.reportChanges();let K={dispose(){T.removeObserver(I)}};return j instanceof Qn?j.add(K):Array.isArray(j)&&j.push(K),K}}e.fromObservableLight=V})(It||(It={}));var Xh=class Gh{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Gh._idPool++}`,Gh.all.add(this)}start(t){this._stopWatch=new eN,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Xh.all=new Set,Xh._idPool=0;var tN=Xh,rN=-1,xy=class wy{constructor(t,r,i=(wy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let i=this.threshold;if(i<=0||r{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[i,o]of this._stacks)(!t||r{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Q4=new G4;function wa(e){J4(e)||Q4.onUnexpectedError(e)}var Uh="Canceled";function J4(e){return e instanceof Z4?!0:e instanceof Error&&e.name===Uh&&e.message===Uh}var Z4=class extends Error{constructor(){super(Uh),this.name=this.message}};function eN(e){return new Error(`Illegal argument: ${e}`)}var m_=class Vh extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Vh)return t;let r=new Vh;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Kh=class yy extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,yy.prototype)}};function dr(e,t=0){return e[e.length-(1+t)]}var tN;(e=>{function t(l){return l<0}e.isLessThan=t;function r(l){return l<=0}e.isLessThanOrEqual=r;function i(l){return l>0}e.isGreaterThan=i;function o(l){return l===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(tN||(tN={}));function rN(e,t){let r=this,i=!1,o;return function(){return i||(i=!0,t||(o=e.apply(r,arguments))),o}}var xy;(e=>{function t(Y){return Y&&typeof Y=="object"&&typeof Y[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function i(){return r}e.empty=i;function*o(Y){yield Y}e.single=o;function l(Y){return t(Y)?Y:o(Y)}e.wrap=l;function a(Y){return Y||r}e.from=a;function*c(Y){for(let U=Y.length-1;U>=0;U--)yield Y[U]}e.reverse=c;function f(Y){return!Y||Y[Symbol.iterator]().next().done===!0}e.isEmpty=f;function h(Y){return Y[Symbol.iterator]().next().value}e.first=h;function g(Y,U){let T=0;for(let se of Y)if(U(se,T++))return!0;return!1}e.some=g;function m(Y,U){for(let T of Y)if(U(T))return T}e.find=m;function*x(Y,U){for(let T of Y)U(T)&&(yield T)}e.filter=x;function*y(Y,U){let T=0;for(let se of Y)yield U(se,T++)}e.map=y;function*S(Y,U){let T=0;for(let se of Y)yield*U(se,T++)}e.flatMap=S;function*k(...Y){for(let U of Y)yield*U}e.concat=k;function E(Y,U,T){let se=T;for(let he of Y)se=U(se,he);return se}e.reduce=E;function*L(Y,U,T=Y.length){for(U<0&&(U+=Y.length),T<0?T+=Y.length:T>Y.length&&(T=Y.length);U1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function nN(...e){return tt(()=>Ei(e))}function tt(e){return{dispose:rN(()=>{e()})}}var wy=class Sy{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ei(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Sy.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};wy.DISABLE_DISPOSED_WARNING=!1;var Zn=wy,Te=class{constructor(){this._store=new Zn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Te.None=Object.freeze({dispose(){}});var ps=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},_n=typeof window=="object"?window:globalThis,qh=class Yh{constructor(t){this.element=t,this.next=Yh.Undefined,this.prev=Yh.Undefined}};qh.Undefined=new qh(void 0);var it=qh,g_=class{constructor(){this._first=it.Undefined,this._last=it.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===it.Undefined}clear(){let e=this._first;for(;e!==it.Undefined;){let t=e.next;e.prev=it.Undefined,e.next=it.Undefined,e=t}this._first=it.Undefined,this._last=it.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new it(e);if(this._first===it.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==it.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==it.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==it.Undefined&&e.next!==it.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===it.Undefined&&e.next===it.Undefined?(this._first=it.Undefined,this._last=it.Undefined):e.next===it.Undefined?(this._last=this._last.prev,this._last.next=it.Undefined):e.prev===it.Undefined&&(this._first=this._first.next,this._first.prev=it.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==it.Undefined;)yield e.element,e=e.next}},iN=globalThis.performance&&typeof globalThis.performance.now=="function",sN=class by{static create(t){return new by(t)}constructor(t){this._now=iN&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},It;(e=>{e.None=()=>Te.None;function t(A,D){return m(A,()=>{},0,void 0,!0,void 0,D)}e.defer=t;function r(A){return(D,H=null,j)=>{let Q=!1,re;return re=A(I=>{if(!Q)return re?re.dispose():Q=!0,D.call(H,I)},null,j),Q&&re.dispose(),re}}e.once=r;function i(A,D,H){return h((j,Q=null,re)=>A(I=>j.call(Q,D(I)),null,re),H)}e.map=i;function o(A,D,H){return h((j,Q=null,re)=>A(I=>{D(I),j.call(Q,I)},null,re),H)}e.forEach=o;function l(A,D,H){return h((j,Q=null,re)=>A(I=>D(I)&&j.call(Q,I),null,re),H)}e.filter=l;function a(A){return A}e.signal=a;function c(...A){return(D,H=null,j)=>{let Q=nN(...A.map(re=>re(I=>D.call(H,I))));return g(Q,j)}}e.any=c;function f(A,D,H,j){let Q=H;return i(A,re=>(Q=D(Q,re),Q),j)}e.reduce=f;function h(A,D){let H,j={onWillAddFirstListener(){H=A(Q.fire,Q)},onDidRemoveLastListener(){H==null||H.dispose()}},Q=new oe(j);return D==null||D.add(Q),Q.event}function g(A,D){return D instanceof Array?D.push(A):D&&D.add(A),A}function m(A,D,H=100,j=!1,Q=!1,re,I){let q,b,P,V=0,C,ae={leakWarningThreshold:re,onWillAddFirstListener(){q=A(pe=>{V++,b=D(b,pe),j&&!P&&(ve.fire(b),b=void 0),C=()=>{let Pe=b;b=void 0,P=void 0,(!j||V>1)&&ve.fire(Pe),V=0},typeof H=="number"?(clearTimeout(P),P=setTimeout(C,H)):P===void 0&&(P=0,queueMicrotask(C))})},onWillRemoveListener(){Q&&V>0&&(C==null||C())},onDidRemoveLastListener(){C=void 0,q.dispose()}},ve=new oe(ae);return I==null||I.add(ve),ve.event}e.debounce=m;function x(A,D=0,H){return e.debounce(A,(j,Q)=>j?(j.push(Q),j):[Q],D,void 0,!0,void 0,H)}e.accumulate=x;function y(A,D=(j,Q)=>j===Q,H){let j=!0,Q;return l(A,re=>{let I=j||!D(re,Q);return j=!1,Q=re,I},H)}e.latch=y;function S(A,D,H){return[e.filter(A,D,H),e.filter(A,j=>!D(j),H)]}e.split=S;function k(A,D=!1,H=[],j){let Q=H.slice(),re=A(b=>{Q?Q.push(b):q.fire(b)});j&&j.add(re);let I=()=>{Q==null||Q.forEach(b=>q.fire(b)),Q=null},q=new oe({onWillAddFirstListener(){re||(re=A(b=>q.fire(b)),j&&j.add(re))},onDidAddFirstListener(){Q&&(D?setTimeout(I):I())},onDidRemoveLastListener(){re&&re.dispose(),re=null}});return j&&j.add(q),q.event}e.buffer=k;function E(A,D){return(H,j,Q)=>{let re=D(new W);return A(function(I){let q=re.evaluate(I);q!==L&&H.call(j,q)},void 0,Q)}}e.chain=E;let L=Symbol("HaltChainable");class W{constructor(){this.steps=[]}map(D){return this.steps.push(D),this}forEach(D){return this.steps.push(H=>(D(H),H)),this}filter(D){return this.steps.push(H=>D(H)?H:L),this}reduce(D,H){let j=H;return this.steps.push(Q=>(j=D(j,Q),j)),this}latch(D=(H,j)=>H===j){let H=!0,j;return this.steps.push(Q=>{let re=H||!D(Q,j);return H=!1,j=Q,re?Q:L}),this}evaluate(D){for(let H of this.steps)if(D=H(D),D===L)break;return D}}function z(A,D,H=j=>j){let j=(...q)=>I.fire(H(...q)),Q=()=>A.on(D,j),re=()=>A.removeListener(D,j),I=new oe({onWillAddFirstListener:Q,onDidRemoveLastListener:re});return I.event}e.fromNodeEventEmitter=z;function Y(A,D,H=j=>j){let j=(...q)=>I.fire(H(...q)),Q=()=>A.addEventListener(D,j),re=()=>A.removeEventListener(D,j),I=new oe({onWillAddFirstListener:Q,onDidRemoveLastListener:re});return I.event}e.fromDOMEventEmitter=Y;function U(A){return new Promise(D=>r(A)(D))}e.toPromise=U;function T(A){let D=new oe;return A.then(H=>{D.fire(H)},()=>{D.fire(void 0)}).finally(()=>{D.dispose()}),D.event}e.fromPromise=T;function se(A,D){return A(H=>D.fire(H))}e.forward=se;function he(A,D,H){return D(H),A(j=>D(j))}e.runAndSubscribe=he;class fe{constructor(D,H){this._observable=D,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{D.addObserver(this)},onDidRemoveLastListener:()=>{D.removeObserver(this)}};this.emitter=new oe(j),H&&H.add(this.emitter)}beginUpdate(D){this._counter++}handlePossibleChange(D){}handleChange(D,H){this._hasChanged=!0}endUpdate(D){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function F(A,D){return new fe(A,D).emitter.event}e.fromObservable=F;function K(A){return(D,H,j)=>{let Q=0,re=!1,I={beginUpdate(){Q++},endUpdate(){Q--,Q===0&&(A.reportChanges(),re&&(re=!1,D.call(H)))},handlePossibleChange(){},handleChange(){re=!0}};A.addObserver(I),A.reportChanges();let q={dispose(){A.removeObserver(I)}};return j instanceof Zn?j.add(q):Array.isArray(j)&&j.push(q),q}}e.fromObservableLight=K})(It||(It={}));var Xh=class Gh{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Gh._idPool++}`,Gh.all.add(this)}start(t){this._stopWatch=new sN,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Xh.all=new Set,Xh._idPool=0;var oN=Xh,lN=-1,ky=class Cy{constructor(t,r,i=(Cy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let i=this.threshold;if(i<=0||r{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[i,o]of this._stacks)(!t||r{var a,c,f,h,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let x=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new oN(`${m}. HINT: Stack shows most frequent listener (${x[1]}-times)`,x[0]);return(((a=this._options)==null?void 0:a.onListenerError)||wa)(y),De.None}if(this._disposed)return De.None;t&&(e=e.bind(t));let i=new ph(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=iN.create(),o=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof ph?(this._deliveryQueue??(this._deliveryQueue=new cN),this._listeners=[this._listeners,i]):this._listeners.push(i):((f=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||f.call(c,this),this._listeners=i,(g=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||g.call(h,this)),this._size++;let l=tt(()=>{o==null||o(),this._removeListener(i)});return r instanceof Qn?r.add(l):Array.isArray(r)&&r.push(l),l}),this._event}_removeListener(e){var o,l,a,c;if((l=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||l.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||c.call(a,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*aN<=t.length){let f=0;for(let h=0;h0}},cN=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Qh=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new se,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new se,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Qh.INSTANCE=new Qh;var rf=Qh;function hN(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}rf.INSTANCE.onDidChangeZoomLevel;function dN(e){return rf.INSTANCE.getZoomFactor(e)}rf.INSTANCE.onDidChangeFullscreen;var ys=typeof navigator=="object"?navigator.userAgent:"",Jh=ys.indexOf("Firefox")>=0,fN=ys.indexOf("AppleWebKit")>=0,nf=ys.indexOf("Chrome")>=0,pN=!nf&&ys.indexOf("Safari")>=0;ys.indexOf("Electron/")>=0;ys.indexOf("Android")>=0;var mh=!1;if(typeof mn.matchMedia=="function"){let e=mn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=mn.matchMedia("(display-mode: fullscreen)");mh=e.matches,hN(mn,e,({matches:r})=>{mh&&t.matches||(mh=r)})}var us="en",Zh=!1,ed=!1,Sa=!1,by=!1,ca,ba=us,m_=us,mN,Ir,bi=globalThis,Bt,cv;typeof bi.vscode<"u"&&typeof bi.vscode.process<"u"?Bt=bi.vscode.process:typeof process<"u"&&typeof((cv=process==null?void 0:process.versions)==null?void 0:cv.node)=="string"&&(Bt=process);var hv,gN=typeof((hv=Bt==null?void 0:Bt.versions)==null?void 0:hv.electron)=="string",_N=gN&&(Bt==null?void 0:Bt.type)==="renderer",dv;if(typeof Bt=="object"){Zh=Bt.platform==="win32",ed=Bt.platform==="darwin",Sa=Bt.platform==="linux",Sa&&Bt.env.SNAP&&Bt.env.SNAP_REVISION,Bt.env.CI||Bt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ca=us,ba=us;let e=Bt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ca=t.userLocale,m_=t.osLocale,ba=t.resolvedLanguage||us,mN=(dv=t.languagePack)==null?void 0:dv.translationsConfigFile}catch{}by=!0}else typeof navigator=="object"&&!_N?(Ir=navigator.userAgent,Zh=Ir.indexOf("Windows")>=0,ed=Ir.indexOf("Macintosh")>=0,(Ir.indexOf("Macintosh")>=0||Ir.indexOf("iPad")>=0||Ir.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Sa=Ir.indexOf("Linux")>=0,(Ir==null?void 0:Ir.indexOf("Mobi"))>=0,ba=globalThis._VSCODE_NLS_LANGUAGE||us,ca=navigator.language.toLowerCase(),m_=ca):console.error("Unable to resolve platform.");var ky=Zh,Gr=ed,vN=Sa,g_=by,Jr=Ir,Vn=ba,yN;(e=>{function t(){return Vn}e.value=t;function r(){return Vn.length===2?Vn==="en":Vn.length>=3?Vn[0]==="e"&&Vn[1]==="n"&&Vn[2]==="-":!1}e.isDefaultVariant=r;function i(){return Vn==="en"}e.isDefault=i})(yN||(yN={}));var xN=typeof bi.postMessage=="function"&&!bi.importScripts;(()=>{if(xN){let e=[];bi.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let i=0,o=e.length;i{let i=++t;e.push({id:i,callback:r}),bi.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var wN=!!(Jr&&Jr.indexOf("Chrome")>=0);Jr&&Jr.indexOf("Firefox")>=0;!wN&&Jr&&Jr.indexOf("Safari")>=0;Jr&&Jr.indexOf("Edg/")>=0;Jr&&Jr.indexOf("Android")>=0;var os=typeof navigator=="object"?navigator:{};g_||document.queryCommandSupported&&document.queryCommandSupported("copy")||os&&os.clipboard&&os.clipboard.writeText,g_||os&&os.clipboard&&os.clipboard.readText;var sf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},gh=new sf,__=new sf,v_=new sf,SN=new Array(230),Cy;(e=>{function t(c){return gh.keyCodeToStr(c)}e.toString=t;function r(c){return gh.strToKeyCode(c)}e.fromString=r;function i(c){return __.keyCodeToStr(c)}e.toUserSettingsUS=i;function o(c){return v_.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function l(c){return __.strToKeyCode(c)||v_.strToKeyCode(c)}e.fromUserSettings=l;function a(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return gh.keyCodeToStr(c)}e.toElectronAccelerator=a})(Cy||(Cy={}));var bN=class Ey{constructor(t,r,i,o,l){this.ctrlKey=t,this.shiftKey=r,this.altKey=i,this.metaKey=o,this.keyCode=l}equals(t){return t instanceof Ey&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",i=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${r}${i}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new kN([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},kN=class{constructor(e){if(e.length===0)throw X4("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t{function t(r){return r===e.None||r===e.Cancelled||r instanceof TN?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:It.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ny})})(DN||(DN={}));var TN=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ny:(this._emitter||(this._emitter=new se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},of=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Kh("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Kh("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},AN=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new Kh("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},t);this.disposable=tt(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},BN;(e=>{async function t(i){let o,l=await Promise.all(i.map(a=>a.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return l}e.settled=t;function r(i){return new Promise(async(o,l)=>{try{await i(o,l)}catch(a){l(a)}})}e.withAsyncBody=r})(BN||(BN={}));var S_=class kr{static fromArray(t){return new kr(r=>{r.emitMany(t)})}static fromPromise(t){return new kr(async r=>{r.emitMany(await t)})}static fromPromises(t){return new kr(async r=>{await Promise.all(t.map(async i=>r.emitOne(await i)))})}static merge(t){return new kr(async r=>{await Promise.all(t.map(async i=>{for await(let o of i)r.emitOne(o)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new se,queueMicrotask(async()=>{let i={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(i)),this.resolve()}catch(o){this.reject(o)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new kr(async i=>{for await(let o of t)i.emitOne(r(o))})}map(t){return kr.map(this,t)}static filter(t,r){return new kr(async i=>{for await(let o of t)r(o)&&i.emitOne(o)})}filter(t){return kr.filter(this,t)}static coalesce(t){return kr.filter(t,r=>!!r)}coalesce(){return kr.coalesce(this)}static async toPromise(t){let r=[];for await(let i of t)r.push(i);return r}toPromise(){return kr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};S_.EMPTY=S_.fromArray([]);var{getWindow:Xr,getWindowId:IN,onDidRegisterWindow:jN}=(function(){let e=new Map,t={window:mn,disposables:new Qn};e.set(mn.vscodeWindowId,t);let r=new se,i=new se,o=new se;function l(a,c){return(typeof a=="number"?e.get(a):void 0)??(c?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:i.event,registerWindow(a){if(e.has(a.vscodeWindowId))return De.None;let c=new Qn,f={window:a,disposables:c.add(new Qn)};return e.set(a.vscodeWindowId,f),c.add(tt(()=>{e.delete(a.vscodeWindowId),i.fire(a)})),c.add(Ee(a,Ct.BEFORE_UNLOAD,()=>{o.fire(a)})),r.fire(f),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:l,getWindow(a){var h;let c=a;if((h=c==null?void 0:c.ownerDocument)!=null&&h.defaultView)return c.ownerDocument.defaultView.window;let f=a;return f!=null&&f.view?f.view.window:mn},getDocument(a){return Xr(a).document}}})(),zN=class{constructor(e,t,r,i){this._node=e,this._type=t,this._handler=r,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ee(e,t,r,i){return new zN(e,t,r,i)}var b_=function(e,t,r,i){return Ee(e,t,r,i)},lf,ON=class extends AN{constructor(e){super(),this.defaultTarget=e&&Xr(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},k_=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){wa(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,i=new Map,o=l=>{r.set(l,!1);let a=e.get(l)??[];for(t.set(l,a),e.set(l,[]),i.set(l,!0);a.length>0;)a.sort(k_.sort),a.shift().execute();i.set(l,!1)};lf=(l,a,c=0)=>{let f=IN(l),h=new k_(a,c),g=e.get(f);return g||(g=[],e.set(f,g)),g.push(h),r.get(f)||(r.set(f,!0),l.requestAnimationFrame(()=>o(f))),h}})();function FN(e){let t=e.getBoundingClientRect(),r=Xr(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var Ct={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},HN=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=nr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=nr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=nr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=nr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=nr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=nr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=nr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=nr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=nr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=nr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=nr(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=nr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=nr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=nr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function nr(e){return typeof e=="number"?`${e}px`:e}function Lo(e){return new HN(e)}var Ly=class{constructor(){this._hooks=new Qn,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,i,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=o;let l=e;try{e.setPointerCapture(t),this._hooks.add(tt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=Xr(e)}this._hooks.add(Ee(l,Ct.POINTER_MOVE,a=>{if(a.buttons!==r){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(Ee(l,Ct.POINTER_UP,a=>this.stopMonitoring(!0)))}};function $N(e,t,r){let i=null,o=null;if(typeof r.value=="function"?(i="value",o=r.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(i="get",o=r.get),!o)throw new Error("not supported");let l=`$memoize$${t}`;r[i]=function(...a){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,a)}),this[l]}}var Kr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Kr||(Kr={}));var xo=class Ht extends De{constructor(){super(),this.dispatched=!1,this.targets=new p_,this.ignoreTargets=new p_,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(It.runAndSubscribe(jN,({window:t,disposables:r})=>{r.add(Ee(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),r.add(Ee(t.document,"touchend",i=>this.onTouchEnd(t,i))),r.add(Ee(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:mn,disposables:this._store}))}static addTarget(t){if(!Ht.isTouchDevice())return De.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let r=Ht.INSTANCE.targets.push(t);return tt(r)}static ignoreTarget(t){if(!Ht.isTouchDevice())return De.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let r=Ht.INSTANCE.ignoreTargets.push(t);return tt(r)}static isTouchDevice(){return"ontouchstart"in mn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,o=t.targetTouches.length;i=Ht.HOLD_DELAY&&Math.abs(f.initialPageX-dr(f.rollingPageX))<30&&Math.abs(f.initialPageY-dr(f.rollingPageY))<30){let g=this.newGestureEvent(Kr.Contextmenu,f.initialTarget);g.pageX=dr(f.rollingPageX),g.pageY=dr(f.rollingPageY),this.dispatchEvent(g)}else if(o===1){let g=dr(f.rollingPageX),m=dr(f.rollingPageY),x=dr(f.rollingTimestamps)-f.rollingTimestamps[0],y=g-f.rollingPageX[0],S=m-f.rollingPageY[0],k=[...this.targets].filter(E=>f.initialTarget instanceof Node&&E.contains(f.initialTarget));this.inertia(t,k,i,Math.abs(y)/x,y>0?1:-1,g,Math.abs(S)/x,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Kr.End,f.initialTarget)),delete this.activeTouches[c.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=r,i.tapCount=0,i}dispatchEvent(t){if(t.type===Kr.Tap){let r=new Date().getTime(),i=0;r-this._lastSetTapCountTime>Ht.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=r,t.tapCount=i}else(t.type===Kr.Change||t.type===Kr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let r=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let o=0,l=t.initialTarget;for(;l&&l!==i;)o++,l=l.parentElement;r.push([o,i])}r.sort((i,o)=>i[0]-o[0]);for(let[i,o]of r)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,i,o,l,a,c,f,h){this.handle=lf(t,()=>{let g=Date.now(),m=g-i,x=0,y=0,S=!0;o+=Ht.SCROLL_FRICTION*m,c+=Ht.SCROLL_FRICTION*m,o>0&&(S=!1,x=l*o*m),c>0&&(S=!1,y=f*c*m);let k=this.newGestureEvent(Kr.Change);k.translationX=x,k.translationY=y,r.forEach(E=>E.dispatchEvent(k)),S||this.inertia(t,r,g,o,l,a+x,c,f,h+y)})}onTouchMove(t){let r=Date.now();for(let i=0,o=t.changedTouches.length;i3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(l.pageX),a.rollingPageY.push(l.pageY),a.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};xo.SCROLL_FRICTION=-.005,xo.HOLD_DELAY=700,xo.CLEAR_TAP_COUNT_TIME=400,ut([$N],xo,"isTouchDevice",1);var WN=xo,af=class extends De{onclick(e,t){this._register(Ee(e,Ct.CLICK,r=>t(new ha(Xr(e),r))))}onmousedown(e,t){this._register(Ee(e,Ct.MOUSE_DOWN,r=>t(new ha(Xr(e),r))))}onmouseover(e,t){this._register(Ee(e,Ct.MOUSE_OVER,r=>t(new ha(Xr(e),r))))}onmouseleave(e,t){this._register(Ee(e,Ct.MOUSE_LEAVE,r=>t(new ha(Xr(e),r))))}onkeydown(e,t){this._register(Ee(e,Ct.KEY_DOWN,r=>t(new y_(r))))}onkeyup(e,t){this._register(Ee(e,Ct.KEY_UP,r=>t(new y_(r))))}oninput(e,t){this._register(Ee(e,Ct.INPUT,t))}onblur(e,t){this._register(Ee(e,Ct.BLUR,t))}onfocus(e,t){this._register(Ee(e,Ct.FOCUS,t))}onchange(e,t){this._register(Ee(e,Ct.CHANGE,t))}ignoreGesture(e){return WN.ignoreTarget(e)}},C_=11,UN=class extends af{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=C_+"px",this.domNode.style.height=C_+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Ly),this._register(b_(this.bgDomNode,Ct.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(b_(this.domNode,Ct.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new ON),this._pointerdownScheduleRepeatTimer=this._register(new of)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Xr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},VN=class td{constructor(t,r,i,o,l,a,c){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,i=i|0,o=o|0,l=l|0,a=a|0,c=c|0),this.rawScrollLeft=o,this.rawScrollTop=c,r<0&&(r=0),o+r>i&&(o=i-r),o<0&&(o=0),l<0&&(l=0),c+l>a&&(c=a-l),c<0&&(c=0),this.width=r,this.scrollWidth=i,this.scrollLeft=o,this.height=l,this.scrollHeight=a,this.scrollTop=c}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new td(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new td(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let i=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,c=this.scrollHeight!==t.scrollHeight,f=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:o,scrollLeftChanged:l,heightChanged:a,scrollHeightChanged:c,scrollTopChanged:f}}},KN=class extends De{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new VN(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(i=this._smoothScrolling)==null||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let i;t?i=new N_(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=N_.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},E_=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function _h(e,t){let r=t-e;return function(i){return e+r*XN(i)}}function qN(e,t,r){return function(i){return i2.5*i){let o,l;return t{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},QN=140,Py=class extends af{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new GN(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Ly),this._shouldRender=!0,this.domNode=Lo(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ee(this.domNode.domNode,Ct.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new UN(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,i){this.slider=Lo(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ee(this.slider.domNode,Ct.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);r<=o&&o<=i?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let o=FN(this.domNode.domNode);t=e.pageX-o.left,r=e.pageY-o.top}let i=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),i=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let l=this._sliderOrthogonalPointerPosition(o),a=Math.abs(l-r);if(ky&&a>QN){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Ry=class nd{constructor(t,r,i,o,l,a){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=l,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new nd(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,i,o,l){let a=Math.max(0,i-t),c=Math.max(0,a-2*r),f=o>0&&o>i;if(!f)return{computedAvailableSize:Math.round(a),computedIsNeeded:f,computedSliderSize:Math.round(c),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(i*c/o))),g=(c-h)/(o-i),m=l*g;return{computedAvailableSize:Math.round(a),computedIsNeeded:f,computedSliderSize:Math.round(h),computedSliderRatio:g,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=nd._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,i=this._scrollPosition;return r0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),r){let o=Math.abs(t.deltaX),l=Math.abs(t.deltaY),a=Math.abs(r.deltaX),c=Math.abs(r.deltaY),f=Math.max(Math.min(o,a),1),h=Math.max(Math.min(l,c),1),g=Math.max(o,a),m=Math.max(l,c);g%f===0&&m%h===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};id.INSTANCE=new id;var rL=id,nL=class extends af{constructor(e,t,r){super(),this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new se),this.onWillScroll=this._onWillScroll.event,this._options=sL(t),this._scrollable=r,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let i={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new ZN(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new JN(this._scrollable,this._options,i)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Lo(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Lo(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Lo(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new of),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ei(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Gr&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new w_(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ei(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new w_(r))};this._mouseWheelToDispose.push(Ee(this._listenOnDomNode,Ct.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let t=rL.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+l===0?a=l=0:Math.abs(l)>=Math.abs(a)?a=0:l=0),this._options.flipAxes&&([l,a]=[a,l]);let c=!Gr&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!a&&(a=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let f=this._scrollable.getFutureScrollPosition(),h={};if(l){let g=L_*l,m=f.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(h,m)}if(a){let g=L_*a,m=f.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(h,m)}h=this._scrollable.validateScrollPosition(h),(f.scrollLeft!==h.scrollLeft||f.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),r=!0)}let i=r;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,i=r?" left":"",o=t?" top":"",l=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${i}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),eL)}},iL=class extends nL{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function sL(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Gr&&(t.className+=" mac"),t}var sd=class extends De{constructor(e,t,r,i,o,l,a,c){super(),this._bufferService=r,this._optionsService=a,this._renderService=c,this._onRequestScrollLines=this._register(new se),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let f=this._register(new KN({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>lf(i.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{f.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new iL(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},f)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(It.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(tt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(tt(()=>this._styleElement.remove())),this._register(It.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` -`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};sd=ut([ue(2,Xt),ue(3,vn),ue(4,cy),ue(5,vs),ue(6,Gt),ue(7,yn)],sd);var od=class extends De{constructor(e,t,r,i,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=i,this._renderService=o,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(l=>this._removeDecoration(l))),this._register(tt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var i;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)==null?void 0:i.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};od=ut([ue(1,Xt),ue(2,vn),ue(3,Wo),ue(4,yn)],od);var oL=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Ur={full:0,left:0,center:0,right:0},Kn={full:0,left:0,center:0,right:0},po={full:0,left:0,center:0,right:0},Ia=class extends De{constructor(e,t,r,i,o,l,a,c){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=i,this._renderService=o,this._optionsService=l,this._themeService=a,this._coreBrowserService=c,this._colorZoneStore=new oL,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(tt(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let f=this._canvas.getContext("2d");if(f)this._ctx=f;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Kn.full=this._canvas.width,Kn.left=e,Kn.center=t,Kn.right=e,this._refreshDrawHeightConstants(),po.full=1,po.left=1,po.center=1+Kn.left,po.right=1+Kn.left+Kn.center}_refreshDrawHeightConstants(){Ur.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ur.left=t,Ur.center=t,Ur.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(po[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ur[e.position||"full"]/2),Kn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ur[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ia=ut([ue(2,Xt),ue(3,Wo),ue(4,yn),ue(5,Gt),ue(6,vs),ue(7,vn)],Ia);var X;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=` -`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(X||(X={}));var ka;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(ka||(ka={}));var My;(e=>e.ST=`${X.ESC}\\`)(My||(My={}));var ld=class{constructor(e,t,r,i,o,l){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._coreService=o,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.lengththis.updateCompositionElements(!0),0)}}};ld=ut([ue(2,Xt),ue(3,Gt),ue(4,Ri),ue(5,yn)],ld);var Et=0,Nt=0,Lt=0,lt=0,P_={css:"#00000000",rgba:0},gt;(e=>{function t(o,l,a,c){return c!==void 0?`#${gi(o)}${gi(l)}${gi(a)}${gi(c)}`:`#${gi(o)}${gi(l)}${gi(a)}`}e.toCss=t;function r(o,l,a,c=255){return(o<<24|l<<16|a<<8|c)>>>0}e.toRgba=r;function i(o,l,a,c){return{css:e.toCss(o,l,a,c),rgba:e.toRgba(o,l,a,c)}}e.toColor=i})(gt||(gt={}));var Ze;(e=>{function t(f,h){if(lt=(h.rgba&255)/255,lt===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,m=h.rgba>>16&255,x=h.rgba>>8&255,y=f.rgba>>24&255,S=f.rgba>>16&255,k=f.rgba>>8&255;Et=y+Math.round((g-y)*lt),Nt=S+Math.round((m-S)*lt),Lt=k+Math.round((x-k)*lt);let E=gt.toCss(Et,Nt,Lt),L=gt.toRgba(Et,Nt,Lt);return{css:E,rgba:L}}e.blend=t;function r(f){return(f.rgba&255)===255}e.isOpaque=r;function i(f,h,g){let m=Ca.ensureContrastRatio(f.rgba,h.rgba,g);if(m)return gt.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=i;function o(f){let h=(f.rgba|255)>>>0;return[Et,Nt,Lt]=Ca.toChannels(h),{css:gt.toCss(Et,Nt,Lt),rgba:h}}e.opaque=o;function l(f,h){return lt=Math.round(h*255),[Et,Nt,Lt]=Ca.toChannels(f.rgba),{css:gt.toCss(Et,Nt,Lt,lt),rgba:gt.toRgba(Et,Nt,Lt,lt)}}e.opacity=l;function a(f,h){return lt=f.rgba&255,l(f,lt*h/255)}e.multiplyOpacity=a;function c(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}e.toColorRGB=c})(Ze||(Ze={}));var st;(e=>{let t,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function i(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return Et=parseInt(o.slice(1,2).repeat(2),16),Nt=parseInt(o.slice(2,3).repeat(2),16),Lt=parseInt(o.slice(3,4).repeat(2),16),gt.toColor(Et,Nt,Lt);case 5:return Et=parseInt(o.slice(1,2).repeat(2),16),Nt=parseInt(o.slice(2,3).repeat(2),16),Lt=parseInt(o.slice(3,4).repeat(2),16),lt=parseInt(o.slice(4,5).repeat(2),16),gt.toColor(Et,Nt,Lt,lt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let l=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return Et=parseInt(l[1]),Nt=parseInt(l[2]),Lt=parseInt(l[3]),lt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),gt.toColor(Et,Nt,Lt,lt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Et,Nt,Lt,lt]=t.getImageData(0,0,1,1).data,lt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gt.toRgba(Et,Nt,Lt,lt),css:o}}e.toColor=i})(st||(st={}));var qt;(e=>{function t(i){return r(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function r(i,o,l){let a=i/255,c=o/255,f=l/255,h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),g=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),m=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return h*.2126+g*.7152+m*.0722}e.relativeLuminance2=r})(qt||(qt={}));var Ca;(e=>{function t(a,c){if(lt=(c&255)/255,lt===1)return c;let f=c>>24&255,h=c>>16&255,g=c>>8&255,m=a>>24&255,x=a>>16&255,y=a>>8&255;return Et=m+Math.round((f-m)*lt),Nt=x+Math.round((h-x)*lt),Lt=y+Math.round((g-y)*lt),gt.toRgba(Et,Nt,Lt)}e.blend=t;function r(a,c,f){let h=qt.relativeLuminance(a>>8),g=qt.relativeLuminance(c>>8);if(fn(h,g)>8));if(S>8));return S>E?y:k}return y}let m=o(a,c,f),x=fn(h,qt.relativeLuminance(m>>8));if(x>8));return x>S?m:y}return m}}e.ensureContrastRatio=r;function i(a,c,f){let h=a>>24&255,g=a>>16&255,m=a>>8&255,x=c>>24&255,y=c>>16&255,S=c>>8&255,k=fn(qt.relativeLuminance2(x,y,S),qt.relativeLuminance2(h,g,m));for(;k0||y>0||S>0);)x-=Math.max(0,Math.ceil(x*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),k=fn(qt.relativeLuminance2(x,y,S),qt.relativeLuminance2(h,g,m));return(x<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=i;function o(a,c,f){let h=a>>24&255,g=a>>16&255,m=a>>8&255,x=c>>24&255,y=c>>16&255,S=c>>8&255,k=fn(qt.relativeLuminance2(x,y,S),qt.relativeLuminance2(h,g,m));for(;k>>0}e.increaseLuminance=o;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(Ca||(Ca={}));function gi(e){let t=e.toString(16);return t.length<2?"0"+t:t}function fn(e,t){return e1){let g=this._getJoinedRanges(i,a,l,t,o);for(let m=0;m1){let h=this._getJoinedRanges(i,a,l,t,o);for(let g=0;g=F,re=D,I=this._workCell;if(x.length>0&&D===x[0][0]&&G){let ze=x.shift(),en=this._isCellInSelection(ze[0],t);for(W=ze[0]+1;W=ze[1]),G?(j=!0,I=new lL(this._workCell,e.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),re=ze[1]-1,H=I.getWidth()):F=ze[1]}let K=this._isCellInSelection(D,t),b=r&&D===l,P=T&&D>=h&&D<=g,U=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,ze=>{U=!0});let C=I.getChars()||Xn;if(C===" "&&(I.isUnderline()||I.isOverline())&&(C=" "),ge=H*c-f.get(C,I.isBold(),I.isItalic()),!k)k=this._document.createElement("span");else if(E&&(K&&he||!K&&!he&&I.bg===z)&&(K&&he&&y.selectionForeground||I.fg===q)&&I.extended.ext===Q&&P===A&&ge===le&&!b&&!j&&!U&&G){I.isInvisible()?L+=Xn:L+=C,E++;continue}else E&&(k.textContent=L),k=this._document.createElement("span"),E=0,L="";if(z=I.bg,q=I.fg,Q=I.extended.ext,A=P,le=ge,he=K,j&&l>=D&&l<=re&&(l=D),!this._coreService.isCursorHidden&&b&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&V.push("xterm-cursor-blink"),V.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline");break}}if(I.isBold()&&V.push("xterm-bold"),I.isItalic()&&V.push("xterm-italic"),I.isDim()&&V.push("xterm-dim"),I.isInvisible()?L=Xn:L=I.getChars()||Xn,I.isUnderline()&&(V.push(`xterm-underline-${I.extended.underlineStyle}`),L===" "&&(L=" "),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())k.style.textDecorationColor=`rgb(${$o.toColorRGB(I.getUnderlineColor()).join(",")})`;else{let ze=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&ze<8&&(ze+=8),k.style.textDecorationColor=y.ansi[ze].css}I.isOverline()&&(V.push("xterm-overline"),L===" "&&(L=" ")),I.isStrikethrough()&&V.push("xterm-strikethrough"),P&&(k.style.textDecoration="underline");let ae=I.getFgColor(),ve=I.getFgColorMode(),fe=I.getBgColor(),Le=I.getBgColorMode(),ye=!!I.isInverse();if(ye){let ze=ae;ae=fe,fe=ze;let en=ve;ve=Le,Le=en}let xe,Fe,Ye=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,ze=>{ze.options.layer!=="top"&&Ye||(ze.backgroundColorRGB&&(Le=50331648,fe=ze.backgroundColorRGB.rgba>>8&16777215,xe=ze.backgroundColorRGB),ze.foregroundColorRGB&&(ve=50331648,ae=ze.foregroundColorRGB.rgba>>8&16777215,Fe=ze.foregroundColorRGB),Ye=ze.options.layer==="top")}),!Ye&&K&&(xe=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,fe=xe.rgba>>8&16777215,Le=50331648,Ye=!0,y.selectionForeground&&(ve=50331648,ae=y.selectionForeground.rgba>>8&16777215,Fe=y.selectionForeground)),Ye&&V.push("xterm-decoration-top");let or;switch(Le){case 16777216:case 33554432:or=y.ansi[fe],V.push(`xterm-bg-${fe}`);break;case 50331648:or=gt.toColor(fe>>16,fe>>8&255,fe&255),this._addStyle(k,`background-color:#${R_((fe>>>0).toString(16),"0",6)}`);break;case 0:default:ye?(or=y.foreground,V.push("xterm-bg-257")):or=y.background}switch(xe||I.isDim()&&(xe=Ze.multiplyOpacity(or,.5)),ve){case 16777216:case 33554432:I.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(k,or,y.ansi[ae],I,xe,void 0)||V.push(`xterm-fg-${ae}`);break;case 50331648:let ze=gt.toColor(ae>>16&255,ae>>8&255,ae&255);this._applyMinimumContrast(k,or,ze,I,xe,Fe)||this._addStyle(k,`color:#${R_(ae.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(k,or,y.foreground,I,xe,Fe)||ye&&V.push("xterm-fg-257")}V.length&&(k.className=V.join(" "),V.length=0),!b&&!j&&!U&&G?E++:k.textContent=L,ge!==this.defaultSpacing&&(k.style.letterSpacing=`${ge}px`),m.push(k),D=re}return k&&E&&(k.textContent=L),m}_applyMinimumContrast(e,t,r,i,o,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||cL(i.getCode()))return!1;let a=this._getContrastCache(i),c;if(!o&&!l&&(c=a.getColor(t.rgba,r.rgba)),c===void 0){let f=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);c=Ze.ensureContrastRatio(o||t,l||r,f),a.setColor((o||t).rgba,(l||r).rgba,c??null)}return c?(this._addStyle(e,`color:${c.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,i=this._selectionEnd;return!r||!i?!1:this._columnSelectMode?r[0]<=i[0]?e>=r[0]&&t>=r[1]&&e=r[1]&&e>=i[0]&&t<=i[1]:t>r[1]&&t=r[0]&&e=r[0]}};ad=ut([ue(1,fy),ue(2,Gt),ue(3,vn),ue(4,Ri),ue(5,Wo),ue(6,vs)],ad);function R_(e,t,r){for(;e.length0&&(this._flat[i]=a),a}let o=e;t&&(o+="B"),r&&(o+="I");let l=this._holey.get(o);if(l===void 0){let a=0;t&&(a|=1),r&&(a|=2),l=this._measure(e,a),l>0&&this._holey.set(o,l)}return l}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},fL=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,r,i=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,l=t[1]-o,a=r[1]-o,c=Math.max(l,0),f=Math.min(a,e.rows-1);if(c>=e.rows||f<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=i,this.viewportStartRow=l,this.viewportEndRow=a,this.viewportCappedStartRow=c,this.viewportCappedEndRow=f,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r=this.startCol&&t=this.startCol):!1}};function pL(){return new fL}var vh="xterm-dom-renderer-owner-",br="xterm-rows",fa="xterm-fg-",M_="xterm-bg-",mo="xterm-focus",pa="xterm-selection",mL=1,ud=class extends De{constructor(e,t,r,i,o,l,a,c,f,h,g,m,x,y){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=i,this._viewportElement=o,this._helperContainer=l,this._linkifier2=a,this._charSizeService=f,this._optionsService=h,this._bufferService=g,this._coreService=m,this._coreBrowserService=x,this._themeService=y,this._terminalClass=mL++,this._rowElements=[],this._selectionRenderModel=pL(),this.onRequestRedraw=this._register(new se).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(br),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(pa),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=hL(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=c.createInstance(ad,document),this._element.classList.add(vh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(tt(()=>{this._element.classList.remove(vh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new dL(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${br} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${br} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${br} .xterm-dim { color: ${Ze.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,i=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${br}.${mo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${br}.${mo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${br}.${mo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${pa} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${pa} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${pa} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,a]of e.ansi.entries())t+=`${this._terminalSelector} .${fa}${l} { color: ${a.css}; }${this._terminalSelector} .${fa}${l}.xterm-dim { color: ${Ze.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${M_}${l} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${fa}257 { color: ${Ze.opaque(e.background).css}; }${this._terminalSelector} .${fa}257.xterm-dim { color: ${Ze.multiplyOpacity(Ze.opaque(e.background),.5).css}; }${this._terminalSelector} .${M_}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let r=this._rowElements.length;r<=t;r++){let i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(mo),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(mo),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let i=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(r){let f=e[0]>t[0];c.appendChild(this._createSelectionElement(l,f?t[0]:e[0],f?e[0]:t[0],a-l+1))}else{let f=i===l?e[0]:0,h=l===o?t[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,f,h));let g=a-l-1;if(c.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,g)),l!==a){let m=o===a?t[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(a,0,m))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,t,r,i=1){let o=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(r-t);return l+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l),o.style.height=`${i*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${l}px`,o.style.width=`${a}px`,o}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let r=this._bufferService.buffer,i=r.ybase+r.y,o=Math.min(r.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=e;f<=t;f++){let h=f+r.ydisp,g=this._rowElements[f],m=r.lines.get(h);if(!g||!m)break;g.replaceChildren(...this._rowFactory.createRow(m,h,h===i,a,c,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${vh}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,r,i,o,l){r<0&&(e=0),i<0&&(t=0);let a=this._bufferService.rows-1;r=Math.max(Math.min(r,a),0),i=Math.max(Math.min(i,a),0),o=Math.min(o,this._bufferService.cols);let c=this._bufferService.buffer,f=c.ybase+c.y,h=Math.min(c.x,o-1),g=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=r;y<=i;++y){let S=y+c.ydisp,k=this._rowElements[y],E=c.lines.get(S);if(!k||!E)break;k.replaceChildren(...this._rowFactory.createRow(E,S,S===f,m,x,h,g,this.dimensions.css.cell.width,this._widthCache,l?y===r?e:0:-1,l?(y===i?t:o)-1:-1))}}};ud=ut([ue(7,ef),ue(8,Ja),ue(9,Gt),ue(10,Xt),ue(11,Ri),ue(12,vn),ue(13,vs)],ud);var cd=class extends De{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new se),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new _L(this._optionsService))}catch{this._measureStrategy=this._register(new gL(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};cd=ut([ue(2,Gt)],cd);var Dy=class extends De{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},gL=class extends Dy{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},_L=class extends Dy{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},vL=class extends De{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new yL(this._window)),this._onDprChange=this._register(new se),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new se),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(It.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ee(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ee(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},yL=class extends De{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ps),this._onDprChange=this._register(new se),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(tt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ee(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},xL=class extends De{constructor(){super(),this.linkProviders=[],this._register(tt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function uf(e,t,r){let i=r.getBoundingClientRect(),o=e.getComputedStyle(r),l=parseInt(o.getPropertyValue("padding-left")),a=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-i.left-l,t.clientY-i.top-a]}function wL(e,t,r,i,o,l,a,c,f){if(!l)return;let h=uf(e,t,r);if(h)return h[0]=Math.ceil((h[0]+(f?a/2:0))/a),h[1]=Math.ceil(h[1]/c),h[0]=Math.min(Math.max(h[0],1),i+(f?1:0)),h[1]=Math.min(Math.max(h[1],1),o),h}var hd=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,i,o){return wL(window,e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let r=uf(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};hd=ut([ue(0,yn),ue(1,Ja)],hd);var SL=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Ty={};D4(Ty,{getSafariVersion:()=>kL,isChromeOS:()=>jy,isFirefox:()=>Ay,isIpad:()=>CL,isIphone:()=>EL,isLegacyEdge:()=>bL,isLinux:()=>cf,isMac:()=>za,isNode:()=>Za,isSafari:()=>By,isWindows:()=>Iy});var Za=typeof process<"u"&&"title"in process,Uo=Za?"node":navigator.userAgent,Vo=Za?"node":navigator.platform,Ay=Uo.includes("Firefox"),bL=Uo.includes("Edge"),By=/^((?!chrome|android).)*safari/i.test(Uo);function kL(){if(!By)return 0;let e=Uo.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var za=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Vo),CL=Vo==="iPad",EL=Vo==="iPhone",Iy=["Windows","Win16","Win32","WinCE"].includes(Vo),cf=Vo.indexOf("Linux")>=0,jy=/\bCrOS\b/.test(Uo),zy=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._io){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=o}this.clear()}},NL=class extends zy{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},LL=class extends zy{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Oa=!Za&&"requestIdleCallback"in window?LL:NL,PL=class{constructor(){this._queue=new Oa}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},dd=class extends De{constructor(e,t,r,i,o,l,a,c,f){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=i,this._coreService=o,this._coreBrowserService=c,this._renderer=this._register(new ps),this._pausedResizeTask=new PL,this._observerDisposable=this._register(new ps),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new se),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new se),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new se),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new se),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new SL((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new RL(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(tt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(f.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=tt(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,r){var i;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(i=this._renderer.value)==null||i.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};dd=ut([ue(2,Gt),ue(3,Ja),ue(4,Ri),ue(5,Wo),ue(6,Xt),ue(7,vn),ue(8,vs)],dd);var RL=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function ML(e,t,r,i){let o=r.buffer.x,l=r.buffer.y;if(!r.buffer.hasScrollback)return AL(o,l,e,t,r,i)+eu(l,t,r,i)+BL(o,l,e,t,r,i);let a;if(l===t)return a=o>e?"D":"C",Bo(Math.abs(o-e),Ao(a,i));a=l>t?"D":"C";let c=Math.abs(l-t),f=TL(l>t?e:o,r)+(c-1)*r.cols+1+DL(l>t?o:e);return Bo(f,Ao(a,i))}function DL(e,t){return e-1}function TL(e,t){return t.cols-e}function AL(e,t,r,i,o,l){return eu(t,i,o,l).length===0?"":Bo(Fy(e,t,e,t-Ni(t,o),!1,o).length,Ao("D",l))}function eu(e,t,r,i){let o=e-Ni(e,r),l=t-Ni(t,r),a=Math.abs(o-l)-IL(e,t,r);return Bo(a,Ao(Oy(e,t),i))}function BL(e,t,r,i,o,l){let a;eu(t,i,o,l).length>0?a=i-Ni(i,o):a=t;let c=i,f=jL(e,t,r,i,o,l);return Bo(Fy(e,a,r,c,f==="C",o).length,Ao(f,l))}function IL(e,t,r){var a;let i=0,o=e-Ni(e,r),l=t-Ni(t,r);for(let c=0;c=0&&e0?a=i-Ni(i,o):a=t,e=r&&at?"A":"B"}function Fy(e,t,r,i,o,l){let a=e,c=t,f="";for(;(a!==r||c!==i)&&c>=0&&cl.cols-1?(f+=l.buffer.translateBufferLineToString(c,!1,e,a),a=0,e=0,c++):!o&&a<0&&(f+=l.buffer.translateBufferLineToString(c,!1,0,e+1),a=l.cols-1,e=a,c--);return f+l.buffer.translateBufferLineToString(c,!1,e,a)}function Ao(e,t){let r=t?"O":"[";return X.ESC+r+e}function Bo(e,t){e=Math.floor(e);let r="";for(let i=0;ithis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function D_(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var yh=50,OL=15,FL=50,HL=500,$L=" ",WL=new RegExp($L,"g"),fd=class extends De{constructor(e,t,r,i,o,l,a,c,f){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=i,this._coreService=o,this._mouseService=l,this._optionsService=a,this._renderService=c,this._coreBrowserService=f,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Lr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new se),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new se),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new se),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new se),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new zL(this._bufferService),this._activeSelectionMode=0,this._register(tt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,i=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]o.replace(WL," ")).join(Iy?`\r +`))}},cN=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},hN=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},dN=0,ph=class{constructor(e){this.value=e,this.id=dN++}},fN=2,pN,oe=class{constructor(e){var t,r,i,o;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new aN((e==null?void 0:e.onListenerError)??wa,((r=this._options)==null?void 0:r.leakWarningThreshold)??lN):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new oN(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var e,t,r,i;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(i=this._leakageMon)==null||i.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var a,c,f,h,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let x=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new hN(`${m}. HINT: Stack shows most frequent listener (${x[1]}-times)`,x[0]);return(((a=this._options)==null?void 0:a.onListenerError)||wa)(y),Te.None}if(this._disposed)return Te.None;t&&(e=e.bind(t));let i=new ph(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=uN.create(),o=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof ph?(this._deliveryQueue??(this._deliveryQueue=new mN),this._listeners=[this._listeners,i]):this._listeners.push(i):((f=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||f.call(c,this),this._listeners=i,(g=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||g.call(h,this)),this._size++;let l=tt(()=>{o==null||o(),this._removeListener(i)});return r instanceof Zn?r.add(l):Array.isArray(r)&&r.push(l),l}),this._event}_removeListener(e){var o,l,a,c;if((l=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||l.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||c.call(a,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*fN<=t.length){let f=0;for(let h=0;h0}},mN=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Qh=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new oe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new oe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Qh.INSTANCE=new Qh;var rf=Qh;function gN(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}rf.INSTANCE.onDidChangeZoomLevel;function _N(e){return rf.INSTANCE.getZoomFactor(e)}rf.INSTANCE.onDidChangeFullscreen;var ys=typeof navigator=="object"?navigator.userAgent:"",Jh=ys.indexOf("Firefox")>=0,vN=ys.indexOf("AppleWebKit")>=0,nf=ys.indexOf("Chrome")>=0,yN=!nf&&ys.indexOf("Safari")>=0;ys.indexOf("Electron/")>=0;ys.indexOf("Android")>=0;var mh=!1;if(typeof _n.matchMedia=="function"){let e=_n.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=_n.matchMedia("(display-mode: fullscreen)");mh=e.matches,gN(_n,e,({matches:r})=>{mh&&t.matches||(mh=r)})}var us="en",Zh=!1,ed=!1,Sa=!1,Ny=!1,ca,ba=us,__=us,xN,Ir,bi=globalThis,Bt,dv;typeof bi.vscode<"u"&&typeof bi.vscode.process<"u"?Bt=bi.vscode.process:typeof process<"u"&&typeof((dv=process==null?void 0:process.versions)==null?void 0:dv.node)=="string"&&(Bt=process);var fv,wN=typeof((fv=Bt==null?void 0:Bt.versions)==null?void 0:fv.electron)=="string",SN=wN&&(Bt==null?void 0:Bt.type)==="renderer",pv;if(typeof Bt=="object"){Zh=Bt.platform==="win32",ed=Bt.platform==="darwin",Sa=Bt.platform==="linux",Sa&&Bt.env.SNAP&&Bt.env.SNAP_REVISION,Bt.env.CI||Bt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ca=us,ba=us;let e=Bt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ca=t.userLocale,__=t.osLocale,ba=t.resolvedLanguage||us,xN=(pv=t.languagePack)==null?void 0:pv.translationsConfigFile}catch{}Ny=!0}else typeof navigator=="object"&&!SN?(Ir=navigator.userAgent,Zh=Ir.indexOf("Windows")>=0,ed=Ir.indexOf("Macintosh")>=0,(Ir.indexOf("Macintosh")>=0||Ir.indexOf("iPad")>=0||Ir.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Sa=Ir.indexOf("Linux")>=0,(Ir==null?void 0:Ir.indexOf("Mobi"))>=0,ba=globalThis._VSCODE_NLS_LANGUAGE||us,ca=navigator.language.toLowerCase(),__=ca):console.error("Unable to resolve platform.");var Ly=Zh,Qr=ed,bN=Sa,v_=Ny,Zr=Ir,qn=ba,kN;(e=>{function t(){return qn}e.value=t;function r(){return qn.length===2?qn==="en":qn.length>=3?qn[0]==="e"&&qn[1]==="n"&&qn[2]==="-":!1}e.isDefaultVariant=r;function i(){return qn==="en"}e.isDefault=i})(kN||(kN={}));var CN=typeof bi.postMessage=="function"&&!bi.importScripts;(()=>{if(CN){let e=[];bi.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let i=0,o=e.length;i{let i=++t;e.push({id:i,callback:r}),bi.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var EN=!!(Zr&&Zr.indexOf("Chrome")>=0);Zr&&Zr.indexOf("Firefox")>=0;!EN&&Zr&&Zr.indexOf("Safari")>=0;Zr&&Zr.indexOf("Edg/")>=0;Zr&&Zr.indexOf("Android")>=0;var os=typeof navigator=="object"?navigator:{};v_||document.queryCommandSupported&&document.queryCommandSupported("copy")||os&&os.clipboard&&os.clipboard.writeText,v_||os&&os.clipboard&&os.clipboard.readText;var sf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},gh=new sf,y_=new sf,x_=new sf,NN=new Array(230),Py;(e=>{function t(c){return gh.keyCodeToStr(c)}e.toString=t;function r(c){return gh.strToKeyCode(c)}e.fromString=r;function i(c){return y_.keyCodeToStr(c)}e.toUserSettingsUS=i;function o(c){return x_.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function l(c){return y_.strToKeyCode(c)||x_.strToKeyCode(c)}e.fromUserSettings=l;function a(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return gh.keyCodeToStr(c)}e.toElectronAccelerator=a})(Py||(Py={}));var LN=class Ry{constructor(t,r,i,o,l){this.ctrlKey=t,this.shiftKey=r,this.altKey=i,this.metaKey=o,this.keyCode=l}equals(t){return t instanceof Ry&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",i=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${r}${i}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new PN([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},PN=class{constructor(e){if(e.length===0)throw eN("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t{function t(r){return r===e.None||r===e.Cancelled||r instanceof zN?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:It.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:My})})(jN||(jN={}));var zN=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?My:(this._emitter||(this._emitter=new oe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},of=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Kh("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Kh("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},ON=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new Kh("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},t);this.disposable=tt(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},FN;(e=>{async function t(i){let o,l=await Promise.all(i.map(a=>a.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return l}e.settled=t;function r(i){return new Promise(async(o,l)=>{try{await i(o,l)}catch(a){l(a)}})}e.withAsyncBody=r})(FN||(FN={}));var k_=class kr{static fromArray(t){return new kr(r=>{r.emitMany(t)})}static fromPromise(t){return new kr(async r=>{r.emitMany(await t)})}static fromPromises(t){return new kr(async r=>{await Promise.all(t.map(async i=>r.emitOne(await i)))})}static merge(t){return new kr(async r=>{await Promise.all(t.map(async i=>{for await(let o of i)r.emitOne(o)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new oe,queueMicrotask(async()=>{let i={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(i)),this.resolve()}catch(o){this.reject(o)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new kr(async i=>{for await(let o of t)i.emitOne(r(o))})}map(t){return kr.map(this,t)}static filter(t,r){return new kr(async i=>{for await(let o of t)r(o)&&i.emitOne(o)})}filter(t){return kr.filter(this,t)}static coalesce(t){return kr.filter(t,r=>!!r)}coalesce(){return kr.coalesce(this)}static async toPromise(t){let r=[];for await(let i of t)r.push(i);return r}toPromise(){return kr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};k_.EMPTY=k_.fromArray([]);var{getWindow:Gr,getWindowId:HN,onDidRegisterWindow:$N}=(function(){let e=new Map,t={window:_n,disposables:new Zn};e.set(_n.vscodeWindowId,t);let r=new oe,i=new oe,o=new oe;function l(a,c){return(typeof a=="number"?e.get(a):void 0)??(c?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:i.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Te.None;let c=new Zn,f={window:a,disposables:c.add(new Zn)};return e.set(a.vscodeWindowId,f),c.add(tt(()=>{e.delete(a.vscodeWindowId),i.fire(a)})),c.add(Ee(a,Ct.BEFORE_UNLOAD,()=>{o.fire(a)})),r.fire(f),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:l,getWindow(a){var h;let c=a;if((h=c==null?void 0:c.ownerDocument)!=null&&h.defaultView)return c.ownerDocument.defaultView.window;let f=a;return f!=null&&f.view?f.view.window:_n},getDocument(a){return Gr(a).document}}})(),WN=class{constructor(e,t,r,i){this._node=e,this._type=t,this._handler=r,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ee(e,t,r,i){return new WN(e,t,r,i)}var C_=function(e,t,r,i){return Ee(e,t,r,i)},lf,UN=class extends ON{constructor(e){super(),this.defaultTarget=e&&Gr(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},E_=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){wa(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,i=new Map,o=l=>{r.set(l,!1);let a=e.get(l)??[];for(t.set(l,a),e.set(l,[]),i.set(l,!0);a.length>0;)a.sort(E_.sort),a.shift().execute();i.set(l,!1)};lf=(l,a,c=0)=>{let f=HN(l),h=new E_(a,c),g=e.get(f);return g||(g=[],e.set(f,g)),g.push(h),r.get(f)||(r.set(f,!0),l.requestAnimationFrame(()=>o(f))),h}})();function VN(e){let t=e.getBoundingClientRect(),r=Gr(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var Ct={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},KN=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=nr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=nr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=nr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=nr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=nr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=nr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=nr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=nr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=nr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=nr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=nr(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=nr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=nr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=nr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function nr(e){return typeof e=="number"?`${e}px`:e}function Lo(e){return new KN(e)}var Ty=class{constructor(){this._hooks=new Zn,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,i,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=o;let l=e;try{e.setPointerCapture(t),this._hooks.add(tt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=Gr(e)}this._hooks.add(Ee(l,Ct.POINTER_MOVE,a=>{if(a.buttons!==r){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(Ee(l,Ct.POINTER_UP,a=>this.stopMonitoring(!0)))}};function qN(e,t,r){let i=null,o=null;if(typeof r.value=="function"?(i="value",o=r.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(i="get",o=r.get),!o)throw new Error("not supported");let l=`$memoize$${t}`;r[i]=function(...a){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,a)}),this[l]}}var Kr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Kr||(Kr={}));var xo=class Ht extends Te{constructor(){super(),this.dispatched=!1,this.targets=new g_,this.ignoreTargets=new g_,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(It.runAndSubscribe($N,({window:t,disposables:r})=>{r.add(Ee(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),r.add(Ee(t.document,"touchend",i=>this.onTouchEnd(t,i))),r.add(Ee(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:_n,disposables:this._store}))}static addTarget(t){if(!Ht.isTouchDevice())return Te.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let r=Ht.INSTANCE.targets.push(t);return tt(r)}static ignoreTarget(t){if(!Ht.isTouchDevice())return Te.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let r=Ht.INSTANCE.ignoreTargets.push(t);return tt(r)}static isTouchDevice(){return"ontouchstart"in _n||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,o=t.targetTouches.length;i=Ht.HOLD_DELAY&&Math.abs(f.initialPageX-dr(f.rollingPageX))<30&&Math.abs(f.initialPageY-dr(f.rollingPageY))<30){let g=this.newGestureEvent(Kr.Contextmenu,f.initialTarget);g.pageX=dr(f.rollingPageX),g.pageY=dr(f.rollingPageY),this.dispatchEvent(g)}else if(o===1){let g=dr(f.rollingPageX),m=dr(f.rollingPageY),x=dr(f.rollingTimestamps)-f.rollingTimestamps[0],y=g-f.rollingPageX[0],S=m-f.rollingPageY[0],k=[...this.targets].filter(E=>f.initialTarget instanceof Node&&E.contains(f.initialTarget));this.inertia(t,k,i,Math.abs(y)/x,y>0?1:-1,g,Math.abs(S)/x,S>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Kr.End,f.initialTarget)),delete this.activeTouches[c.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=r,i.tapCount=0,i}dispatchEvent(t){if(t.type===Kr.Tap){let r=new Date().getTime(),i=0;r-this._lastSetTapCountTime>Ht.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=r,t.tapCount=i}else(t.type===Kr.Change||t.type===Kr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let r=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let o=0,l=t.initialTarget;for(;l&&l!==i;)o++,l=l.parentElement;r.push([o,i])}r.sort((i,o)=>i[0]-o[0]);for(let[i,o]of r)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,i,o,l,a,c,f,h){this.handle=lf(t,()=>{let g=Date.now(),m=g-i,x=0,y=0,S=!0;o+=Ht.SCROLL_FRICTION*m,c+=Ht.SCROLL_FRICTION*m,o>0&&(S=!1,x=l*o*m),c>0&&(S=!1,y=f*c*m);let k=this.newGestureEvent(Kr.Change);k.translationX=x,k.translationY=y,r.forEach(E=>E.dispatchEvent(k)),S||this.inertia(t,r,g,o,l,a+x,c,f,h+y)})}onTouchMove(t){let r=Date.now();for(let i=0,o=t.changedTouches.length;i3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(l.pageX),a.rollingPageY.push(l.pageY),a.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};xo.SCROLL_FRICTION=-.005,xo.HOLD_DELAY=700,xo.CLEAR_TAP_COUNT_TIME=400,ut([qN],xo,"isTouchDevice",1);var YN=xo,af=class extends Te{onclick(e,t){this._register(Ee(e,Ct.CLICK,r=>t(new ha(Gr(e),r))))}onmousedown(e,t){this._register(Ee(e,Ct.MOUSE_DOWN,r=>t(new ha(Gr(e),r))))}onmouseover(e,t){this._register(Ee(e,Ct.MOUSE_OVER,r=>t(new ha(Gr(e),r))))}onmouseleave(e,t){this._register(Ee(e,Ct.MOUSE_LEAVE,r=>t(new ha(Gr(e),r))))}onkeydown(e,t){this._register(Ee(e,Ct.KEY_DOWN,r=>t(new w_(r))))}onkeyup(e,t){this._register(Ee(e,Ct.KEY_UP,r=>t(new w_(r))))}oninput(e,t){this._register(Ee(e,Ct.INPUT,t))}onblur(e,t){this._register(Ee(e,Ct.BLUR,t))}onfocus(e,t){this._register(Ee(e,Ct.FOCUS,t))}onchange(e,t){this._register(Ee(e,Ct.CHANGE,t))}ignoreGesture(e){return YN.ignoreTarget(e)}},N_=11,XN=class extends af{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=N_+"px",this.domNode.style.height=N_+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Ty),this._register(C_(this.bgDomNode,Ct.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(C_(this.domNode,Ct.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new UN),this._pointerdownScheduleRepeatTimer=this._register(new of)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Gr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},GN=class td{constructor(t,r,i,o,l,a,c){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,i=i|0,o=o|0,l=l|0,a=a|0,c=c|0),this.rawScrollLeft=o,this.rawScrollTop=c,r<0&&(r=0),o+r>i&&(o=i-r),o<0&&(o=0),l<0&&(l=0),c+l>a&&(c=a-l),c<0&&(c=0),this.width=r,this.scrollWidth=i,this.scrollLeft=o,this.height=l,this.scrollHeight=a,this.scrollTop=c}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new td(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new td(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let i=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,c=this.scrollHeight!==t.scrollHeight,f=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:o,scrollLeftChanged:l,heightChanged:a,scrollHeightChanged:c,scrollTopChanged:f}}},QN=class extends Te{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new GN(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(i=this._smoothScrolling)==null||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let i;t?i=new P_(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=P_.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},L_=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function _h(e,t){let r=t-e;return function(i){return e+r*eL(i)}}function JN(e,t,r){return function(i){return i2.5*i){let o,l;return t{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},rL=140,Dy=class extends af{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new tL(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Ty),this._shouldRender=!0,this.domNode=Lo(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ee(this.domNode.domNode,Ct.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new XN(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,i){this.slider=Lo(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ee(this.slider.domNode,Ct.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);r<=o&&o<=i?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let o=VN(this.domNode.domNode);t=e.pageX-o.left,r=e.pageY-o.top}let i=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),i=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let l=this._sliderOrthogonalPointerPosition(o),a=Math.abs(l-r);if(Ly&&a>rL){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Ay=class nd{constructor(t,r,i,o,l,a){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=l,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new nd(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,i,o,l){let a=Math.max(0,i-t),c=Math.max(0,a-2*r),f=o>0&&o>i;if(!f)return{computedAvailableSize:Math.round(a),computedIsNeeded:f,computedSliderSize:Math.round(c),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(i*c/o))),g=(c-h)/(o-i),m=l*g;return{computedAvailableSize:Math.round(a),computedIsNeeded:f,computedSliderSize:Math.round(h),computedSliderRatio:g,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=nd._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,i=this._scrollPosition;return r0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),r){let o=Math.abs(t.deltaX),l=Math.abs(t.deltaY),a=Math.abs(r.deltaX),c=Math.abs(r.deltaY),f=Math.max(Math.min(o,a),1),h=Math.max(Math.min(l,c),1),g=Math.max(o,a),m=Math.max(l,c);g%f===0&&m%h===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};id.INSTANCE=new id;var lL=id,aL=class extends af{constructor(e,t,r){super(),this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new oe),this.onWillScroll=this._onWillScroll.event,this._options=cL(t),this._scrollable=r,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let i={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new iL(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new nL(this._scrollable,this._options,i)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Lo(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Lo(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Lo(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new of),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ei(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Qr&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new b_(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ei(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new b_(r))};this._mouseWheelToDispose.push(Ee(this._listenOnDomNode,Ct.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let t=lL.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+l===0?a=l=0:Math.abs(l)>=Math.abs(a)?a=0:l=0),this._options.flipAxes&&([l,a]=[a,l]);let c=!Qr&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!a&&(a=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let f=this._scrollable.getFutureScrollPosition(),h={};if(l){let g=R_*l,m=f.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(h,m)}if(a){let g=R_*a,m=f.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(h,m)}h=this._scrollable.validateScrollPosition(h),(f.scrollLeft!==h.scrollLeft||f.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),r=!0)}let i=r;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,i=r?" left":"",o=t?" top":"",l=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${i}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),sL)}},uL=class extends aL{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function cL(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Qr&&(t.className+=" mac"),t}var sd=class extends Te{constructor(e,t,r,i,o,l,a,c){super(),this._bufferService=r,this._optionsService=a,this._renderService=c,this._onRequestScrollLines=this._register(new oe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let f=this._register(new QN({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>lf(i.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{f.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new uL(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},f)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(It.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(tt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(tt(()=>this._styleElement.remove())),this._register(It.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` +`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};sd=ut([ue(2,Xt),ue(3,xn),ue(4,py),ue(5,vs),ue(6,Gt),ue(7,wn)],sd);var od=class extends Te{constructor(e,t,r,i,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=i,this._renderService=o,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(l=>this._removeDecoration(l))),this._register(tt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var i;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)==null?void 0:i.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};od=ut([ue(1,Xt),ue(2,xn),ue(3,Wo),ue(4,wn)],od);var hL=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Ur={full:0,left:0,center:0,right:0},Yn={full:0,left:0,center:0,right:0},po={full:0,left:0,center:0,right:0},Ia=class extends Te{constructor(e,t,r,i,o,l,a,c){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=i,this._renderService=o,this._optionsService=l,this._themeService=a,this._coreBrowserService=c,this._colorZoneStore=new hL,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(tt(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let f=this._canvas.getContext("2d");if(f)this._ctx=f;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Yn.full=this._canvas.width,Yn.left=e,Yn.center=t,Yn.right=e,this._refreshDrawHeightConstants(),po.full=1,po.left=1,po.center=1+Yn.left,po.right=1+Yn.left+Yn.center}_refreshDrawHeightConstants(){Ur.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ur.left=t,Ur.center=t,Ur.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ur.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(po[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ur[e.position||"full"]/2),Yn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ur[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ia=ut([ue(2,Xt),ue(3,Wo),ue(4,wn),ue(5,Gt),ue(6,vs),ue(7,xn)],Ia);var G;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=` +`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(G||(G={}));var ka;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(ka||(ka={}));var By;(e=>e.ST=`${G.ESC}\\`)(By||(By={}));var ld=class{constructor(e,t,r,i,o,l){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._coreService=o,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.lengththis.updateCompositionElements(!0),0)}}};ld=ut([ue(2,Xt),ue(3,Gt),ue(4,Ri),ue(5,wn)],ld);var Et=0,Nt=0,Lt=0,lt=0,M_={css:"#00000000",rgba:0},gt;(e=>{function t(o,l,a,c){return c!==void 0?`#${_i(o)}${_i(l)}${_i(a)}${_i(c)}`:`#${_i(o)}${_i(l)}${_i(a)}`}e.toCss=t;function r(o,l,a,c=255){return(o<<24|l<<16|a<<8|c)>>>0}e.toRgba=r;function i(o,l,a,c){return{css:e.toCss(o,l,a,c),rgba:e.toRgba(o,l,a,c)}}e.toColor=i})(gt||(gt={}));var Ze;(e=>{function t(f,h){if(lt=(h.rgba&255)/255,lt===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,m=h.rgba>>16&255,x=h.rgba>>8&255,y=f.rgba>>24&255,S=f.rgba>>16&255,k=f.rgba>>8&255;Et=y+Math.round((g-y)*lt),Nt=S+Math.round((m-S)*lt),Lt=k+Math.round((x-k)*lt);let E=gt.toCss(Et,Nt,Lt),L=gt.toRgba(Et,Nt,Lt);return{css:E,rgba:L}}e.blend=t;function r(f){return(f.rgba&255)===255}e.isOpaque=r;function i(f,h,g){let m=Ca.ensureContrastRatio(f.rgba,h.rgba,g);if(m)return gt.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=i;function o(f){let h=(f.rgba|255)>>>0;return[Et,Nt,Lt]=Ca.toChannels(h),{css:gt.toCss(Et,Nt,Lt),rgba:h}}e.opaque=o;function l(f,h){return lt=Math.round(h*255),[Et,Nt,Lt]=Ca.toChannels(f.rgba),{css:gt.toCss(Et,Nt,Lt,lt),rgba:gt.toRgba(Et,Nt,Lt,lt)}}e.opacity=l;function a(f,h){return lt=f.rgba&255,l(f,lt*h/255)}e.multiplyOpacity=a;function c(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}e.toColorRGB=c})(Ze||(Ze={}));var st;(e=>{let t,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function i(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return Et=parseInt(o.slice(1,2).repeat(2),16),Nt=parseInt(o.slice(2,3).repeat(2),16),Lt=parseInt(o.slice(3,4).repeat(2),16),gt.toColor(Et,Nt,Lt);case 5:return Et=parseInt(o.slice(1,2).repeat(2),16),Nt=parseInt(o.slice(2,3).repeat(2),16),Lt=parseInt(o.slice(3,4).repeat(2),16),lt=parseInt(o.slice(4,5).repeat(2),16),gt.toColor(Et,Nt,Lt,lt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let l=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return Et=parseInt(l[1]),Nt=parseInt(l[2]),Lt=parseInt(l[3]),lt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),gt.toColor(Et,Nt,Lt,lt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Et,Nt,Lt,lt]=t.getImageData(0,0,1,1).data,lt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gt.toRgba(Et,Nt,Lt,lt),css:o}}e.toColor=i})(st||(st={}));var qt;(e=>{function t(i){return r(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function r(i,o,l){let a=i/255,c=o/255,f=l/255,h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),g=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),m=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return h*.2126+g*.7152+m*.0722}e.relativeLuminance2=r})(qt||(qt={}));var Ca;(e=>{function t(a,c){if(lt=(c&255)/255,lt===1)return c;let f=c>>24&255,h=c>>16&255,g=c>>8&255,m=a>>24&255,x=a>>16&255,y=a>>8&255;return Et=m+Math.round((f-m)*lt),Nt=x+Math.round((h-x)*lt),Lt=y+Math.round((g-y)*lt),gt.toRgba(Et,Nt,Lt)}e.blend=t;function r(a,c,f){let h=qt.relativeLuminance(a>>8),g=qt.relativeLuminance(c>>8);if(pn(h,g)>8));if(S>8));return S>E?y:k}return y}let m=o(a,c,f),x=pn(h,qt.relativeLuminance(m>>8));if(x>8));return x>S?m:y}return m}}e.ensureContrastRatio=r;function i(a,c,f){let h=a>>24&255,g=a>>16&255,m=a>>8&255,x=c>>24&255,y=c>>16&255,S=c>>8&255,k=pn(qt.relativeLuminance2(x,y,S),qt.relativeLuminance2(h,g,m));for(;k0||y>0||S>0);)x-=Math.max(0,Math.ceil(x*.1)),y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),k=pn(qt.relativeLuminance2(x,y,S),qt.relativeLuminance2(h,g,m));return(x<<24|y<<16|S<<8|255)>>>0}e.reduceLuminance=i;function o(a,c,f){let h=a>>24&255,g=a>>16&255,m=a>>8&255,x=c>>24&255,y=c>>16&255,S=c>>8&255,k=pn(qt.relativeLuminance2(x,y,S),qt.relativeLuminance2(h,g,m));for(;k>>0}e.increaseLuminance=o;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(Ca||(Ca={}));function _i(e){let t=e.toString(16);return t.length<2?"0"+t:t}function pn(e,t){return e1){let g=this._getJoinedRanges(i,a,l,t,o);for(let m=0;m1){let h=this._getJoinedRanges(i,a,l,t,o);for(let g=0;g=F,re=D,I=this._workCell;if(x.length>0&&D===x[0][0]&&Q){let ze=x.shift(),tn=this._isCellInSelection(ze[0],t);for(W=ze[0]+1;W=ze[1]),Q?(j=!0,I=new dL(this._workCell,e.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),re=ze[1]-1,H=I.getWidth()):F=ze[1]}let q=this._isCellInSelection(D,t),b=r&&D===l,P=A&&D>=h&&D<=g,V=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,ze=>{V=!0});let C=I.getChars()||Qn;if(C===" "&&(I.isUnderline()||I.isOverline())&&(C=" "),fe=H*c-f.get(C,I.isBold(),I.isItalic()),!k)k=this._document.createElement("span");else if(E&&(q&&he||!q&&!he&&I.bg===z)&&(q&&he&&y.selectionForeground||I.fg===Y)&&I.extended.ext===U&&P===T&&fe===se&&!b&&!j&&!V&&Q){I.isInvisible()?L+=Qn:L+=C,E++;continue}else E&&(k.textContent=L),k=this._document.createElement("span"),E=0,L="";if(z=I.bg,Y=I.fg,U=I.extended.ext,T=P,se=fe,he=q,j&&l>=D&&l<=re&&(l=D),!this._coreService.isCursorHidden&&b&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&K.push("xterm-cursor-blink"),K.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline");break}}if(I.isBold()&&K.push("xterm-bold"),I.isItalic()&&K.push("xterm-italic"),I.isDim()&&K.push("xterm-dim"),I.isInvisible()?L=Qn:L=I.getChars()||Qn,I.isUnderline()&&(K.push(`xterm-underline-${I.extended.underlineStyle}`),L===" "&&(L=" "),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())k.style.textDecorationColor=`rgb(${$o.toColorRGB(I.getUnderlineColor()).join(",")})`;else{let ze=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&ze<8&&(ze+=8),k.style.textDecorationColor=y.ansi[ze].css}I.isOverline()&&(K.push("xterm-overline"),L===" "&&(L=" ")),I.isStrikethrough()&&K.push("xterm-strikethrough"),P&&(k.style.textDecoration="underline");let ae=I.getFgColor(),ve=I.getFgColorMode(),pe=I.getBgColor(),Pe=I.getBgColorMode(),ye=!!I.isInverse();if(ye){let ze=ae;ae=pe,pe=ze;let tn=ve;ve=Pe,Pe=tn}let xe,Fe,Ye=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,ze=>{ze.options.layer!=="top"&&Ye||(ze.backgroundColorRGB&&(Pe=50331648,pe=ze.backgroundColorRGB.rgba>>8&16777215,xe=ze.backgroundColorRGB),ze.foregroundColorRGB&&(ve=50331648,ae=ze.foregroundColorRGB.rgba>>8&16777215,Fe=ze.foregroundColorRGB),Ye=ze.options.layer==="top")}),!Ye&&q&&(xe=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,pe=xe.rgba>>8&16777215,Pe=50331648,Ye=!0,y.selectionForeground&&(ve=50331648,ae=y.selectionForeground.rgba>>8&16777215,Fe=y.selectionForeground)),Ye&&K.push("xterm-decoration-top");let or;switch(Pe){case 16777216:case 33554432:or=y.ansi[pe],K.push(`xterm-bg-${pe}`);break;case 50331648:or=gt.toColor(pe>>16,pe>>8&255,pe&255),this._addStyle(k,`background-color:#${T_((pe>>>0).toString(16),"0",6)}`);break;case 0:default:ye?(or=y.foreground,K.push("xterm-bg-257")):or=y.background}switch(xe||I.isDim()&&(xe=Ze.multiplyOpacity(or,.5)),ve){case 16777216:case 33554432:I.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(k,or,y.ansi[ae],I,xe,void 0)||K.push(`xterm-fg-${ae}`);break;case 50331648:let ze=gt.toColor(ae>>16&255,ae>>8&255,ae&255);this._applyMinimumContrast(k,or,ze,I,xe,Fe)||this._addStyle(k,`color:#${T_(ae.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(k,or,y.foreground,I,xe,Fe)||ye&&K.push("xterm-fg-257")}K.length&&(k.className=K.join(" "),K.length=0),!b&&!j&&!V&&Q?E++:k.textContent=L,fe!==this.defaultSpacing&&(k.style.letterSpacing=`${fe}px`),m.push(k),D=re}return k&&E&&(k.textContent=L),m}_applyMinimumContrast(e,t,r,i,o,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||mL(i.getCode()))return!1;let a=this._getContrastCache(i),c;if(!o&&!l&&(c=a.getColor(t.rgba,r.rgba)),c===void 0){let f=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);c=Ze.ensureContrastRatio(o||t,l||r,f),a.setColor((o||t).rgba,(l||r).rgba,c??null)}return c?(this._addStyle(e,`color:${c.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,i=this._selectionEnd;return!r||!i?!1:this._columnSelectMode?r[0]<=i[0]?e>=r[0]&&t>=r[1]&&e=r[1]&&e>=i[0]&&t<=i[1]:t>r[1]&&t=r[0]&&e=r[0]}};ad=ut([ue(1,_y),ue(2,Gt),ue(3,xn),ue(4,Ri),ue(5,Wo),ue(6,vs)],ad);function T_(e,t,r){for(;e.length0&&(this._flat[i]=a),a}let o=e;t&&(o+="B"),r&&(o+="I");let l=this._holey.get(o);if(l===void 0){let a=0;t&&(a|=1),r&&(a|=2),l=this._measure(e,a),l>0&&this._holey.set(o,l)}return l}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},vL=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,r,i=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,l=t[1]-o,a=r[1]-o,c=Math.max(l,0),f=Math.min(a,e.rows-1);if(c>=e.rows||f<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=i,this.viewportStartRow=l,this.viewportEndRow=a,this.viewportCappedStartRow=c,this.viewportCappedEndRow=f,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r=this.startCol&&t=this.startCol):!1}};function yL(){return new vL}var vh="xterm-dom-renderer-owner-",br="xterm-rows",fa="xterm-fg-",D_="xterm-bg-",mo="xterm-focus",pa="xterm-selection",xL=1,ud=class extends Te{constructor(e,t,r,i,o,l,a,c,f,h,g,m,x,y){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=i,this._viewportElement=o,this._helperContainer=l,this._linkifier2=a,this._charSizeService=f,this._optionsService=h,this._bufferService=g,this._coreService=m,this._coreBrowserService=x,this._themeService=y,this._terminalClass=xL++,this._rowElements=[],this._selectionRenderModel=yL(),this.onRequestRedraw=this._register(new oe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(br),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(pa),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=gL(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=c.createInstance(ad,document),this._element.classList.add(vh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(tt(()=>{this._element.classList.remove(vh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _L(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${br} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${br} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${br} .xterm-dim { color: ${Ze.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,i=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${br}.${mo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${br}.${mo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${br}.${mo} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${br} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${pa} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${pa} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${pa} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,a]of e.ansi.entries())t+=`${this._terminalSelector} .${fa}${l} { color: ${a.css}; }${this._terminalSelector} .${fa}${l}.xterm-dim { color: ${Ze.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${D_}${l} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${fa}257 { color: ${Ze.opaque(e.background).css}; }${this._terminalSelector} .${fa}257.xterm-dim { color: ${Ze.multiplyOpacity(Ze.opaque(e.background),.5).css}; }${this._terminalSelector} .${D_}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let r=this._rowElements.length;r<=t;r++){let i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(mo),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(mo),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let i=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(r){let f=e[0]>t[0];c.appendChild(this._createSelectionElement(l,f?t[0]:e[0],f?e[0]:t[0],a-l+1))}else{let f=i===l?e[0]:0,h=l===o?t[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,f,h));let g=a-l-1;if(c.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,g)),l!==a){let m=o===a?t[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(a,0,m))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,t,r,i=1){let o=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(r-t);return l+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l),o.style.height=`${i*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${l}px`,o.style.width=`${a}px`,o}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let r=this._bufferService.buffer,i=r.ybase+r.y,o=Math.min(r.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=e;f<=t;f++){let h=f+r.ydisp,g=this._rowElements[f],m=r.lines.get(h);if(!g||!m)break;g.replaceChildren(...this._rowFactory.createRow(m,h,h===i,a,c,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${vh}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,r,i,o,l){r<0&&(e=0),i<0&&(t=0);let a=this._bufferService.rows-1;r=Math.max(Math.min(r,a),0),i=Math.max(Math.min(i,a),0),o=Math.min(o,this._bufferService.cols);let c=this._bufferService.buffer,f=c.ybase+c.y,h=Math.min(c.x,o-1),g=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=r;y<=i;++y){let S=y+c.ydisp,k=this._rowElements[y],E=c.lines.get(S);if(!k||!E)break;k.replaceChildren(...this._rowFactory.createRow(E,S,S===f,m,x,h,g,this.dimensions.css.cell.width,this._widthCache,l?y===r?e:0:-1,l?(y===i?t:o)-1:-1))}}};ud=ut([ue(7,ef),ue(8,Ja),ue(9,Gt),ue(10,Xt),ue(11,Ri),ue(12,xn),ue(13,vs)],ud);var cd=class extends Te{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new oe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new SL(this._optionsService))}catch{this._measureStrategy=this._register(new wL(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};cd=ut([ue(2,Gt)],cd);var Iy=class extends Te{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},wL=class extends Iy{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},SL=class extends Iy{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},bL=class extends Te{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new kL(this._window)),this._onDprChange=this._register(new oe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new oe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(It.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ee(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ee(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},kL=class extends Te{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ps),this._onDprChange=this._register(new oe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(tt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ee(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},CL=class extends Te{constructor(){super(),this.linkProviders=[],this._register(tt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function uf(e,t,r){let i=r.getBoundingClientRect(),o=e.getComputedStyle(r),l=parseInt(o.getPropertyValue("padding-left")),a=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-i.left-l,t.clientY-i.top-a]}function EL(e,t,r,i,o,l,a,c,f){if(!l)return;let h=uf(e,t,r);if(h)return h[0]=Math.ceil((h[0]+(f?a/2:0))/a),h[1]=Math.ceil(h[1]/c),h[0]=Math.min(Math.max(h[0],1),i+(f?1:0)),h[1]=Math.min(Math.max(h[1],1),o),h}var hd=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,i,o){return EL(window,e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let r=uf(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};hd=ut([ue(0,wn),ue(1,Ja)],hd);var NL=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},jy={};j4(jy,{getSafariVersion:()=>PL,isChromeOS:()=>Hy,isFirefox:()=>zy,isIpad:()=>RL,isIphone:()=>ML,isLegacyEdge:()=>LL,isLinux:()=>cf,isMac:()=>za,isNode:()=>Za,isSafari:()=>Oy,isWindows:()=>Fy});var Za=typeof process<"u"&&"title"in process,Uo=Za?"node":navigator.userAgent,Vo=Za?"node":navigator.platform,zy=Uo.includes("Firefox"),LL=Uo.includes("Edge"),Oy=/^((?!chrome|android).)*safari/i.test(Uo);function PL(){if(!Oy)return 0;let e=Uo.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var za=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Vo),RL=Vo==="iPad",ML=Vo==="iPhone",Fy=["Windows","Win16","Win32","WinCE"].includes(Vo),cf=Vo.indexOf("Linux")>=0,Hy=/\bCrOS\b/.test(Uo),$y=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._io){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=o}this.clear()}},TL=class extends $y{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},DL=class extends $y{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Oa=!Za&&"requestIdleCallback"in window?DL:TL,AL=class{constructor(){this._queue=new Oa}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},dd=class extends Te{constructor(e,t,r,i,o,l,a,c,f){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=i,this._coreService=o,this._coreBrowserService=c,this._renderer=this._register(new ps),this._pausedResizeTask=new AL,this._observerDisposable=this._register(new ps),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new oe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new oe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new oe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new oe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new NL((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new BL(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(tt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(f.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=tt(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,r){var i;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(i=this._renderer.value)==null||i.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};dd=ut([ue(2,Gt),ue(3,Ja),ue(4,Ri),ue(5,Wo),ue(6,Xt),ue(7,xn),ue(8,vs)],dd);var BL=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function IL(e,t,r,i){let o=r.buffer.x,l=r.buffer.y;if(!r.buffer.hasScrollback)return OL(o,l,e,t,r,i)+eu(l,t,r,i)+FL(o,l,e,t,r,i);let a;if(l===t)return a=o>e?"D":"C",Bo(Math.abs(o-e),Ao(a,i));a=l>t?"D":"C";let c=Math.abs(l-t),f=zL(l>t?e:o,r)+(c-1)*r.cols+1+jL(l>t?o:e);return Bo(f,Ao(a,i))}function jL(e,t){return e-1}function zL(e,t){return t.cols-e}function OL(e,t,r,i,o,l){return eu(t,i,o,l).length===0?"":Bo(Uy(e,t,e,t-Ni(t,o),!1,o).length,Ao("D",l))}function eu(e,t,r,i){let o=e-Ni(e,r),l=t-Ni(t,r),a=Math.abs(o-l)-HL(e,t,r);return Bo(a,Ao(Wy(e,t),i))}function FL(e,t,r,i,o,l){let a;eu(t,i,o,l).length>0?a=i-Ni(i,o):a=t;let c=i,f=$L(e,t,r,i,o,l);return Bo(Uy(e,a,r,c,f==="C",o).length,Ao(f,l))}function HL(e,t,r){var a;let i=0,o=e-Ni(e,r),l=t-Ni(t,r);for(let c=0;c=0&&e0?a=i-Ni(i,o):a=t,e=r&&at?"A":"B"}function Uy(e,t,r,i,o,l){let a=e,c=t,f="";for(;(a!==r||c!==i)&&c>=0&&cl.cols-1?(f+=l.buffer.translateBufferLineToString(c,!1,e,a),a=0,e=0,c++):!o&&a<0&&(f+=l.buffer.translateBufferLineToString(c,!1,0,e+1),a=l.cols-1,e=a,c--);return f+l.buffer.translateBufferLineToString(c,!1,e,a)}function Ao(e,t){let r=t?"O":"[";return G.ESC+r+e}function Bo(e,t){e=Math.floor(e);let r="";for(let i=0;ithis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function A_(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var yh=50,UL=15,VL=50,KL=500,qL=" ",YL=new RegExp(qL,"g"),fd=class extends Te{constructor(e,t,r,i,o,l,a,c,f){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=i,this._coreService=o,this._mouseService=l,this._optionsService=a,this._renderService=c,this._coreBrowserService=f,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Lr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new oe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new oe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new oe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new oe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new WL(this._bufferService),this._activeSelectionMode=0,this._register(tt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,i=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]o.replace(YL," ")).join(Fy?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),cf&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i||!t?!1:this._areCoordsInSelection(t,r,i)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i?!1:this._areCoordsInSelection([e,t],r,i)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){var o,l;let r=(l=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:l.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=D_(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=uf(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-yh),yh),t/=yh,t/Math.abs(t)+Math.round(t*(OL-1)))}shouldForceSelection(e){return za?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),FL)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(za&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&tthis._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let i=0;t>=i;i++){let o=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:o>1&&t!==i&&(r+=o-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,i=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,l=o.lines.get(e[1]);if(!l)return;let a=o.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(l,e[0]),f=c,h=e[0]-c,g=0,m=0,x=0,y=0;if(a.charAt(c)===" "){for(;c>0&&a.charAt(c-1)===" ";)c--;for(;f1&&(y+=W-1,f+=W-1);E>0&&c>0&&!this._isCharWordSeparator(l.loadCell(E-1,this._workCell));){l.loadCell(E-1,this._workCell);let z=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,E--):z>1&&(x+=z-1,c-=z-1),c--,E--}for(;L1&&(y+=z-1,f+=z-1),f++,L++}}f++;let S=c+h-g+x,k=Math.min(this._bufferService.cols,f-c+g+m-x-y);if(!(!t&&a.slice(c,f).trim()==="")){if(r&&S===0&&l.getCodePoint(0)!==32){let E=o.lines.get(e[1]-1);if(E&&l.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let L=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(L){let W=this._bufferService.cols-L.start;S-=W,k+=W}}}if(i&&S+k===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let E=o.lines.get(e[1]+1);if(E!=null&&E.isWrapped&&E.getCodePoint(0)!==32){let L=this._getWordAt([0,e[1]+1],!1,!1,!0);L&&(k+=L.length)}}return{start:S,length:k}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=D_(r,this._bufferService.cols)}};fd=ut([ue(3,Xt),ue(4,Ri),ue(5,tf),ue(6,Gt),ue(7,yn),ue(8,vn)],fd);var T_=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},A_=class{constructor(){this._color=new T_,this._css=new T_}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},yt=Object.freeze((()=>{let e=[st.toColor("#2e3436"),st.toColor("#cc0000"),st.toColor("#4e9a06"),st.toColor("#c4a000"),st.toColor("#3465a4"),st.toColor("#75507b"),st.toColor("#06989a"),st.toColor("#d3d7cf"),st.toColor("#555753"),st.toColor("#ef2929"),st.toColor("#8ae234"),st.toColor("#fce94f"),st.toColor("#729fcf"),st.toColor("#ad7fa8"),st.toColor("#34e2e2"),st.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let i=t[r/36%6|0],o=t[r/6%6|0],l=t[r%6];e.push({css:gt.toCss(i,o,l),rgba:gt.toRgba(i,o,l)})}for(let r=0;r<24;r++){let i=8+r*10;e.push({css:gt.toCss(i,i,i),rgba:gt.toRgba(i,i,i)})}return e})()),_i=st.toColor("#ffffff"),wo=st.toColor("#000000"),B_=st.toColor("#ffffff"),I_=wo,go={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},UL=_i,pd=class extends De{constructor(e){super(),this._optionsService=e,this._contrastCache=new A_,this._halfContrastCache=new A_,this._onChangeColors=this._register(new se),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_i,background:wo,cursor:B_,cursorAccent:I_,selectionForeground:void 0,selectionBackgroundTransparent:go,selectionBackgroundOpaque:Ze.blend(wo,go),selectionInactiveBackgroundTransparent:go,selectionInactiveBackgroundOpaque:Ze.blend(wo,go),scrollbarSliderBackground:Ze.opacity(_i,.2),scrollbarSliderHoverBackground:Ze.opacity(_i,.4),scrollbarSliderActiveBackground:Ze.opacity(_i,.5),overviewRulerBorder:_i,ansi:yt.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=Ve(e.foreground,_i),t.background=Ve(e.background,wo),t.cursor=Ze.blend(t.background,Ve(e.cursor,B_)),t.cursorAccent=Ze.blend(t.background,Ve(e.cursorAccent,I_)),t.selectionBackgroundTransparent=Ve(e.selectionBackground,go),t.selectionBackgroundOpaque=Ze.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ve(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ze.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ve(e.selectionForeground,P_):void 0,t.selectionForeground===P_&&(t.selectionForeground=void 0),Ze.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ze.opacity(t.selectionBackgroundTransparent,.3)),Ze.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ze.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ve(e.scrollbarSliderBackground,Ze.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ve(e.scrollbarSliderHoverBackground,Ze.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ve(e.scrollbarSliderActiveBackground,Ze.opacity(t.foreground,.5)),t.overviewRulerBorder=Ve(e.overviewRulerBorder,UL),t.ansi=yt.slice(),t.ansi[0]=Ve(e.black,yt[0]),t.ansi[1]=Ve(e.red,yt[1]),t.ansi[2]=Ve(e.green,yt[2]),t.ansi[3]=Ve(e.yellow,yt[3]),t.ansi[4]=Ve(e.blue,yt[4]),t.ansi[5]=Ve(e.magenta,yt[5]),t.ansi[6]=Ve(e.cyan,yt[6]),t.ansi[7]=Ve(e.white,yt[7]),t.ansi[8]=Ve(e.brightBlack,yt[8]),t.ansi[9]=Ve(e.brightRed,yt[9]),t.ansi[10]=Ve(e.brightGreen,yt[10]),t.ansi[11]=Ve(e.brightYellow,yt[11]),t.ansi[12]=Ve(e.brightBlue,yt[12]),t.ansi[13]=Ve(e.brightMagenta,yt[13]),t.ansi[14]=Ve(e.brightCyan,yt[14]),t.ansi[15]=Ve(e.brightWhite,yt[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;il.index-a.index),i=[];for(let l of r){let a=this._services.get(l.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);i.push(a)}let o=r.length>0?r[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...i)}},qL={trace:0,debug:1,info:2,warn:3,error:4,off:5},YL="xterm.js: ",md=class extends De{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=qL[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis._length)for(let t=this._length;t=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;ithis._maxLength){let i=this._length+r.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let o=t-1;o>=0;o--)this.set(e+o+r,this.get(e+o));let i=e+t+r-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,r){this._data[t*Me+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Me+0]=t|2097152|r[2]<<22):this._data[t*Me+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Me+0]>>22}hasWidth(t){return this._data[t*Me+0]&12582912}getFg(t){return this._data[t*Me+1]}getBg(t){return this._data[t*Me+2]}hasContent(t){return this._data[t*Me+0]&4194303}getCodePoint(t){let r=this._data[t*Me+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Me+0]&2097152}getString(t){let r=this._data[t*Me+0];return r&2097152?this._combined[t]:r&2097151?Yn(r&2097151):""}isProtected(t){return this._data[t*Me+2]&536870912}loadCell(t,r){return ma=t*Me,r.content=this._data[ma+0],r.fg=this._data[ma+1],r.bg=this._data[ma+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Me+0]=r.content,this._data[t*Me+1]=r.fg,this._data[t*Me+2]=r.bg}setCellFromCodepoint(t,r,i,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Me+0]=r|i<<22,this._data[t*Me+1]=o.fg,this._data[t*Me+2]=o.bg}addCodepointToCell(t,r,i){let o=this._data[t*Me+0];o&2097152?this._combined[t]+=Yn(r):o&2097151?(this._combined[t]=Yn(o&2097151)+Yn(r),o&=-2097152,o|=2097152):o=r|1<<22,i&&(o&=-12582913,o|=i<<22),this._data[t*Me+0]=o}insertCells(t,r,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),r=0;--l)this.setCell(t+r+l,this.loadCell(t+l,o));for(let l=0;lthis.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let o=new Uint32Array(i);o.set(this._data),this._data=o}for(let o=this.length;o=t&&delete this._combined[c]}let l=Object.keys(this._extendedAttrs);for(let a=0;a=t&&delete this._extendedAttrs[c]}}return this.length=t,i*4*xh=0;--t)if(this._data[t*Me+0]&4194303)return t+(this._data[t*Me+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Me+0]&4194303||this._data[t*Me+2]&50331648)return t+(this._data[t*Me+0]>>22);return 0}copyCellsFrom(t,r,i,o,l){let a=t._data;if(l)for(let f=o-1;f>=0;f--){for(let h=0;h=r&&(this._combined[h-r+i]=t._combined[h])}}translateToString(t,r,i,o){r=r??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),o&&(o.length=0);let l="";for(;r>22||1}return o&&o.push(r),l}};function XL(e,t,r,i,o,l){let a=[];for(let c=0;c=c&&i0&&(E>m||g[E].getTrimmedLength()===0);E--)k++;k>0&&(a.push(c+g.length-k),a.push(k)),c+=g.length-1}return a}function GL(e,t){let r=[],i=0,o=t[i],l=0;for(let a=0;aIo(e,h,t)).reduce((f,h)=>f+h),l=0,a=0,c=0;for(;cf&&(l-=f,a++);let h=e[a].getWidth(l-1)===2;h&&l--;let g=h?r-1:r;i.push(g),c+=g}return i}function Io(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,o=e[t+1].getWidth(0)===2;return i&&o?r-1:r}var $y=class Wy{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Wy._nextId++,this._onDispose=this.register(new se),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ei(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};$y._nextId=1;var ZL=$y,wt={},vi=wt.B;wt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};wt.A={"#":"£"};wt.B=void 0;wt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};wt.C=wt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};wt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};wt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};wt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};wt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};wt.E=wt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};wt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};wt.H=wt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};wt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var z_=4294967295,O_=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=mt.clone(),this.savedCharset=vi,this.markers=[],this._nullCell=Lr.fromCharData([0,oy,1,0]),this._whitespaceCell=Lr.fromCharData([0,Xn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Oa,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new j_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ba),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ba),this._whitespaceCell}getBlankLine(e,t){return new So(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&ez_?z_:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=mt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new j_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(mt),i=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new So(e,r)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let l=0;l.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,i=XL(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(mt),r);if(i.length>0){let o=GL(this.lines,i);QL(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let i=this.getNullCell(mt),o=r;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let f=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),f.unshift(c);if(!r){let z=this.ybase+this.y;if(z>=a&&z0&&(o.push({start:a+f.length+l,newLines:y}),l+=y.length),f.push(...y);let S=g.length-1,k=g[S];k===0&&(S--,k=g[S]);let E=f.length-m-1,L=h;for(;E>=0;){let z=Math.min(L,k);if(f[S]===void 0)break;if(f[S].copyCellsFrom(f[E],L-z,k-z,z,!0),k-=z,k===0&&(S--,k=g[S]),L-=z,L===0){E--;let q=Math.max(E,0);L=Io(f,q,this._cols)}}for(let z=0;z0;)this.ybase===0?this.y0){let a=[],c=[];for(let k=0;k=0;k--)if(m&&m.start>h+x){for(let E=m.newLines.length-1;E>=0;E--)this.lines.set(k--,m.newLines[E]);k++,a.push({index:h+1,amount:m.newLines.length}),x+=m.newLines.length,m=o[++g]}else this.lines.set(k,c[h--]);let y=0;for(let k=a.length-1;k>=0;k--)a[k].index+=y,this.lines.onInsertEmitter.fire(a[k]),y+=a[k].amount;let S=Math.max(0,f+l-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,r=0,i){let o=this.lines.get(e);return o?o.translateToString(t,r,i):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.liner.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},eP=class extends De{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new se),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new O_(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new O_(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Uy=2,Vy=1,gd=class extends De{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new se),this.onResize=this._onResize.event,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Uy),this.rows=Math.max(e.rawOptions.rows||0,Vy),this.buffers=this._register(new eP(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=r.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;let o=r.ybase+r.scrollTop,l=r.ybase+r.scrollBottom;if(r.scrollTop===0){let a=r.lines.isFull;l===r.lines.length-1?a?r.lines.recycle().copyFrom(i):r.lines.push(i.clone()):r.lines.splice(l+1,0,i.clone()),a?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let a=l-o+1;r.lines.shiftElements(o+1,a-1,-1),r.lines.set(l,i.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};gd=ut([ue(0,Gt)],gd);var ls={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:za,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},tP=["normal","bold","100","200","300","400","500","600","700","800","900"],rP=class extends De{constructor(e){super(),this._onOptionChange=this._register(new se),this.onOptionChange=this._onOptionChange.event;let t={...ls};for(let r in e)if(r in t)try{let i=e[r];t[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(tt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in ls))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,i)=>{if(!(r in ls))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let i={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ls[e]),!nP(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ls[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=tP.includes(t)?t:ls[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function nP(e){return e==="block"||e==="underline"||e==="bar"}function bo(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let i in e)r[i]=t<=1?e[i]:e[i]&&bo(e[i],t-1);return r}var F_=Object.freeze({insertMode:!1}),H_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),_d=class extends De{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new se),this.onData=this._onData.event,this._onUserInput=this._register(new se),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new se),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new se),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=bo(F_),this.decPrivateModes=bo(H_)}reset(){this.modes=bo(F_),this.decPrivateModes=bo(H_)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};_d=ut([ue(0,Xt),ue(1,hy),ue(2,Gt)],_d);var $_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function wh(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Sh=String.fromCharCode,W_={DEFAULT:e=>{let t=[wh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Sh(t[0])}${Sh(t[1])}${Sh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wh(e,!0)};${e.x};${e.y}${t}`}},vd=class extends De{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new se),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys($_))this.addProtocol(i,$_[i]);for(let i of Object.keys(W_))this.addEncoding(i,W_[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let i=t/r,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=i+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};vd=ut([ue(0,Xt),ue(1,Ri),ue(2,Gt)],vd);var bh=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],iP=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],xt;function sP(e,t){let r=0,i=t.length-1,o;if(et[i][1])return!1;for(;i>=r;)if(o=r+i>>1,e>t[o][1])r=o+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),i=r===0&&t!==0;if(i){let o=xi.extractWidth(t);o===0?i=!1:o>r&&(r=o)}return xi.createPropertyValue(0,r,i)}},xi=class Ea{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new se,this.onChange=this._onChange.event;let t=new oP;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,i=!1){return(t&16777215)<<3|(r&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,i=0,o=t.length;for(let l=0;l=o)return r+this.wcwidth(a);let h=t.charCodeAt(l);56320<=h&&h<=57343?a=(a-55296)*1024+h-56320+65536:r+=this.wcwidth(h)}let c=this.charProperties(a,i),f=Ea.extractWidth(c);Ea.extractShouldJoin(c)&&(f-=Ea.extractWidth(i)),r+=f,i=c}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},lP=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function U_(e){var i;let t=(i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:i.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var _o=2147483647,aP=256,Ky=class yd{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>aP)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new yd;if(!t.length)return r;for(let i=Array.isArray(t[0])?1:0;i>8,o=this._subParamsIdx[r]&255;o-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,o))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>_o?_o:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>_o?_o:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-r>0?this._subParams.subarray(r,i):null}getSubParamsAll(){let t={};for(let r=0;r>8,o=this._subParamsIdx[r]&255;o-i>0&&(t[r]=this._subParams.slice(i,o))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,o=i[r-1];i[r-1]=~o?Math.min(o*10+t,_o):t}},vo=[],uP=class{constructor(){this._state=0,this._active=vo,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=vo}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=vo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||vo,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",Qa(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t0&&this._put(e,t,r)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let r=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;i>=0&&(r=this._active[i].end(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=vo,this._id=-1,this._state=0}}},fr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Qa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},yo=[],cP=class{constructor(){this._handlers=Object.create(null),this._active=yo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=yo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=yo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||yo,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",Qa(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;i>=0&&(r=this._active[i].unhook(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=yo,this._ident=0}},ko=new Ky;ko.addParam(0);var V_=class{constructor(e){this._handler=e,this._data="",this._params=ko,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ko,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Qa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=ko,this._data="",this._hitLimit=!1,r));return this._params=ko,this._data="",this._hitLimit=!1,t}},hP=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,i){this.table[t<<8|e]=r<<4|i}addMany(e,t,r,i){for(let o=0;of),r=(c,f)=>t.slice(c,f),i=r(32,127),o=r(0,24);o.push(25),o.push.apply(o,r(28,32));let l=r(0,14),a;e.setDefault(1,0),e.addMany(i,0,2,0);for(a in l)e.addMany([24,26,153,154],a,3,0),e.addMany(r(128,144),a,3,0),e.addMany(r(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Cr,0,2,0),e.add(Cr,8,5,8),e.add(Cr,6,0,6),e.add(Cr,11,0,11),e.add(Cr,13,13,13),e})(),fP=class extends De{constructor(e=dP){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Ky,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,i)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(tt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new uP),this._dcsParser=this._register(new cP),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;ol||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=i,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let i=this._escHandlers[r];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let i=this._csiHandlers[r];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,r,i,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=i,this._parseStack.chunkPos=o}parse(e,t,r){let i=0,o=0,l=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let c=this._parseStack.handlers,f=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&f>-1){for(;f>=0&&(a=c[f](this._params),a!==!0);f--)if(a instanceof Promise)return this._parseStack.handlerPos=f,a}this._parseStack.handlers=[];break;case 4:if(r===!1&&f>-1){for(;f>=0&&(a=c[f](),a!==!0);f--)if(a instanceof Promise)return this._parseStack.handlerPos=f,a}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(i!==24&&i!==26,r),a)return a;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],a=this._oscParser.end(i!==24&&i!==26,r),a)return a;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let c=l;c>4){case 2:for(let x=c+1;;++x){if(x>=t||(i=e[x])<32||i>126&&i=t||(i=e[x])<32||i>126&&i=t||(i=e[x])<32||i>126&&i=t||(i=e[x])<32||i>126&&i=0&&(a=f[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._preserveStack(3,f,h,o,c),a;h<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++c47&&i<60);c--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let g=this._escHandlers[this._collect<<8|i],m=g?g.length-1:-1;for(;m>=0&&(a=g[m](),a!==!0);m--)if(a instanceof Promise)return this._preserveStack(4,g,m,o,c),a;m<0&&this._escHandlerFb(this._collect<<8|i),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let x=c+1;;++x)if(x>=t||(i=e[x])===24||i===26||i===27||i>127&&i=t||(i=e[x])<32||i>127&&i>4:l>>8}return i}}function kh(e,t){let r=e.toString(16),i=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function gP(e,t=16){let[r,i,o]=e;return`rgb:${kh(r,t)}/${kh(i,t)}/${kh(o,t)}`}var _P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},qn=131072,q_=10;function Y_(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var X_=5e3,G_=0,vP=class extends De{constructor(e,t,r,i,o,l,a,c,f=new fP){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=i,this._optionsService=o,this._oscLinkService=l,this._coreMouseService=a,this._unicodeService=c,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new j4,this._utf8Decoder=new z4,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=mt.clone(),this._eraseAttrDataInternal=mt.clone(),this._onRequestBell=this._register(new se),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new se),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new se),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new se),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new se),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new se),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new se),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new se),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new se),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new se),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new se),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new se),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new xd(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:g.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,g,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:g,data:m})}),this._parser.setDcsHandlerFallback((h,g,m)=>{g==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:g,payload:m})}),this._parser.setPrintHandler((h,g,m)=>this.print(h,g,m)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(X.BEL,()=>this.bell()),this._parser.setExecuteHandler(X.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(X.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(X.BS,()=>this.backspace()),this._parser.setExecuteHandler(X.HT,()=>this.tab()),this._parser.setExecuteHandler(X.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(X.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ka.IND,()=>this.index()),this._parser.setExecuteHandler(ka.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ka.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new fr(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new fr(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new fr(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new fr(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new fr(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new fr(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new fr(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new fr(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new fr(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new fr(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new fr(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new fr(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in wt)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new V_((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),X_))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${X_} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,i=this._activeBuffer.x,o=this._activeBuffer.y,l=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;i=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>qn&&(l=this._parseStack.position+qn)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.lengthqn)for(let h=l;h0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let x=this._parser.precedingJoinState;for(let y=t;yc){if(f){let L=m,W=this._activeBuffer.x-E;for(this._activeBuffer.x=E,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&m instanceof So&&m.copyCellsFrom(L,W,0,E,!1);W=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(m.insertCells(this._activeBuffer.x,o-E,this._activeBuffer.getNullCell(g)),m.getWidth(c-1)===2&&m.setCellFromCodepoint(c-1,0,1,g)),m.setCellFromCodepoint(this._activeBuffer.x++,i,o,g),o>0)for(;--o;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=x,this._activeBuffer.x0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>Y_(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new V_(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new fr(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,i=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),o),i&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var i;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&i.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let f=c;for(let h=1;h0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(X.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(X.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(X.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(X.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(X.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t(k[k.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",k[k.SET=1]="SET",k[k.RESET=2]="RESET",k[k.PERMANENTLY_SET=3]="PERMANENTLY_SET",k[k.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let i=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:l}=this._coreMouseService,a=this._coreService,{buffers:c,cols:f}=this._bufferService,{active:h,alt:g}=c,m=this._optionsService.rawOptions,x=(k,E)=>(a.triggerDataEvent(`${X.ESC}[${t?"":"?"}${k};${E}$y`),!0),y=k=>k?1:2,S=e.params[0];return t?S===2?x(S,4):S===4?x(S,y(a.modes.insertMode)):S===12?x(S,3):S===20?x(S,y(m.convertEol)):x(S,0):S===1?x(S,y(i.applicationCursorKeys)):S===3?x(S,m.windowOptions.setWinLines?f===80?2:f===132?1:0:0):S===6?x(S,y(i.origin)):S===7?x(S,y(i.wraparound)):S===8?x(S,3):S===9?x(S,y(o==="X10")):S===12?x(S,y(m.cursorBlink)):S===25?x(S,y(!a.isCursorHidden)):S===45?x(S,y(i.reverseWraparound)):S===66?x(S,y(i.applicationKeypad)):S===67?x(S,4):S===1e3?x(S,y(o==="VT200")):S===1002?x(S,y(o==="DRAG")):S===1003?x(S,y(o==="ANY")):S===1004?x(S,y(i.sendFocus)):S===1005?x(S,4):S===1006?x(S,y(l==="SGR")):S===1015?x(S,4):S===1016?x(S,y(l==="SGR_PIXELS")):S===1048?x(S,1):S===47||S===1047||S===1049?x(S,y(h===g)):S===2004?x(S,y(i.bracketedPasteMode)):S===2026?x(S,y(i.synchronizedOutput)):x(S,0)}_updateAttrColor(e,t,r,i,o){return t===2?(e|=50331648,e&=-16777216,e|=$o.fromColorRGB([r,i,o])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let i=[0,0,-1,0,0,0],o=0,l=0;do{if(i[l+o]=e.params[t+l],e.hasSubParams(t+l)){let a=e.getSubParams(t+l),c=0;do i[1]===5&&(o=1),i[l+c+1+o]=a[c];while(++c=2||i[1]===2&&l+o>=5)break;i[1]&&(o=1)}while(++l+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=mt.fg,e.bg=mt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,i=this._curAttrData;for(let o=0;o=30&&r<=37?(i.fg&=-50331904,i.fg|=16777216|r-30):r>=40&&r<=47?(i.bg&=-50331904,i.bg|=16777216|r-40):r>=90&&r<=97?(i.fg&=-50331904,i.fg|=16777216|r-90|8):r>=100&&r<=107?(i.bg&=-50331904,i.bg|=16777216|r-100|8):r===0?this._processSGR0(i):r===1?i.fg|=134217728:r===3?i.bg|=67108864:r===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,i)):r===5?i.fg|=536870912:r===7?i.fg|=67108864:r===8?i.fg|=1073741824:r===9?i.fg|=2147483648:r===2?i.bg|=134217728:r===21?this._processUnderline(2,i):r===22?(i.fg&=-134217729,i.bg&=-134217729):r===23?i.bg&=-67108865:r===24?(i.fg&=-268435457,this._processUnderline(0,i)):r===25?i.fg&=-536870913:r===27?i.fg&=-67108865:r===28?i.fg&=-1073741825:r===29?i.fg&=2147483647:r===39?(i.fg&=-67108864,i.fg|=mt.fg&16777215):r===49?(i.bg&=-67108864,i.bg|=mt.bg&16777215):r===38||r===48||r===58?o+=this._extractColor(e,o,i):r===53?i.bg|=1073741824:r===55?i.bg&=-1073741825:r===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):r===100?(i.fg&=-67108864,i.fg|=mt.fg&16777215,i.bg&=-67108864,i.bg|=mt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${X.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=mt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Y_(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${X.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>q_&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>q_&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let i=r.shift(),o=r.shift();if(/^\d+$/.exec(i)){let l=parseInt(i);if(Q_(l))if(o==="?")t.push({type:0,index:l});else{let a=K_(o);a&&t.push({type:1,index:l,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),i=e.slice(t+1);return i?this._createHyperlink(r,i):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),i,o=r.findIndex(l=>l.startsWith("id="));return o!==-1&&(i=r[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let i=0;i=this._specialColors.length);++i,++t)if(r[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=K_(r[i]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let i=0;i=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=mt.clone(),this._eraseAttrDataInternal=mt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Lr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${X.ESC}${a}${X.ESC}\\`),!0),i=this._bufferService.buffer,o=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},xd=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(G_=e,e=t,t=G_),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};xd=ut([ue(0,Xt)],xd);function Q_(e){return 0<=e&&e<256}var yP=5e7,J_=12,xP=50,wP=class extends De{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new se),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r;for(;r=this._writeBuffer.shift();){this._action(r);let i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>yP)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let i=this._writeBuffer[this._bufferOffset],o=this._action(i,t);if(o){let a=c=>performance.now()-r>=J_?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(r,c);o.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(a);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=i.length,performance.now()-r>=J_)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>xP&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},wd=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let c=t.addMarker(t.ybase+t.y),f={data:e,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(f,c)),this._dataByLinkId.set(f.id,f),f.id}let r=e,i=this._getEntryIdKey(r),o=this._entriesWithId.get(i);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let l=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(a,l)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);r.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(r,i))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};wd=ut([ue(0,Xt)],wd);var Z_=!1,SP=class extends De{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ps),this._onBinary=this._register(new se),this.onBinary=this._onBinary.event,this._onData=this._register(new se),this.onData=this._onData.event,this._onLineFeed=this._register(new se),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new se),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new se),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new se),this._instantiationService=new KL,this.optionsService=this._register(new rP(e)),this._instantiationService.setService(Gt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(gd)),this._instantiationService.setService(Xt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(md)),this._instantiationService.setService(hy,this._logService),this.coreService=this._register(this._instantiationService.createInstance(_d)),this._instantiationService.setService(Ri,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(vd)),this._instantiationService.setService(cy,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(xi)),this._instantiationService.setService($4,this.unicodeService),this._charsetService=this._instantiationService.createInstance(lP),this._instantiationService.setService(H4,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(wd),this._instantiationService.setService(dy,this._oscLinkService),this._inputHandler=this._register(new vP(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(It.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(It.forward(this._bufferService.onResize,this._onResize)),this._register(It.forward(this.coreService.onData,this._onData)),this._register(It.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new wP((t,r)=>this._inputHandler.parse(t,r))),this._register(It.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new se),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Z_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Z_=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Uy),t=Math.max(t,Vy),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(U_.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(U_(this._bufferService),!1))),this._windowsWrappingHeuristics.value=tt(()=>{for(let t of e)t.dispose()})}}},bP={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function kP(e,t,r,i){var a;let o={type:0,cancel:!1,key:void 0},l=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?o.key=X.ESC+"OA":o.key=X.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=X.ESC+"OD":o.key=X.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=X.ESC+"OC":o.key=X.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=X.ESC+"OB":o.key=X.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":X.DEL,e.altKey&&(o.key=X.ESC+o.key);break;case 9:if(e.shiftKey){o.key=X.ESC+"[Z";break}o.key=X.HT,o.cancel=!0;break;case 13:o.key=e.altKey?X.ESC+X.CR:X.CR,o.cancel=!0;break;case 27:o.key=X.ESC,e.altKey&&(o.key=X.ESC+X.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;l?o.key=X.ESC+"[1;"+(l+1)+"D":t?o.key=X.ESC+"OD":o.key=X.ESC+"[D";break;case 39:if(e.metaKey)break;l?o.key=X.ESC+"[1;"+(l+1)+"C":t?o.key=X.ESC+"OC":o.key=X.ESC+"[C";break;case 38:if(e.metaKey)break;l?o.key=X.ESC+"[1;"+(l+1)+"A":t?o.key=X.ESC+"OA":o.key=X.ESC+"[A";break;case 40:if(e.metaKey)break;l?o.key=X.ESC+"[1;"+(l+1)+"B":t?o.key=X.ESC+"OB":o.key=X.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=X.ESC+"[2~");break;case 46:l?o.key=X.ESC+"[3;"+(l+1)+"~":o.key=X.ESC+"[3~";break;case 36:l?o.key=X.ESC+"[1;"+(l+1)+"H":t?o.key=X.ESC+"OH":o.key=X.ESC+"[H";break;case 35:l?o.key=X.ESC+"[1;"+(l+1)+"F":t?o.key=X.ESC+"OF":o.key=X.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=X.ESC+"[5;"+(l+1)+"~":o.key=X.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=X.ESC+"[6;"+(l+1)+"~":o.key=X.ESC+"[6~";break;case 112:l?o.key=X.ESC+"[1;"+(l+1)+"P":o.key=X.ESC+"OP";break;case 113:l?o.key=X.ESC+"[1;"+(l+1)+"Q":o.key=X.ESC+"OQ";break;case 114:l?o.key=X.ESC+"[1;"+(l+1)+"R":o.key=X.ESC+"OR";break;case 115:l?o.key=X.ESC+"[1;"+(l+1)+"S":o.key=X.ESC+"OS";break;case 116:l?o.key=X.ESC+"[15;"+(l+1)+"~":o.key=X.ESC+"[15~";break;case 117:l?o.key=X.ESC+"[17;"+(l+1)+"~":o.key=X.ESC+"[17~";break;case 118:l?o.key=X.ESC+"[18;"+(l+1)+"~":o.key=X.ESC+"[18~";break;case 119:l?o.key=X.ESC+"[19;"+(l+1)+"~":o.key=X.ESC+"[19~";break;case 120:l?o.key=X.ESC+"[20;"+(l+1)+"~":o.key=X.ESC+"[20~";break;case 121:l?o.key=X.ESC+"[21;"+(l+1)+"~":o.key=X.ESC+"[21~";break;case 122:l?o.key=X.ESC+"[23;"+(l+1)+"~":o.key=X.ESC+"[23~";break;case 123:l?o.key=X.ESC+"[24;"+(l+1)+"~":o.key=X.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=X.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=X.DEL:e.keyCode===219?o.key=X.ESC:e.keyCode===220?o.key=X.FS:e.keyCode===221&&(o.key=X.GS);else if((!r||i)&&e.altKey&&!e.metaKey){let c=(a=bP[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(c)o.key=X.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){let f=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(f);e.shiftKey&&(h=h.toUpperCase()),o.key=X.ESC+h}else if(e.keyCode===32)o.key=X.ESC+(e.ctrlKey?X.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let f=e.code.slice(3,4);e.shiftKey||(f=f.toLowerCase()),o.key=X.ESC+f,o.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=X.US),e.key==="@"&&(o.key=X.NUL));break}return o}var dt=0,CP=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Oa,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Oa,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((o,l)=>this._getKey(o)-this._getKey(l)),t=0,r=0,i=new Array(this._array.length+this._insertedValues.length);for(let o=0;o=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(i[o]=e[t],t++):i[o]=this._array[r++];this._array=i,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(dt=this._search(t),dt===-1)||this._getKey(this._array[dt])!==t)return!1;do if(this._array[dt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(dt),!0;while(++dto-l),t=0,r=new Array(this._array.length-e.length),i=0;for(let o=0;o0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(dt=this._search(e),!(dt<0||dt>=this._array.length)&&this._getKey(this._array[dt])===e))do yield this._array[dt];while(++dt=this._array.length)&&this._getKey(this._array[dt])===e))do t(this._array[dt]);while(++dt=t;){let i=t+r>>1,o=this._getKey(this._array[i]);if(o>e)r=i-1;else if(o0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Ch=0,ev=0,EP=class extends De{constructor(){super(),this._decorations=new CP(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new se),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new se),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(tt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new NP(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let i=0,o=0;for(let l of this._decorations.getKeyIterator(t))i=l.options.x??0,o=i+(l.options.width??1),e>=i&&e{Ch=o.options.x??0,ev=Ch+(o.options.width??1),e>=Ch&&e=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=i-this._lastRefreshMs,l=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},tv=20,Fa=class extends De{constructor(e,t,r,i){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=i,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;lthis._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new PP(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` -`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ee(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(tt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===tv+1&&(this._liveRegion.textContent+=Hh.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,i=r.lines.length.toString();for(let o=e;o<=t;o++){let l=r.lines.get(r.ydisp+o),a=[],c=(l==null?void 0:l.translateToString(!0,void 0,void 0,a))||"",f=(r.ydisp+o+1).toString(),h=this._rowElements[o];h&&(c.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=c,this._rowColumns.set(h,a)),h.setAttribute("aria-posinset",f),h.setAttribute("aria-setsize",i),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,i=this._rowElements[t===0?1:this._rowElements.length-2],o=r.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===l||e.relatedTarget!==i)return;let a,c;if(t===0?(a=r,c=this._rowElements.pop(),this._rowContainer.removeChild(c)):(a=this._rowElements.shift(),c=r,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),c.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{let f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var c;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let i=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:i,offset:((c=i.textContent)==null?void 0:c.length)??0}),!this._rowContainer.contains(r.node))return;let o=({node:f,offset:h})=>{let g=f instanceof Text?f.parentNode:f,m=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let x=this._rowColumns.get(g);if(!x)return console.warn("columns is null. Race condition?"),null;let y=h=this._terminal.cols&&(++m,y=0),{row:m,column:y}},l=o(t),a=o(r);if(!(!l||!a)){if(l.row>a.row||l.row===a.row&&l.column>=a.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(a.row-l.row)*this._terminal.cols-l.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{var l;Ei(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ee(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ee(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ee(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ee(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let i=0;i{l==null||l.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[l,a]of this._linkProviderService.linkProviders.entries())t?(o=this._activeProviderReplies)!=null&&o.get(l)&&(r=this._checkLinkProviderResult(l,e,r)):a.provideLinks(e.y,c=>{var h,g;if(this._isMouseOut)return;let f=c==null?void 0:c.map(m=>({link:m}));(h=this._activeProviderReplies)==null||h.set(l,f),r=this._checkLinkProviderResult(l,e,r),((g=this._activeProviderReplies)==null?void 0:g.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let i=0;ie?this._bufferService.cols:a.link.range.end.x;for(let h=c;h<=f;h++){if(r.has(h)){o.splice(l--,1);break}r.add(h)}}}}_checkLinkProviderResult(e,t,r){var l;if(!this._activeProviderReplies)return r;let i=this._activeProviderReplies.get(e),o=!1;for(let a=0;athis._linkAtPosition(c.link,t));a&&(r=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let a=0;athis._linkAtPosition(f.link,t));if(c){r=!0,this._handleNewLink(c);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&RP(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ei(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.pointerCursor},set:r=>{var i;(i=this._currentLink)!=null&&i.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.underline},set:r=>{var i,o,l;(i=this._currentLink)!=null&&i.state&&((l=(o=this._currentLink)==null?void 0:o.state)==null?void 0:l.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let i=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return r<=o&&o<=i}_positionFromMouseEvent(e,t,r){let i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,i,o){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:o}}};Sd=ut([ue(1,tf),ue(2,yn),ue(3,Xt),ue(4,py)],Sd);function RP(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var MP=class extends SP{constructor(e={}){super(e),this._linkifier=this._register(new ps),this.browser=Ty,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ps),this._onCursorMove=this._register(new se),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new se),this.onKey=this._onKey.event,this._onRender=this._register(new se),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new se),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new se),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new se),this.onBell=this._onBell.event,this._onFocus=this._register(new se),this._onBlur=this._register(new se),this._onA11yCharEmitter=this._register(new se),this._onA11yTabEmitter=this._register(new se),this._onWillOpen=this._register(new se),this._setup(),this._decorationService=this._instantiationService.createInstance(EP),this._instantiationService.setService(Wo,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(xL),this._instantiationService.setService(py,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Wh)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(It.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(It.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(It.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(It.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(tt(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let r,i="";switch(t.index){case 256:r="foreground",i="10";break;case 257:r="background",i="11";break;case 258:r="cursor",i="12";break;default:r="ansi",i="4;"+t.index}switch(t.type){case 0:let o=Ze.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${X.ESC}]${i};${gP(o)}${My.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=gt.toColor(...t.color));else{let l=r;this._themeService.modifyColors(a=>a[l]=gt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Fa,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,o=t.getWidth(r),l=this._renderService.dimensions.css.cell.width*o,a=this.buffer.y*this._renderService.dimensions.css.cell.height,c=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"px",this.textarea.style.top=a+"px",this.textarea.style.width=l+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ee(this.element,"copy",t=>{this.hasSelection()&&B4(t,this._selectionService)}));let e=t=>I4(t,this.textarea,this.coreService,this.optionsService);this._register(Ee(this.textarea,"paste",e)),this._register(Ee(this.element,"paste",e)),Ay?this._register(Ee(this.element,"mousedown",t=>{t.button===2&&h_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ee(this.element,"contextmenu",t=>{h_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),cf&&this._register(Ee(this.element,"auxclick",t=>{t.button===1&&sy(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ee(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ee(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ee(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ee(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ee(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ee(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ee(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((o=this.element)==null?void 0:o.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ee(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Fh.get()),jy||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(vL,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(vn,this._coreBrowserService),this._register(Ee(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(Ee(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(cd,this._document,this._helperContainer),this._instantiationService.setService(Ja,this._charSizeService),this._themeService=this._instantiationService.createInstance(pd),this._instantiationService.setService(vs,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ja),this._instantiationService.setService(fy,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(dd,this.rows,this.screenElement)),this._instantiationService.setService(yn,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ld,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(hd),this._instantiationService.setService(tf,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(Sd,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(sd,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(fd,this.element,this.screenElement,i)),this._instantiationService.setService(U4,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(It.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var l;this._selectionService.refresh(),(l=this._viewport)==null||l.queueSync()})),this._register(this._instantiationService.createInstance(od,this.screenElement)),this._register(Ee(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Fa,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ia,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ia,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ud,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(l){var h,g,m,x,y;let a=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!a)return!1;let c,f;switch(l.overrideType||l.type){case"mousemove":f=32,l.buttons===void 0?(c=3,l.button!==void 0&&(c=l.button<3?l.button:3)):c=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":f=0,c=l.button<3?l.button:3;break;case"mousedown":f=1,c=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let S=l.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(l,(x=(m=(g=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:g.device)==null?void 0:m.cell)==null?void 0:x.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;f=S<0?0:1,c=4;break;default:return!1}return f===void 0||c===void 0||c>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:c,action:f,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(r(l),l.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.mousedrag)),this.cancel(l)),wheel:l=>(r(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&r(l)},mousemove:l=>{l.buttons||r(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),l&8?i.mousemove||(t.addEventListener("mousemove",o.mousemove),i.mousemove=o.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),l&16?i.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),i.wheel=o.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),l&2?i.mouseup||(i.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),l&4?i.mousedrag||(i.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ee(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return r(l),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(l)})),this._register(Ee(t,"wheel",l=>{var a,c,f,h,g;if(!i.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,(h=(f=(c=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:c.device)==null?void 0:f.cell)==null?void 0:h.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(l,!0);let m=X.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){iy(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,r){this._selectionService.setSelection(e,t,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=kP(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let i=this.rows-1;return this.scrollLines(r.type===2?-i:i),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r.key===X.ETX||r.key===X.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(DP(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Lr)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},rv=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new AP(t)}getNullCell(){return new Lr}},BP=class extends De{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new se),this.onBufferChange=this._onBufferChange.event,this._normal=new rv(this._core.buffers.normal,"normal"),this._alternate=new rv(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},IP=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,i)=>t(r,i.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},jP=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},zP=["cols","rows"],Vr=0,OP=class extends De{constructor(e){super(),this._core=this._register(new MP(e)),this._addonManager=this._register(new TP),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],r=(i,o)=>{this._checkReadonlyOptions(i),this._core.options[i]=o};for(let i in this._core.options){let o={get:t.bind(this,i),set:r.bind(this,i)};Object.defineProperty(this._publicOptions,i,o)}}_checkReadonlyOptions(e){if(zP.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new IP(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new jP(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new BP(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r -`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Fh.get()},set promptLabel(e){Fh.set(e)},get tooMuchOutput(){return Hh.get()},set tooMuchOutput(e){Hh.set(e)}}}_verifyIntegers(...e){for(Vr of e)if(Vr===1/0||isNaN(Vr)||Vr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Vr of e)if(Vr&&(Vr===1/0||isNaN(Vr)||Vr%1!==0||Vr<0))throw new Error("This API only accepts positive integers")}};const ga="main-repl";function FP(){return new OP({cursorBlink:!0,fontFamily:"JetBrains Mono, Consolas, ui-monospace, SFMono-Regular, monospace",fontSize:13,lineHeight:1.25,scrollback:8e3,convertEol:!1,allowProposedApi:!0,theme:{background:"#060a0d",foreground:"#d7e1e8",cursor:"#33d17a",selectionBackground:"#1f6feb55",black:"#0b1117",red:"#ff6b6b",green:"#33d17a",yellow:"#f4d35e",blue:"#4ea1ff",magenta:"#c778dd",cyan:"#56b6c2",white:"#d7e1e8",brightBlack:"#5c6773",brightRed:"#ff8a8a",brightGreen:"#5ee08f",brightYellow:"#ffe08a",brightBlue:"#79b8ff",brightMagenta:"#d8a4ec",brightCyan:"#7fd5df",brightWhite:"#ffffff"}})}function HP(e){if(typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}function $P(e,t){if(t.data){e.write(t.data);return}if(!t.data_b64)return;const r=atob(t.data_b64),i=new Uint8Array(r.length);for(let o=0;o{const i=r.findIndex(l=>l.id===t.id);if(i<0)return[...r,t];const o=r.slice();return o[i]={...o[i],...t},o})}function tu(e){return e.kind==="repl"?"Main REPL":e.name||e.command||e.id}function UP(e){return e.kind==="repl"?"console":e.kind||"task"}function sv(e){return[`title: ${tu(e)}`,`id: ${e.id}`,e.kind?`kind: ${e.kind}`:"",e.state?`state: ${hf(e.state)||e.state}`:"",e.command?`command: ${e.command}`:"",Yy(e.pid)?`pid: ${e.pid}`:"",e.started_at?`started: ${wi(e.started_at)}`:"",e.last_activity_at?`activity: ${wi(e.last_activity_at)}`:"",e.ended_at?`ended: ${wi(e.ended_at)}`:"",e.state!=="running"&&typeof e.exit_code=="number"?`exit: ${e.exit_code}`:"",e.kill_cause?`kill: ${e.kill_cause}`:"",typeof e.output_bytes=="number"?`output: ${Xy(e.output_bytes)}`:"",typeof e.activity_seq=="number"?`activity seq: ${e.activity_seq}`:""].filter(Boolean).join(` -`)}function ov(e){return typeof e.activity_seq=="number"&&Number.isFinite(e.activity_seq)?e.activity_seq:0}function VP(e,t){const r=lv(e.state)-lv(t.state);return r!==0?r:av(t)-av(e)}function lv(e){switch(e){case"running":return 0;case"failed":case"killed":return 1;case"completed":return 2;default:return 3}}function av(e){const t=e.last_activity_at||e.ended_at||e.started_at;if(!t)return 0;const r=new Date(t).getTime();return Number.isFinite(r)?r:0}function hf(e){switch(e){case"running":return"running";case"completed":return"closed";case"failed":return"failed";case"killed":return"killed";default:return""}}function KP(e){switch(e){case"running":return"text-cyber-700 dark:text-cyber-300";case"completed":return"text-muted-foreground";case"failed":case"killed":return"text-destructive";default:return"text-yellow-700 dark:text-yellow-300"}}function qP(e){switch(e){case"connected":return"bg-cyber-400/10 text-cyber-700 dark:text-cyber-300";case"error":return"bg-destructive/10 text-destructive";case"closed":return"bg-muted text-muted-foreground";default:return"bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"}}function YP(e){switch(e){case"running":case"ready":return"text-cyber-400";case"completed":return"text-muted-foreground";case"killed":case"failed":return"text-destructive";default:return"text-yellow-400"}}function wi(e){if(e)try{const t=new Date(e);return!Number.isFinite(t.getTime())||t.getFullYear()<=1?void 0:t.toLocaleString()}catch{return e}}function Yy(e){return typeof e=="number"&&e>0?e:void 0}function Xy(e){if(typeof e!="number"||!Number.isFinite(e))return;if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let r=e/1024;for(const i of t){if(r<1024)return`${r.toFixed(r>=10?0:1)} ${i}`;r/=1024}return`${r.toFixed(1)} TB`}function XP({activeID:e,replSession:t,summary:r,taskSessions:i,unreadIDs:o,onAttachRepl:l,onAttach:a}){return _.jsxs("aside",{className:"flex max-h-64 w-full shrink-0 flex-col border-b border-border lg:max-h-none lg:w-64 lg:border-b-0 lg:border-r",children:[_.jsx("div",{className:"border-b border-border p-2",children:_.jsx(uv,{active:!!t&&t.id===e,title:"Main REPL",meta:t?"always on":"starting",state:(t==null?void 0:t.state)||"running",details:t?sv(t):"Main REPL is starting",unread:t?t.id!==e&&o.has(t.id):!1,onClick:l})}),_.jsxs("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3 text-[10px] uppercase text-muted-foreground",children:[_.jsx("span",{children:"Tasks"}),_.jsxs("span",{className:"truncate",children:[r.running," running",r.updates?` · ${r.updates} new`:""]})]}),_.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-2",children:i.length===0?_.jsx("div",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No tasks yet"}):i.map(c=>_.jsx(uv,{active:c.id===e,title:tu(c),meta:UP(c),command:c.command,state:c.state||"unknown",details:sv(c),unread:c.id!==e&&o.has(c.id),onClick:()=>a(c)},c.id))})]})}function uv({active:e,command:t,details:r,meta:i,onClick:o,state:l,title:a,unread:c}){return _.jsxs("button",{type:"button",onClick:o,title:r,className:je("mb-1 flex w-full items-start gap-2 rounded-md px-2 py-2 text-left text-xs transition-colors",e?"bg-cyber-400/10 text-foreground":c?"bg-cyber-400/5 text-foreground hover:bg-cyber-400/10":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[_.jsxs("span",{className:"relative mt-1 shrink-0",children:[_.jsx(gv,{className:je("h-2.5 w-2.5 fill-current",YP(l))}),c&&_.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-cyber-400"})]}),_.jsxs("span",{className:"min-w-0 flex-1",children:[_.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[_.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a}),_.jsx("span",{className:je("shrink-0 text-[10px]",KP(l)),children:hf(l)})]}),_.jsx("span",{className:"mt-0.5 block truncate font-mono",children:i}),t&&_.jsx("span",{className:"mt-0.5 block truncate font-mono opacity-70",children:t})]})]})}function GP({agent:e,onClose:t,session:r,status:i,taskSessions:o}){var h,g;const l=e.identity||{},a=e.stats||{},c=o.filter(m=>m.state==="running").length,f=o.length-c;return _.jsxs("aside",{className:"flex max-h-72 w-full shrink-0 flex-col border-t border-border bg-card lg:max-h-none lg:w-80 lg:border-l lg:border-t-0",children:[_.jsxs("div",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border px-3",children:[_.jsx("span",{className:"text-xs font-medium uppercase text-muted-foreground",children:"Details"}),_.jsx(QP,{label:"Close details",onClick:t,children:_.jsx(jo,{className:"h-3.5 w-3.5"})})]}),_.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-3 text-xs",children:[_.jsxs(_a,{title:"Agent",children:[_.jsx(Be,{label:"Name",value:e.name}),_.jsx(Be,{label:"ID",value:e.id,mono:!0}),_.jsx(Be,{label:"State",value:e.busy?"busy":"idle"}),_.jsx(Be,{label:"Connected",value:wi(e.connected_at)}),_.jsx(Be,{label:"Host",value:l.hostname}),_.jsx(Be,{label:"User",value:l.username}),_.jsx(Be,{label:"Runtime",value:[l.os,l.arch].filter(Boolean).join("/")}),_.jsx(Be,{label:"PID",value:l.pid}),_.jsx(Be,{label:"CWD",value:l.working_dir,mono:!0}),_.jsx(Be,{label:"LLM",value:[l.provider,l.model].filter(Boolean).join(" / ")||"offline"}),_.jsx(Be,{label:"Space",value:l.space})]}),_.jsxs(_a,{title:"Active Session",children:[_.jsx(Be,{label:"Console",value:i}),r?_.jsxs(_.Fragment,{children:[_.jsx(Be,{label:"Title",value:tu(r)}),_.jsx(Be,{label:"ID",value:r.id,mono:!0}),_.jsx(Be,{label:"Kind",value:r.kind}),_.jsx(Be,{label:"State",value:hf(r.state||"")||r.state}),_.jsx(Be,{label:"Command",value:r.command,mono:!0}),_.jsx(Be,{label:"PID",value:Yy(r.pid)}),_.jsx(Be,{label:"Started",value:wi(r.started_at)}),_.jsx(Be,{label:"Activity",value:wi(r.last_activity_at)}),_.jsx(Be,{label:"Ended",value:wi(r.ended_at)}),_.jsx(Be,{label:"Exit",value:r.state==="running"?void 0:r.exit_code}),_.jsx(Be,{label:"Kill",value:r.kill_cause}),_.jsx(Be,{label:"Output",value:Xy(r.output_bytes)})]}):_.jsx(Be,{label:"State",value:"starting"})]}),_.jsxs(_a,{title:"Tasks",children:[_.jsx(Be,{label:"Total",value:o.length}),_.jsx(Be,{label:"Running",value:c}),_.jsx(Be,{label:"Closed",value:f}),_.jsx(Be,{label:"Commands",value:(h=e.commands)==null?void 0:h.join(", ")}),_.jsx(Be,{label:"Capabilities",value:(g=l.capabilities)==null?void 0:g.join(", ")})]}),_.jsxs(_a,{title:"Stats",children:[_.jsx(Be,{label:"Turns",value:a.turns}),_.jsx(Be,{label:"Tools",value:a.tool_calls}),_.jsx(Be,{label:"Running",value:a.running_tools}),_.jsx(Be,{label:"Tokens",value:a.total_tokens}),_.jsx(Be,{label:"Assets",value:a.assets}),_.jsx(Be,{label:"Loots",value:a.loots}),_.jsx(Be,{label:"Last",value:a.last_event})]})]})]})}function QP({children:e,label:t,onClick:r}){return _.jsx(hs,{content:t,side:"bottom",children:_.jsx("button",{type:"button","aria-label":t,title:t,onClick:r,className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",children:e})})}function _a({children:e,title:t}){return _.jsxs("section",{className:"mb-4 last:mb-0",children:[_.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase text-muted-foreground",children:t}),_.jsx("div",{className:"space-y-1.5",children:e})]})}function Be({label:e,mono:t,value:r}){return r==null||r===""?null:_.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)] gap-2",children:[_.jsx("div",{className:"text-muted-foreground",children:e}),_.jsx("div",{className:je("min-w-0 break-words text-foreground",t&&"font-mono"),children:r})]})}function JP({agent:e}){const[t,r]=te.useState("connecting"),[i,o]=te.useState([]),[l,a]=te.useState(""),[c,f]=te.useState(()=>new Set),[h,g]=te.useState(!1),m=te.useRef(""),x=te.useRef({}),y=te.useRef(!1),S=te.useRef(null),k=te.useRef(null),E=te.useRef(null),L=te.useRef(null),W=te.useMemo(()=>i.find(K=>K.kind==="repl"&&(K.name===ga||!K.name))||i.find(K=>K.kind==="repl")||null,[i]),z=te.useMemo(()=>i.filter(K=>K.kind!=="repl").slice().sort(VP),[i]),q=te.useMemo(()=>{let K=0,b=0;for(const P of z)P.state==="running"&&(K+=1),P.id!==l&&c.has(P.id)&&(b+=1);return{running:K,updates:b}},[l,z,c]),Q=te.useMemo(()=>i.find(K=>K.id===l)||null,[l,i]);te.useEffect(()=>{m.current=l},[l]),te.useEffect(()=>{const K=L.current;if(!K)return;r("connecting"),o([]),a(""),f(new Set),m.current="",x.current={},y.current=!1;const b=FP(),P=new R4;b.loadAddon(P),b.open(K),P.fit(),b.focus(),k.current=b,E.current=P;const U=new WebSocket(k4(e.id));S.current=U;const C=ye=>{U.readyState===WebSocket.OPEN&&U.send(JSON.stringify(ye))},ae=()=>({cols:b.cols,rows:b.rows}),ve=b.onData(ye=>{m.current&&C({type:"pty.input",payload:{session_id:m.current,data:ye}})}),fe=b.onResize(({cols:ye,rows:xe})=>{m.current&&C({type:"pty.resize",payload:{session_id:m.current,cols:ye,rows:xe}})}),Le=new ResizeObserver(()=>P.fit());return Le.observe(K),U.onopen=()=>{r("connected"),C({type:"pty.open",payload:{kind:"repl",name:ga,singleton:!0,...ae()}}),C({type:"pty.list"})},U.onmessage=ye=>{const xe=HP(ye.data);if(xe)switch(xe.type){case"pty.sessions":F(WP(xe));break;case"pty.opened":case"pty.attached":{const Fe=Po(xe,"session_id"),Ye=nv(xe);Ye&&iv(o,Ye),Fe&&(m.current=Fe,a(Fe),V(Fe,Ye)),r("connected"),C({type:"pty.list"}),b.focus();break}case"pty.output":$P(b,xe),V(m.current);break;case"pty.closed":{const Fe=Po(xe,"session_id"),Ye=nv(xe);if(Ye&&iv(o,Ye),Fe===m.current){if(V(Fe,Ye),(Ye==null?void 0:Ye.kind)==="repl"){r("connected"),he(),C({type:"pty.open",payload:{kind:"repl",name:ga,singleton:!0,...ae()}}),C({type:"pty.list"});break}r("closed"),b.write(`\r +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),cf&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i||!t?!1:this._areCoordsInSelection(t,r,i)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i?!1:this._areCoordsInSelection([e,t],r,i)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){var o,l;let r=(l=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:l.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=A_(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=uf(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-yh),yh),t/=yh,t/Math.abs(t)+Math.round(t*(UL-1)))}shouldForceSelection(e){return za?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),VL)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(za&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&tthis._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let i=0;t>=i;i++){let o=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:o>1&&t!==i&&(r+=o-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,i=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,l=o.lines.get(e[1]);if(!l)return;let a=o.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(l,e[0]),f=c,h=e[0]-c,g=0,m=0,x=0,y=0;if(a.charAt(c)===" "){for(;c>0&&a.charAt(c-1)===" ";)c--;for(;f1&&(y+=W-1,f+=W-1);E>0&&c>0&&!this._isCharWordSeparator(l.loadCell(E-1,this._workCell));){l.loadCell(E-1,this._workCell);let z=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,E--):z>1&&(x+=z-1,c-=z-1),c--,E--}for(;L1&&(y+=z-1,f+=z-1),f++,L++}}f++;let S=c+h-g+x,k=Math.min(this._bufferService.cols,f-c+g+m-x-y);if(!(!t&&a.slice(c,f).trim()==="")){if(r&&S===0&&l.getCodePoint(0)!==32){let E=o.lines.get(e[1]-1);if(E&&l.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let L=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(L){let W=this._bufferService.cols-L.start;S-=W,k+=W}}}if(i&&S+k===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let E=o.lines.get(e[1]+1);if(E!=null&&E.isWrapped&&E.getCodePoint(0)!==32){let L=this._getWordAt([0,e[1]+1],!1,!1,!0);L&&(k+=L.length)}}return{start:S,length:k}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=A_(r,this._bufferService.cols)}};fd=ut([ue(3,Xt),ue(4,Ri),ue(5,tf),ue(6,Gt),ue(7,wn),ue(8,xn)],fd);var B_=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},I_=class{constructor(){this._color=new B_,this._css=new B_}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},yt=Object.freeze((()=>{let e=[st.toColor("#2e3436"),st.toColor("#cc0000"),st.toColor("#4e9a06"),st.toColor("#c4a000"),st.toColor("#3465a4"),st.toColor("#75507b"),st.toColor("#06989a"),st.toColor("#d3d7cf"),st.toColor("#555753"),st.toColor("#ef2929"),st.toColor("#8ae234"),st.toColor("#fce94f"),st.toColor("#729fcf"),st.toColor("#ad7fa8"),st.toColor("#34e2e2"),st.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let i=t[r/36%6|0],o=t[r/6%6|0],l=t[r%6];e.push({css:gt.toCss(i,o,l),rgba:gt.toRgba(i,o,l)})}for(let r=0;r<24;r++){let i=8+r*10;e.push({css:gt.toCss(i,i,i),rgba:gt.toRgba(i,i,i)})}return e})()),vi=st.toColor("#ffffff"),wo=st.toColor("#000000"),j_=st.toColor("#ffffff"),z_=wo,go={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},XL=vi,pd=class extends Te{constructor(e){super(),this._optionsService=e,this._contrastCache=new I_,this._halfContrastCache=new I_,this._onChangeColors=this._register(new oe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:vi,background:wo,cursor:j_,cursorAccent:z_,selectionForeground:void 0,selectionBackgroundTransparent:go,selectionBackgroundOpaque:Ze.blend(wo,go),selectionInactiveBackgroundTransparent:go,selectionInactiveBackgroundOpaque:Ze.blend(wo,go),scrollbarSliderBackground:Ze.opacity(vi,.2),scrollbarSliderHoverBackground:Ze.opacity(vi,.4),scrollbarSliderActiveBackground:Ze.opacity(vi,.5),overviewRulerBorder:vi,ansi:yt.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=Ve(e.foreground,vi),t.background=Ve(e.background,wo),t.cursor=Ze.blend(t.background,Ve(e.cursor,j_)),t.cursorAccent=Ze.blend(t.background,Ve(e.cursorAccent,z_)),t.selectionBackgroundTransparent=Ve(e.selectionBackground,go),t.selectionBackgroundOpaque=Ze.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ve(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ze.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ve(e.selectionForeground,M_):void 0,t.selectionForeground===M_&&(t.selectionForeground=void 0),Ze.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ze.opacity(t.selectionBackgroundTransparent,.3)),Ze.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ze.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ve(e.scrollbarSliderBackground,Ze.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ve(e.scrollbarSliderHoverBackground,Ze.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ve(e.scrollbarSliderActiveBackground,Ze.opacity(t.foreground,.5)),t.overviewRulerBorder=Ve(e.overviewRulerBorder,XL),t.ansi=yt.slice(),t.ansi[0]=Ve(e.black,yt[0]),t.ansi[1]=Ve(e.red,yt[1]),t.ansi[2]=Ve(e.green,yt[2]),t.ansi[3]=Ve(e.yellow,yt[3]),t.ansi[4]=Ve(e.blue,yt[4]),t.ansi[5]=Ve(e.magenta,yt[5]),t.ansi[6]=Ve(e.cyan,yt[6]),t.ansi[7]=Ve(e.white,yt[7]),t.ansi[8]=Ve(e.brightBlack,yt[8]),t.ansi[9]=Ve(e.brightRed,yt[9]),t.ansi[10]=Ve(e.brightGreen,yt[10]),t.ansi[11]=Ve(e.brightYellow,yt[11]),t.ansi[12]=Ve(e.brightBlue,yt[12]),t.ansi[13]=Ve(e.brightMagenta,yt[13]),t.ansi[14]=Ve(e.brightCyan,yt[14]),t.ansi[15]=Ve(e.brightWhite,yt[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;il.index-a.index),i=[];for(let l of r){let a=this._services.get(l.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);i.push(a)}let o=r.length>0?r[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...i)}},JL={trace:0,debug:1,info:2,warn:3,error:4,off:5},ZL="xterm.js: ",md=class extends Te{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=JL[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis._length)for(let t=this._length;t=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;ithis._maxLength){let i=this._length+r.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let o=t-1;o>=0;o--)this.set(e+o+r,this.get(e+o));let i=e+t+r-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,r){this._data[t*Me+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Me+0]=t|2097152|r[2]<<22):this._data[t*Me+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Me+0]>>22}hasWidth(t){return this._data[t*Me+0]&12582912}getFg(t){return this._data[t*Me+1]}getBg(t){return this._data[t*Me+2]}hasContent(t){return this._data[t*Me+0]&4194303}getCodePoint(t){let r=this._data[t*Me+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Me+0]&2097152}getString(t){let r=this._data[t*Me+0];return r&2097152?this._combined[t]:r&2097151?Gn(r&2097151):""}isProtected(t){return this._data[t*Me+2]&536870912}loadCell(t,r){return ma=t*Me,r.content=this._data[ma+0],r.fg=this._data[ma+1],r.bg=this._data[ma+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Me+0]=r.content,this._data[t*Me+1]=r.fg,this._data[t*Me+2]=r.bg}setCellFromCodepoint(t,r,i,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Me+0]=r|i<<22,this._data[t*Me+1]=o.fg,this._data[t*Me+2]=o.bg}addCodepointToCell(t,r,i){let o=this._data[t*Me+0];o&2097152?this._combined[t]+=Gn(r):o&2097151?(this._combined[t]=Gn(o&2097151)+Gn(r),o&=-2097152,o|=2097152):o=r|1<<22,i&&(o&=-12582913,o|=i<<22),this._data[t*Me+0]=o}insertCells(t,r,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),r=0;--l)this.setCell(t+r+l,this.loadCell(t+l,o));for(let l=0;lthis.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let o=new Uint32Array(i);o.set(this._data),this._data=o}for(let o=this.length;o=t&&delete this._combined[c]}let l=Object.keys(this._extendedAttrs);for(let a=0;a=t&&delete this._extendedAttrs[c]}}return this.length=t,i*4*xh=0;--t)if(this._data[t*Me+0]&4194303)return t+(this._data[t*Me+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Me+0]&4194303||this._data[t*Me+2]&50331648)return t+(this._data[t*Me+0]>>22);return 0}copyCellsFrom(t,r,i,o,l){let a=t._data;if(l)for(let f=o-1;f>=0;f--){for(let h=0;h=r&&(this._combined[h-r+i]=t._combined[h])}}translateToString(t,r,i,o){r=r??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),o&&(o.length=0);let l="";for(;r>22||1}return o&&o.push(r),l}};function eP(e,t,r,i,o,l){let a=[];for(let c=0;c=c&&i0&&(E>m||g[E].getTrimmedLength()===0);E--)k++;k>0&&(a.push(c+g.length-k),a.push(k)),c+=g.length-1}return a}function tP(e,t){let r=[],i=0,o=t[i],l=0;for(let a=0;aIo(e,h,t)).reduce((f,h)=>f+h),l=0,a=0,c=0;for(;cf&&(l-=f,a++);let h=e[a].getWidth(l-1)===2;h&&l--;let g=h?r-1:r;i.push(g),c+=g}return i}function Io(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,o=e[t+1].getWidth(0)===2;return i&&o?r-1:r}var Ky=class qy{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=qy._nextId++,this._onDispose=this.register(new oe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ei(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Ky._nextId=1;var iP=Ky,wt={},yi=wt.B;wt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};wt.A={"#":"£"};wt.B=void 0;wt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};wt.C=wt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};wt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};wt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};wt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};wt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};wt.E=wt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};wt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};wt.H=wt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};wt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var F_=4294967295,H_=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=mt.clone(),this.savedCharset=yi,this.markers=[],this._nullCell=Lr.fromCharData([0,cy,1,0]),this._whitespaceCell=Lr.fromCharData([0,Qn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Oa,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new O_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ba),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ba),this._whitespaceCell}getBlankLine(e,t){return new So(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&eF_?F_:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=mt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new O_(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(mt),i=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new So(e,r)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let l=0;l.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,i=eP(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(mt),r);if(i.length>0){let o=tP(this.lines,i);rP(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let i=this.getNullCell(mt),o=r;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let f=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),f.unshift(c);if(!r){let z=this.ybase+this.y;if(z>=a&&z0&&(o.push({start:a+f.length+l,newLines:y}),l+=y.length),f.push(...y);let S=g.length-1,k=g[S];k===0&&(S--,k=g[S]);let E=f.length-m-1,L=h;for(;E>=0;){let z=Math.min(L,k);if(f[S]===void 0)break;if(f[S].copyCellsFrom(f[E],L-z,k-z,z,!0),k-=z,k===0&&(S--,k=g[S]),L-=z,L===0){E--;let Y=Math.max(E,0);L=Io(f,Y,this._cols)}}for(let z=0;z0;)this.ybase===0?this.y0){let a=[],c=[];for(let k=0;k=0;k--)if(m&&m.start>h+x){for(let E=m.newLines.length-1;E>=0;E--)this.lines.set(k--,m.newLines[E]);k++,a.push({index:h+1,amount:m.newLines.length}),x+=m.newLines.length,m=o[++g]}else this.lines.set(k,c[h--]);let y=0;for(let k=a.length-1;k>=0;k--)a[k].index+=y,this.lines.onInsertEmitter.fire(a[k]),y+=a[k].amount;let S=Math.max(0,f+l-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,r=0,i){let o=this.lines.get(e);return o?o.translateToString(t,r,i):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.liner.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},sP=class extends Te{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new oe),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new H_(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new H_(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Yy=2,Xy=1,gd=class extends Te{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new oe),this.onResize=this._onResize.event,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Yy),this.rows=Math.max(e.rawOptions.rows||0,Xy),this.buffers=this._register(new sP(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=r.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;let o=r.ybase+r.scrollTop,l=r.ybase+r.scrollBottom;if(r.scrollTop===0){let a=r.lines.isFull;l===r.lines.length-1?a?r.lines.recycle().copyFrom(i):r.lines.push(i.clone()):r.lines.splice(l+1,0,i.clone()),a?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let a=l-o+1;r.lines.shiftElements(o+1,a-1,-1),r.lines.set(l,i.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};gd=ut([ue(0,Gt)],gd);var ls={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:za,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},oP=["normal","bold","100","200","300","400","500","600","700","800","900"],lP=class extends Te{constructor(e){super(),this._onOptionChange=this._register(new oe),this.onOptionChange=this._onOptionChange.event;let t={...ls};for(let r in e)if(r in t)try{let i=e[r];t[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(tt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in ls))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,i)=>{if(!(r in ls))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let i={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ls[e]),!aP(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ls[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=oP.includes(t)?t:ls[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function aP(e){return e==="block"||e==="underline"||e==="bar"}function bo(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let i in e)r[i]=t<=1?e[i]:e[i]&&bo(e[i],t-1);return r}var $_=Object.freeze({insertMode:!1}),W_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),_d=class extends Te{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new oe),this.onData=this._onData.event,this._onUserInput=this._register(new oe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new oe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new oe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=bo($_),this.decPrivateModes=bo(W_)}reset(){this.modes=bo($_),this.decPrivateModes=bo(W_)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};_d=ut([ue(0,Xt),ue(1,my),ue(2,Gt)],_d);var U_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function wh(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Sh=String.fromCharCode,V_={DEFAULT:e=>{let t=[wh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Sh(t[0])}${Sh(t[1])}${Sh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wh(e,!0)};${e.x};${e.y}${t}`}},vd=class extends Te{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new oe),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys(U_))this.addProtocol(i,U_[i]);for(let i of Object.keys(V_))this.addEncoding(i,V_[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let i=t/r,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=i+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};vd=ut([ue(0,Xt),ue(1,Ri),ue(2,Gt)],vd);var bh=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],uP=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],xt;function cP(e,t){let r=0,i=t.length-1,o;if(et[i][1])return!1;for(;i>=r;)if(o=r+i>>1,e>t[o][1])r=o+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),i=r===0&&t!==0;if(i){let o=xi.extractWidth(t);o===0?i=!1:o>r&&(r=o)}return xi.createPropertyValue(0,r,i)}},xi=class Ea{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new oe,this.onChange=this._onChange.event;let t=new hP;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,i=!1){return(t&16777215)<<3|(r&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,i=0,o=t.length;for(let l=0;l=o)return r+this.wcwidth(a);let h=t.charCodeAt(l);56320<=h&&h<=57343?a=(a-55296)*1024+h-56320+65536:r+=this.wcwidth(h)}let c=this.charProperties(a,i),f=Ea.extractWidth(c);Ea.extractShouldJoin(c)&&(f-=Ea.extractWidth(i)),r+=f,i=c}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},dP=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function K_(e){var i;let t=(i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:i.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var _o=2147483647,fP=256,Gy=class yd{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>fP)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new yd;if(!t.length)return r;for(let i=Array.isArray(t[0])?1:0;i>8,o=this._subParamsIdx[r]&255;o-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,o))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>_o?_o:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>_o?_o:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-r>0?this._subParams.subarray(r,i):null}getSubParamsAll(){let t={};for(let r=0;r>8,o=this._subParamsIdx[r]&255;o-i>0&&(t[r]=this._subParams.slice(i,o))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,o=i[r-1];i[r-1]=~o?Math.min(o*10+t,_o):t}},vo=[],pP=class{constructor(){this._state=0,this._active=vo,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=vo}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=vo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||vo,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",Qa(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t0&&this._put(e,t,r)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let r=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;i>=0&&(r=this._active[i].end(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=vo,this._id=-1,this._state=0}}},fr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Qa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},yo=[],mP=class{constructor(){this._handlers=Object.create(null),this._active=yo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=yo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=yo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||yo,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",Qa(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&r===!1){for(;i>=0&&(r=this._active[i].unhook(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=yo,this._ident=0}},ko=new Gy;ko.addParam(0);var q_=class{constructor(e){this._handler=e,this._data="",this._params=ko,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ko,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Qa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=ko,this._data="",this._hitLimit=!1,r));return this._params=ko,this._data="",this._hitLimit=!1,t}},gP=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,i){this.table[t<<8|e]=r<<4|i}addMany(e,t,r,i){for(let o=0;of),r=(c,f)=>t.slice(c,f),i=r(32,127),o=r(0,24);o.push(25),o.push.apply(o,r(28,32));let l=r(0,14),a;e.setDefault(1,0),e.addMany(i,0,2,0);for(a in l)e.addMany([24,26,153,154],a,3,0),e.addMany(r(128,144),a,3,0),e.addMany(r(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Cr,0,2,0),e.add(Cr,8,5,8),e.add(Cr,6,0,6),e.add(Cr,11,0,11),e.add(Cr,13,13,13),e})(),vP=class extends Te{constructor(e=_P){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Gy,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,i)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(tt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new pP),this._dcsParser=this._register(new mP),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;ol||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=i,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let i=this._escHandlers[r];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let i=this._csiHandlers[r];return i.push(t),{dispose:()=>{let o=i.indexOf(t);o!==-1&&i.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,r,i,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=i,this._parseStack.chunkPos=o}parse(e,t,r){let i=0,o=0,l=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let c=this._parseStack.handlers,f=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&f>-1){for(;f>=0&&(a=c[f](this._params),a!==!0);f--)if(a instanceof Promise)return this._parseStack.handlerPos=f,a}this._parseStack.handlers=[];break;case 4:if(r===!1&&f>-1){for(;f>=0&&(a=c[f](),a!==!0);f--)if(a instanceof Promise)return this._parseStack.handlerPos=f,a}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(i!==24&&i!==26,r),a)return a;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],a=this._oscParser.end(i!==24&&i!==26,r),a)return a;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let c=l;c>4){case 2:for(let x=c+1;;++x){if(x>=t||(i=e[x])<32||i>126&&i=t||(i=e[x])<32||i>126&&i=t||(i=e[x])<32||i>126&&i=t||(i=e[x])<32||i>126&&i=0&&(a=f[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._preserveStack(3,f,h,o,c),a;h<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++c47&&i<60);c--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let g=this._escHandlers[this._collect<<8|i],m=g?g.length-1:-1;for(;m>=0&&(a=g[m](),a!==!0);m--)if(a instanceof Promise)return this._preserveStack(4,g,m,o,c),a;m<0&&this._escHandlerFb(this._collect<<8|i),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let x=c+1;;++x)if(x>=t||(i=e[x])===24||i===26||i===27||i>127&&i=t||(i=e[x])<32||i>127&&i>4:l>>8}return i}}function kh(e,t){let r=e.toString(16),i=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function wP(e,t=16){let[r,i,o]=e;return`rgb:${kh(r,t)}/${kh(i,t)}/${kh(o,t)}`}var SP={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Xn=131072,X_=10;function G_(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Q_=5e3,J_=0,bP=class extends Te{constructor(e,t,r,i,o,l,a,c,f=new vP){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=i,this._optionsService=o,this._oscLinkService=l,this._coreMouseService=a,this._unicodeService=c,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new $4,this._utf8Decoder=new W4,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=mt.clone(),this._eraseAttrDataInternal=mt.clone(),this._onRequestBell=this._register(new oe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new oe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new oe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new oe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new oe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new oe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new oe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new oe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new oe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new oe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new oe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new oe),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new xd(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:g.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,g,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:g,data:m})}),this._parser.setDcsHandlerFallback((h,g,m)=>{g==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:g,payload:m})}),this._parser.setPrintHandler((h,g,m)=>this.print(h,g,m)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(G.BEL,()=>this.bell()),this._parser.setExecuteHandler(G.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(G.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(G.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(G.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(G.BS,()=>this.backspace()),this._parser.setExecuteHandler(G.HT,()=>this.tab()),this._parser.setExecuteHandler(G.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(G.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ka.IND,()=>this.index()),this._parser.setExecuteHandler(ka.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ka.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new fr(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new fr(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new fr(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new fr(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new fr(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new fr(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new fr(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new fr(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new fr(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new fr(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new fr(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new fr(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in wt)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new q_((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),Q_))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Q_} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,i=this._activeBuffer.x,o=this._activeBuffer.y,l=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;i=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Xn&&(l=this._parseStack.position+Xn)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.lengthXn)for(let h=l;h0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let x=this._parser.precedingJoinState;for(let y=t;yc){if(f){let L=m,W=this._activeBuffer.x-E;for(this._activeBuffer.x=E,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&m instanceof So&&m.copyCellsFrom(L,W,0,E,!1);W=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(m.insertCells(this._activeBuffer.x,o-E,this._activeBuffer.getNullCell(g)),m.getWidth(c-1)===2&&m.setCellFromCodepoint(c-1,0,1,g)),m.setCellFromCodepoint(this._activeBuffer.x++,i,o,g),o>0)for(;--o;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=x,this._activeBuffer.x0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>G_(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new q_(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new fr(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,i=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),o),i&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var i;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&i.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let f=c;for(let h=1;h0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(G.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(G.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(G.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(G.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(G.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t(k[k.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",k[k.SET=1]="SET",k[k.RESET=2]="RESET",k[k.PERMANENTLY_SET=3]="PERMANENTLY_SET",k[k.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let i=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:l}=this._coreMouseService,a=this._coreService,{buffers:c,cols:f}=this._bufferService,{active:h,alt:g}=c,m=this._optionsService.rawOptions,x=(k,E)=>(a.triggerDataEvent(`${G.ESC}[${t?"":"?"}${k};${E}$y`),!0),y=k=>k?1:2,S=e.params[0];return t?S===2?x(S,4):S===4?x(S,y(a.modes.insertMode)):S===12?x(S,3):S===20?x(S,y(m.convertEol)):x(S,0):S===1?x(S,y(i.applicationCursorKeys)):S===3?x(S,m.windowOptions.setWinLines?f===80?2:f===132?1:0:0):S===6?x(S,y(i.origin)):S===7?x(S,y(i.wraparound)):S===8?x(S,3):S===9?x(S,y(o==="X10")):S===12?x(S,y(m.cursorBlink)):S===25?x(S,y(!a.isCursorHidden)):S===45?x(S,y(i.reverseWraparound)):S===66?x(S,y(i.applicationKeypad)):S===67?x(S,4):S===1e3?x(S,y(o==="VT200")):S===1002?x(S,y(o==="DRAG")):S===1003?x(S,y(o==="ANY")):S===1004?x(S,y(i.sendFocus)):S===1005?x(S,4):S===1006?x(S,y(l==="SGR")):S===1015?x(S,4):S===1016?x(S,y(l==="SGR_PIXELS")):S===1048?x(S,1):S===47||S===1047||S===1049?x(S,y(h===g)):S===2004?x(S,y(i.bracketedPasteMode)):S===2026?x(S,y(i.synchronizedOutput)):x(S,0)}_updateAttrColor(e,t,r,i,o){return t===2?(e|=50331648,e&=-16777216,e|=$o.fromColorRGB([r,i,o])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let i=[0,0,-1,0,0,0],o=0,l=0;do{if(i[l+o]=e.params[t+l],e.hasSubParams(t+l)){let a=e.getSubParams(t+l),c=0;do i[1]===5&&(o=1),i[l+c+1+o]=a[c];while(++c=2||i[1]===2&&l+o>=5)break;i[1]&&(o=1)}while(++l+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=mt.fg,e.bg=mt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,i=this._curAttrData;for(let o=0;o=30&&r<=37?(i.fg&=-50331904,i.fg|=16777216|r-30):r>=40&&r<=47?(i.bg&=-50331904,i.bg|=16777216|r-40):r>=90&&r<=97?(i.fg&=-50331904,i.fg|=16777216|r-90|8):r>=100&&r<=107?(i.bg&=-50331904,i.bg|=16777216|r-100|8):r===0?this._processSGR0(i):r===1?i.fg|=134217728:r===3?i.bg|=67108864:r===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,i)):r===5?i.fg|=536870912:r===7?i.fg|=67108864:r===8?i.fg|=1073741824:r===9?i.fg|=2147483648:r===2?i.bg|=134217728:r===21?this._processUnderline(2,i):r===22?(i.fg&=-134217729,i.bg&=-134217729):r===23?i.bg&=-67108865:r===24?(i.fg&=-268435457,this._processUnderline(0,i)):r===25?i.fg&=-536870913:r===27?i.fg&=-67108865:r===28?i.fg&=-1073741825:r===29?i.fg&=2147483647:r===39?(i.fg&=-67108864,i.fg|=mt.fg&16777215):r===49?(i.bg&=-67108864,i.bg|=mt.bg&16777215):r===38||r===48||r===58?o+=this._extractColor(e,o,i):r===53?i.bg|=1073741824:r===55?i.bg&=-1073741825:r===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):r===100?(i.fg&=-67108864,i.fg|=mt.fg&16777215,i.bg&=-67108864,i.bg|=mt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${G.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${G.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${G.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=mt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!G_(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${G.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>X_&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>X_&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let i=r.shift(),o=r.shift();if(/^\d+$/.exec(i)){let l=parseInt(i);if(Z_(l))if(o==="?")t.push({type:0,index:l});else{let a=Y_(o);a&&t.push({type:1,index:l,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),i=e.slice(t+1);return i?this._createHyperlink(r,i):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),i,o=r.findIndex(l=>l.startsWith("id="));return o!==-1&&(i=r[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let i=0;i=this._specialColors.length);++i,++t)if(r[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=Y_(r[i]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let i=0;i=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=mt.clone(),this._eraseAttrDataInternal=mt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Lr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${G.ESC}${a}${G.ESC}\\`),!0),i=this._bufferService.buffer,o=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},xd=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(J_=e,e=t,t=J_),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};xd=ut([ue(0,Xt)],xd);function Z_(e){return 0<=e&&e<256}var kP=5e7,ev=12,CP=50,EP=class extends Te{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new oe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r;for(;r=this._writeBuffer.shift();){this._action(r);let i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>kP)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let i=this._writeBuffer[this._bufferOffset],o=this._action(i,t);if(o){let a=c=>performance.now()-r>=ev?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(r,c);o.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(a);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=i.length,performance.now()-r>=ev)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>CP&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},wd=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let c=t.addMarker(t.ybase+t.y),f={data:e,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(f,c)),this._dataByLinkId.set(f.id,f),f.id}let r=e,i=this._getEntryIdKey(r),o=this._entriesWithId.get(i);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let l=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(a,l)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);r.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(r,i))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};wd=ut([ue(0,Xt)],wd);var tv=!1,NP=class extends Te{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ps),this._onBinary=this._register(new oe),this.onBinary=this._onBinary.event,this._onData=this._register(new oe),this.onData=this._onData.event,this._onLineFeed=this._register(new oe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new oe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new oe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new oe),this._instantiationService=new QL,this.optionsService=this._register(new lP(e)),this._instantiationService.setService(Gt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(gd)),this._instantiationService.setService(Xt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(md)),this._instantiationService.setService(my,this._logService),this.coreService=this._register(this._instantiationService.createInstance(_d)),this._instantiationService.setService(Ri,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(vd)),this._instantiationService.setService(py,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(xi)),this._instantiationService.setService(q4,this.unicodeService),this._charsetService=this._instantiationService.createInstance(dP),this._instantiationService.setService(K4,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(wd),this._instantiationService.setService(gy,this._oscLinkService),this._inputHandler=this._register(new bP(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(It.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(It.forward(this._bufferService.onResize,this._onResize)),this._register(It.forward(this.coreService.onData,this._onData)),this._register(It.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new EP((t,r)=>this._inputHandler.parse(t,r))),this._register(It.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new oe),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!tv&&(this._logService.warn("writeSync is unreliable and will be removed soon."),tv=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Yy),t=Math.max(t,Xy),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(K_.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(K_(this._bufferService),!1))),this._windowsWrappingHeuristics.value=tt(()=>{for(let t of e)t.dispose()})}}},LP={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function PP(e,t,r,i){var a;let o={type:0,cancel:!1,key:void 0},l=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?o.key=G.ESC+"OA":o.key=G.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=G.ESC+"OD":o.key=G.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=G.ESC+"OC":o.key=G.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=G.ESC+"OB":o.key=G.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":G.DEL,e.altKey&&(o.key=G.ESC+o.key);break;case 9:if(e.shiftKey){o.key=G.ESC+"[Z";break}o.key=G.HT,o.cancel=!0;break;case 13:o.key=e.altKey?G.ESC+G.CR:G.CR,o.cancel=!0;break;case 27:o.key=G.ESC,e.altKey&&(o.key=G.ESC+G.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;l?o.key=G.ESC+"[1;"+(l+1)+"D":t?o.key=G.ESC+"OD":o.key=G.ESC+"[D";break;case 39:if(e.metaKey)break;l?o.key=G.ESC+"[1;"+(l+1)+"C":t?o.key=G.ESC+"OC":o.key=G.ESC+"[C";break;case 38:if(e.metaKey)break;l?o.key=G.ESC+"[1;"+(l+1)+"A":t?o.key=G.ESC+"OA":o.key=G.ESC+"[A";break;case 40:if(e.metaKey)break;l?o.key=G.ESC+"[1;"+(l+1)+"B":t?o.key=G.ESC+"OB":o.key=G.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=G.ESC+"[2~");break;case 46:l?o.key=G.ESC+"[3;"+(l+1)+"~":o.key=G.ESC+"[3~";break;case 36:l?o.key=G.ESC+"[1;"+(l+1)+"H":t?o.key=G.ESC+"OH":o.key=G.ESC+"[H";break;case 35:l?o.key=G.ESC+"[1;"+(l+1)+"F":t?o.key=G.ESC+"OF":o.key=G.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=G.ESC+"[5;"+(l+1)+"~":o.key=G.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=G.ESC+"[6;"+(l+1)+"~":o.key=G.ESC+"[6~";break;case 112:l?o.key=G.ESC+"[1;"+(l+1)+"P":o.key=G.ESC+"OP";break;case 113:l?o.key=G.ESC+"[1;"+(l+1)+"Q":o.key=G.ESC+"OQ";break;case 114:l?o.key=G.ESC+"[1;"+(l+1)+"R":o.key=G.ESC+"OR";break;case 115:l?o.key=G.ESC+"[1;"+(l+1)+"S":o.key=G.ESC+"OS";break;case 116:l?o.key=G.ESC+"[15;"+(l+1)+"~":o.key=G.ESC+"[15~";break;case 117:l?o.key=G.ESC+"[17;"+(l+1)+"~":o.key=G.ESC+"[17~";break;case 118:l?o.key=G.ESC+"[18;"+(l+1)+"~":o.key=G.ESC+"[18~";break;case 119:l?o.key=G.ESC+"[19;"+(l+1)+"~":o.key=G.ESC+"[19~";break;case 120:l?o.key=G.ESC+"[20;"+(l+1)+"~":o.key=G.ESC+"[20~";break;case 121:l?o.key=G.ESC+"[21;"+(l+1)+"~":o.key=G.ESC+"[21~";break;case 122:l?o.key=G.ESC+"[23;"+(l+1)+"~":o.key=G.ESC+"[23~";break;case 123:l?o.key=G.ESC+"[24;"+(l+1)+"~":o.key=G.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=G.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=G.DEL:e.keyCode===219?o.key=G.ESC:e.keyCode===220?o.key=G.FS:e.keyCode===221&&(o.key=G.GS);else if((!r||i)&&e.altKey&&!e.metaKey){let c=(a=LP[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(c)o.key=G.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){let f=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(f);e.shiftKey&&(h=h.toUpperCase()),o.key=G.ESC+h}else if(e.keyCode===32)o.key=G.ESC+(e.ctrlKey?G.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let f=e.code.slice(3,4);e.shiftKey||(f=f.toLowerCase()),o.key=G.ESC+f,o.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=G.US),e.key==="@"&&(o.key=G.NUL));break}return o}var dt=0,RP=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Oa,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Oa,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((o,l)=>this._getKey(o)-this._getKey(l)),t=0,r=0,i=new Array(this._array.length+this._insertedValues.length);for(let o=0;o=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(i[o]=e[t],t++):i[o]=this._array[r++];this._array=i,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(dt=this._search(t),dt===-1)||this._getKey(this._array[dt])!==t)return!1;do if(this._array[dt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(dt),!0;while(++dto-l),t=0,r=new Array(this._array.length-e.length),i=0;for(let o=0;o0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(dt=this._search(e),!(dt<0||dt>=this._array.length)&&this._getKey(this._array[dt])===e))do yield this._array[dt];while(++dt=this._array.length)&&this._getKey(this._array[dt])===e))do t(this._array[dt]);while(++dt=t;){let i=t+r>>1,o=this._getKey(this._array[i]);if(o>e)r=i-1;else if(o0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Ch=0,rv=0,MP=class extends Te{constructor(){super(),this._decorations=new RP(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new oe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new oe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(tt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new TP(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let i=0,o=0;for(let l of this._decorations.getKeyIterator(t))i=l.options.x??0,o=i+(l.options.width??1),e>=i&&e{Ch=o.options.x??0,rv=Ch+(o.options.width??1),e>=Ch&&e=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=i-this._lastRefreshMs,l=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},nv=20,Fa=class extends Te{constructor(e,t,r,i){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=i,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;lthis._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new AP(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ee(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(tt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===nv+1&&(this._liveRegion.textContent+=Hh.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,i=r.lines.length.toString();for(let o=e;o<=t;o++){let l=r.lines.get(r.ydisp+o),a=[],c=(l==null?void 0:l.translateToString(!0,void 0,void 0,a))||"",f=(r.ydisp+o+1).toString(),h=this._rowElements[o];h&&(c.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=c,this._rowColumns.set(h,a)),h.setAttribute("aria-posinset",f),h.setAttribute("aria-setsize",i),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,i=this._rowElements[t===0?1:this._rowElements.length-2],o=r.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===l||e.relatedTarget!==i)return;let a,c;if(t===0?(a=r,c=this._rowElements.pop(),this._rowContainer.removeChild(c)):(a=this._rowElements.shift(),c=r,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),c.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{let f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var c;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let i=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:i,offset:((c=i.textContent)==null?void 0:c.length)??0}),!this._rowContainer.contains(r.node))return;let o=({node:f,offset:h})=>{let g=f instanceof Text?f.parentNode:f,m=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let x=this._rowColumns.get(g);if(!x)return console.warn("columns is null. Race condition?"),null;let y=h=this._terminal.cols&&(++m,y=0),{row:m,column:y}},l=o(t),a=o(r);if(!(!l||!a)){if(l.row>a.row||l.row===a.row&&l.column>=a.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(a.row-l.row)*this._terminal.cols-l.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{var l;Ei(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ee(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ee(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ee(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ee(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let i=0;i{l==null||l.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[l,a]of this._linkProviderService.linkProviders.entries())t?(o=this._activeProviderReplies)!=null&&o.get(l)&&(r=this._checkLinkProviderResult(l,e,r)):a.provideLinks(e.y,c=>{var h,g;if(this._isMouseOut)return;let f=c==null?void 0:c.map(m=>({link:m}));(h=this._activeProviderReplies)==null||h.set(l,f),r=this._checkLinkProviderResult(l,e,r),((g=this._activeProviderReplies)==null?void 0:g.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let i=0;ie?this._bufferService.cols:a.link.range.end.x;for(let h=c;h<=f;h++){if(r.has(h)){o.splice(l--,1);break}r.add(h)}}}}_checkLinkProviderResult(e,t,r){var l;if(!this._activeProviderReplies)return r;let i=this._activeProviderReplies.get(e),o=!1;for(let a=0;athis._linkAtPosition(c.link,t));a&&(r=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let a=0;athis._linkAtPosition(f.link,t));if(c){r=!0,this._handleNewLink(c);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&BP(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ei(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.pointerCursor},set:r=>{var i;(i=this._currentLink)!=null&&i.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.underline},set:r=>{var i,o,l;(i=this._currentLink)!=null&&i.state&&((l=(o=this._currentLink)==null?void 0:o.state)==null?void 0:l.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let i=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return r<=o&&o<=i}_positionFromMouseEvent(e,t,r){let i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,i,o){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:o}}};Sd=ut([ue(1,tf),ue(2,wn),ue(3,Xt),ue(4,vy)],Sd);function BP(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var IP=class extends NP{constructor(e={}){super(e),this._linkifier=this._register(new ps),this.browser=jy,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ps),this._onCursorMove=this._register(new oe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new oe),this.onKey=this._onKey.event,this._onRender=this._register(new oe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new oe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new oe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new oe),this.onBell=this._onBell.event,this._onFocus=this._register(new oe),this._onBlur=this._register(new oe),this._onA11yCharEmitter=this._register(new oe),this._onA11yTabEmitter=this._register(new oe),this._onWillOpen=this._register(new oe),this._setup(),this._decorationService=this._instantiationService.createInstance(MP),this._instantiationService.setService(Wo,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(CL),this._instantiationService.setService(vy,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Wh)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(It.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(It.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(It.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(It.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(tt(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let r,i="";switch(t.index){case 256:r="foreground",i="10";break;case 257:r="background",i="11";break;case 258:r="cursor",i="12";break;default:r="ansi",i="4;"+t.index}switch(t.type){case 0:let o=Ze.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${G.ESC}]${i};${wP(o)}${By.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=gt.toColor(...t.color));else{let l=r;this._themeService.modifyColors(a=>a[l]=gt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Fa,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,o=t.getWidth(r),l=this._renderService.dimensions.css.cell.width*o,a=this.buffer.y*this._renderService.dimensions.css.cell.height,c=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"px",this.textarea.style.top=a+"px",this.textarea.style.width=l+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ee(this.element,"copy",t=>{this.hasSelection()&&F4(t,this._selectionService)}));let e=t=>H4(t,this.textarea,this.coreService,this.optionsService);this._register(Ee(this.textarea,"paste",e)),this._register(Ee(this.element,"paste",e)),zy?this._register(Ee(this.element,"mousedown",t=>{t.button===2&&f_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ee(this.element,"contextmenu",t=>{f_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),cf&&this._register(Ee(this.element,"auxclick",t=>{t.button===1&&uy(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ee(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ee(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ee(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ee(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ee(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ee(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ee(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((o=this.element)==null?void 0:o.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ee(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Fh.get()),Hy||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(bL,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(xn,this._coreBrowserService),this._register(Ee(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(Ee(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(cd,this._document,this._helperContainer),this._instantiationService.setService(Ja,this._charSizeService),this._themeService=this._instantiationService.createInstance(pd),this._instantiationService.setService(vs,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ja),this._instantiationService.setService(_y,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(dd,this.rows,this.screenElement)),this._instantiationService.setService(wn,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ld,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(hd),this._instantiationService.setService(tf,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(Sd,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(sd,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(fd,this.element,this.screenElement,i)),this._instantiationService.setService(X4,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(It.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var l;this._selectionService.refresh(),(l=this._viewport)==null||l.queueSync()})),this._register(this._instantiationService.createInstance(od,this.screenElement)),this._register(Ee(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Fa,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ia,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ia,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ud,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(l){var h,g,m,x,y;let a=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!a)return!1;let c,f;switch(l.overrideType||l.type){case"mousemove":f=32,l.buttons===void 0?(c=3,l.button!==void 0&&(c=l.button<3?l.button:3)):c=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":f=0,c=l.button<3?l.button:3;break;case"mousedown":f=1,c=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let S=l.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(l,(x=(m=(g=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:g.device)==null?void 0:m.cell)==null?void 0:x.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;f=S<0?0:1,c=4;break;default:return!1}return f===void 0||c===void 0||c>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:c,action:f,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(r(l),l.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.mousedrag)),this.cancel(l)),wheel:l=>(r(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&r(l)},mousemove:l=>{l.buttons||r(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),l&8?i.mousemove||(t.addEventListener("mousemove",o.mousemove),i.mousemove=o.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),l&16?i.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),i.wheel=o.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),l&2?i.mouseup||(i.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),l&4?i.mousedrag||(i.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ee(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return r(l),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(l)})),this._register(Ee(t,"wheel",l=>{var a,c,f,h,g;if(!i.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,(h=(f=(c=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:c.device)==null?void 0:f.cell)==null?void 0:h.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(l,!0);let m=G.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){ay(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,r){this._selectionService.setSelection(e,t,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=PP(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let i=this.rows-1;return this.scrollLines(r.type===2?-i:i),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r.key===G.ETX||r.key===G.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(jP(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Lr)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},iv=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new OP(t)}getNullCell(){return new Lr}},FP=class extends Te{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new oe),this.onBufferChange=this._onBufferChange.event,this._normal=new iv(this._core.buffers.normal,"normal"),this._alternate=new iv(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},HP=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,i)=>t(r,i.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},$P=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},WP=["cols","rows"],Vr=0,UP=class extends Te{constructor(e){super(),this._core=this._register(new IP(e)),this._addonManager=this._register(new zP),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],r=(i,o)=>{this._checkReadonlyOptions(i),this._core.options[i]=o};for(let i in this._core.options){let o={get:t.bind(this,i),set:r.bind(this,i)};Object.defineProperty(this._publicOptions,i,o)}}_checkReadonlyOptions(e){if(WP.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new HP(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new $P(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new FP(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r +`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Fh.get()},set promptLabel(e){Fh.set(e)},get tooMuchOutput(){return Hh.get()},set tooMuchOutput(e){Hh.set(e)}}}_verifyIntegers(...e){for(Vr of e)if(Vr===1/0||isNaN(Vr)||Vr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Vr of e)if(Vr&&(Vr===1/0||isNaN(Vr)||Vr%1!==0||Vr<0))throw new Error("This API only accepts positive integers")}};const ga="main-repl";function VP(){return new UP({cursorBlink:!0,fontFamily:"JetBrains Mono, Consolas, ui-monospace, SFMono-Regular, monospace",fontSize:13,lineHeight:1.25,scrollback:8e3,convertEol:!1,allowProposedApi:!0,theme:{background:"#060a0d",foreground:"#d7e1e8",cursor:"#33d17a",selectionBackground:"#1f6feb55",black:"#0b1117",red:"#ff6b6b",green:"#33d17a",yellow:"#f4d35e",blue:"#4ea1ff",magenta:"#c778dd",cyan:"#56b6c2",white:"#d7e1e8",brightBlack:"#5c6773",brightRed:"#ff8a8a",brightGreen:"#5ee08f",brightYellow:"#ffe08a",brightBlue:"#79b8ff",brightMagenta:"#d8a4ec",brightCyan:"#7fd5df",brightWhite:"#ffffff"}})}function KP(e){if(typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}function qP(e,t){if(t.data){e.write(t.data);return}if(!t.data_b64)return;const r=atob(t.data_b64),i=new Uint8Array(r.length);for(let o=0;o{const i=r.findIndex(l=>l.id===t.id);if(i<0)return[...r,t];const o=r.slice();return o[i]={...o[i],...t},o})}function tu(e){return e.kind==="repl"?"Main REPL":e.name||e.command||e.id}function XP(e){return e.kind==="repl"?"console":e.kind||"task"}function lv(e){return[`title: ${tu(e)}`,`id: ${e.id}`,e.kind?`kind: ${e.kind}`:"",e.state?`state: ${hf(e.state)||e.state}`:"",e.command?`command: ${e.command}`:"",Jy(e.pid)?`pid: ${e.pid}`:"",e.started_at?`started: ${wi(e.started_at)}`:"",e.last_activity_at?`activity: ${wi(e.last_activity_at)}`:"",e.ended_at?`ended: ${wi(e.ended_at)}`:"",e.state!=="running"&&typeof e.exit_code=="number"?`exit: ${e.exit_code}`:"",e.kill_cause?`kill: ${e.kill_cause}`:"",typeof e.output_bytes=="number"?`output: ${Zy(e.output_bytes)}`:"",typeof e.activity_seq=="number"?`activity seq: ${e.activity_seq}`:""].filter(Boolean).join(` +`)}function av(e){return typeof e.activity_seq=="number"&&Number.isFinite(e.activity_seq)?e.activity_seq:0}function GP(e,t){const r=uv(e.state)-uv(t.state);return r!==0?r:cv(t)-cv(e)}function uv(e){switch(e){case"running":return 0;case"failed":case"killed":return 1;case"completed":return 2;default:return 3}}function cv(e){const t=e.last_activity_at||e.ended_at||e.started_at;if(!t)return 0;const r=new Date(t).getTime();return Number.isFinite(r)?r:0}function hf(e){switch(e){case"running":return"running";case"completed":return"closed";case"failed":return"failed";case"killed":return"killed";default:return""}}function QP(e){switch(e){case"running":return"text-cyber-700 dark:text-cyber-300";case"completed":return"text-muted-foreground";case"failed":case"killed":return"text-destructive";default:return"text-yellow-700 dark:text-yellow-300"}}function JP(e){switch(e){case"connected":return"bg-cyber-400/10 text-cyber-700 dark:text-cyber-300";case"error":return"bg-destructive/10 text-destructive";case"closed":return"bg-muted text-muted-foreground";default:return"bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"}}function ZP(e){switch(e){case"running":case"ready":return"text-cyber-400";case"completed":return"text-muted-foreground";case"killed":case"failed":return"text-destructive";default:return"text-yellow-400"}}function wi(e){if(e)try{const t=new Date(e);return!Number.isFinite(t.getTime())||t.getFullYear()<=1?void 0:t.toLocaleString()}catch{return e}}function Jy(e){return typeof e=="number"&&e>0?e:void 0}function Zy(e){if(typeof e!="number"||!Number.isFinite(e))return;if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let r=e/1024;for(const i of t){if(r<1024)return`${r.toFixed(r>=10?0:1)} ${i}`;r/=1024}return`${r.toFixed(1)} TB`}function eR({activeID:e,replSession:t,summary:r,taskSessions:i,unreadIDs:o,onAttachRepl:l,onAttach:a}){return _.jsxs("aside",{className:"flex max-h-64 w-full shrink-0 flex-col border-b border-border lg:max-h-none lg:w-64 lg:border-b-0 lg:border-r",children:[_.jsx("div",{className:"border-b border-border p-2",children:_.jsx(hv,{active:!!t&&t.id===e,title:"Main REPL",meta:t?"always on":"starting",state:(t==null?void 0:t.state)||"running",details:t?lv(t):"Main REPL is starting",unread:t?t.id!==e&&o.has(t.id):!1,onClick:l})}),_.jsxs("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3 text-[10px] uppercase text-muted-foreground",children:[_.jsx("span",{children:"Tasks"}),_.jsxs("span",{className:"truncate",children:[r.running," running",r.updates?` · ${r.updates} new`:""]})]}),_.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-2",children:i.length===0?_.jsx("div",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No tasks yet"}):i.map(c=>_.jsx(hv,{active:c.id===e,title:tu(c),meta:XP(c),command:c.command,state:c.state||"unknown",details:lv(c),unread:c.id!==e&&o.has(c.id),onClick:()=>a(c)},c.id))})]})}function hv({active:e,command:t,details:r,meta:i,onClick:o,state:l,title:a,unread:c}){return _.jsxs("button",{type:"button",onClick:o,title:r,className:je("mb-1 flex w-full items-start gap-2 rounded-md px-2 py-2 text-left text-xs transition-colors",e?"bg-cyber-400/10 text-foreground":c?"bg-cyber-400/5 text-foreground hover:bg-cyber-400/10":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[_.jsxs("span",{className:"relative mt-1 shrink-0",children:[_.jsx(vv,{className:je("h-2.5 w-2.5 fill-current",ZP(l))}),c&&_.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-cyber-400"})]}),_.jsxs("span",{className:"min-w-0 flex-1",children:[_.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[_.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a}),_.jsx("span",{className:je("shrink-0 text-[10px]",QP(l)),children:hf(l)})]}),_.jsx("span",{className:"mt-0.5 block truncate font-mono",children:i}),t&&_.jsx("span",{className:"mt-0.5 block truncate font-mono opacity-70",children:t})]})]})}function tR({agent:e,onClose:t,session:r,status:i,taskSessions:o}){var h,g;const l=e.identity||{},a=e.stats||{},c=o.filter(m=>m.state==="running").length,f=o.length-c;return _.jsxs("aside",{className:"flex max-h-72 w-full shrink-0 flex-col border-t border-border bg-card lg:max-h-none lg:w-80 lg:border-l lg:border-t-0",children:[_.jsxs("div",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border px-3",children:[_.jsx("span",{className:"text-xs font-medium uppercase text-muted-foreground",children:"Details"}),_.jsx(rR,{label:"Close details",onClick:t,children:_.jsx(jo,{className:"h-3.5 w-3.5"})})]}),_.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-3 text-xs",children:[_.jsxs(_a,{title:"Agent",children:[_.jsx(Be,{label:"Name",value:e.name}),_.jsx(Be,{label:"ID",value:e.id,mono:!0}),_.jsx(Be,{label:"State",value:e.busy?"busy":"idle"}),_.jsx(Be,{label:"Connected",value:wi(e.connected_at)}),_.jsx(Be,{label:"Host",value:l.hostname}),_.jsx(Be,{label:"User",value:l.username}),_.jsx(Be,{label:"Runtime",value:[l.os,l.arch].filter(Boolean).join("/")}),_.jsx(Be,{label:"PID",value:l.pid}),_.jsx(Be,{label:"CWD",value:l.working_dir,mono:!0}),_.jsx(Be,{label:"LLM",value:[l.provider,l.model].filter(Boolean).join(" / ")||"offline"}),_.jsx(Be,{label:"Space",value:l.space})]}),_.jsxs(_a,{title:"Active Session",children:[_.jsx(Be,{label:"Console",value:i}),r?_.jsxs(_.Fragment,{children:[_.jsx(Be,{label:"Title",value:tu(r)}),_.jsx(Be,{label:"ID",value:r.id,mono:!0}),_.jsx(Be,{label:"Kind",value:r.kind}),_.jsx(Be,{label:"State",value:hf(r.state||"")||r.state}),_.jsx(Be,{label:"Command",value:r.command,mono:!0}),_.jsx(Be,{label:"PID",value:Jy(r.pid)}),_.jsx(Be,{label:"Started",value:wi(r.started_at)}),_.jsx(Be,{label:"Activity",value:wi(r.last_activity_at)}),_.jsx(Be,{label:"Ended",value:wi(r.ended_at)}),_.jsx(Be,{label:"Exit",value:r.state==="running"?void 0:r.exit_code}),_.jsx(Be,{label:"Kill",value:r.kill_cause}),_.jsx(Be,{label:"Output",value:Zy(r.output_bytes)})]}):_.jsx(Be,{label:"State",value:"starting"})]}),_.jsxs(_a,{title:"Tasks",children:[_.jsx(Be,{label:"Total",value:o.length}),_.jsx(Be,{label:"Running",value:c}),_.jsx(Be,{label:"Closed",value:f}),_.jsx(Be,{label:"Commands",value:(h=e.commands)==null?void 0:h.join(", ")}),_.jsx(Be,{label:"Capabilities",value:(g=l.capabilities)==null?void 0:g.join(", ")})]}),_.jsxs(_a,{title:"Stats",children:[_.jsx(Be,{label:"Turns",value:a.turns}),_.jsx(Be,{label:"Tools",value:a.tool_calls}),_.jsx(Be,{label:"Running",value:a.running_tools}),_.jsx(Be,{label:"Tokens",value:a.total_tokens}),_.jsx(Be,{label:"Assets",value:a.assets}),_.jsx(Be,{label:"Loots",value:a.loots}),_.jsx(Be,{label:"Last",value:a.last_event})]})]})]})}function rR({children:e,label:t,onClick:r}){return _.jsx(hs,{content:t,side:"bottom",children:_.jsx("button",{type:"button","aria-label":t,title:t,onClick:r,className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",children:e})})}function _a({children:e,title:t}){return _.jsxs("section",{className:"mb-4 last:mb-0",children:[_.jsx("div",{className:"mb-2 text-[10px] font-medium uppercase text-muted-foreground",children:t}),_.jsx("div",{className:"space-y-1.5",children:e})]})}function Be({label:e,mono:t,value:r}){return r==null||r===""?null:_.jsxs("div",{className:"grid grid-cols-[76px_minmax(0,1fr)] gap-2",children:[_.jsx("div",{className:"text-muted-foreground",children:e}),_.jsx("div",{className:je("min-w-0 break-words text-foreground",t&&"font-mono"),children:r})]})}function nR({agent:e}){const[t,r]=te.useState("connecting"),[i,o]=te.useState([]),[l,a]=te.useState(""),[c,f]=te.useState(()=>new Set),[h,g]=te.useState(!1),m=te.useRef(""),x=te.useRef({}),y=te.useRef(!1),S=te.useRef(null),k=te.useRef(null),E=te.useRef(null),L=te.useRef(null),W=te.useMemo(()=>i.find(q=>q.kind==="repl"&&(q.name===ga||!q.name))||i.find(q=>q.kind==="repl")||null,[i]),z=te.useMemo(()=>i.filter(q=>q.kind!=="repl").slice().sort(GP),[i]),Y=te.useMemo(()=>{let q=0,b=0;for(const P of z)P.state==="running"&&(q+=1),P.id!==l&&c.has(P.id)&&(b+=1);return{running:q,updates:b}},[l,z,c]),U=te.useMemo(()=>i.find(q=>q.id===l)||null,[l,i]);te.useEffect(()=>{m.current=l},[l]),te.useEffect(()=>{const q=L.current;if(!q)return;r("connecting"),o([]),a(""),f(new Set),m.current="",x.current={},y.current=!1;const b=VP(),P=new B4;b.loadAddon(P),b.open(q),P.fit(),b.focus(),k.current=b,E.current=P;const V=new WebSocket(L4(e.id));S.current=V;const C=ye=>{V.readyState===WebSocket.OPEN&&V.send(JSON.stringify(ye))},ae=()=>({cols:b.cols,rows:b.rows}),ve=b.onData(ye=>{m.current&&C({type:"pty.input",payload:{session_id:m.current,data:ye}})}),pe=b.onResize(({cols:ye,rows:xe})=>{m.current&&C({type:"pty.resize",payload:{session_id:m.current,cols:ye,rows:xe}})}),Pe=new ResizeObserver(()=>P.fit());return Pe.observe(q),V.onopen=()=>{r("connected"),C({type:"pty.open",payload:{kind:"repl",name:ga,singleton:!0,...ae()}}),C({type:"pty.list"})},V.onmessage=ye=>{const xe=KP(ye.data);if(xe)switch(xe.type){case"pty.sessions":F(YP(xe));break;case"pty.opened":case"pty.attached":{const Fe=Po(xe,"session_id"),Ye=sv(xe);Ye&&ov(o,Ye),Fe&&(m.current=Fe,a(Fe),K(Fe,Ye)),r("connected"),C({type:"pty.list"}),b.focus();break}case"pty.output":qP(b,xe),K(m.current);break;case"pty.closed":{const Fe=Po(xe,"session_id"),Ye=sv(xe);if(Ye&&ov(o,Ye),Fe===m.current){if(K(Fe,Ye),(Ye==null?void 0:Ye.kind)==="repl"){r("connected"),he(),C({type:"pty.open",payload:{kind:"repl",name:ga,singleton:!0,...ae()}}),C({type:"pty.list"});break}r("closed"),b.write(`\r [session closed]\r `)}C({type:"pty.list"});break}case"pty.detached":m.current="",a("");break;case"pty.error":r("error"),b.write(`\r [pty error] ${xe.data||"unknown error"}\r -`);break}},U.onerror=()=>r("error"),U.onclose=()=>r(ye=>ye==="error"?ye:"closed"),()=>{U.readyState===WebSocket.OPEN&&U.send(JSON.stringify({type:"pty.detach"})),U.close(),Le.disconnect(),fe.dispose(),ve.dispose(),b.dispose(),S.current=null,k.current=null,E.current=null}},[e.id]);function A(K){var b;((b=S.current)==null?void 0:b.readyState)===WebSocket.OPEN&&S.current.send(JSON.stringify(K))}function le(){const K=k.current;return K?{cols:K.cols,rows:K.rows}:{cols:80,rows:24}}function he(){var K;(K=k.current)==null||K.reset()}function ge(){A({type:"pty.list"})}function F(K){o(K),f(b=>{const P=new Set(b),U=new Set(K.map(C=>C.id));for(const C of P)U.has(C)||P.delete(C);for(const C of K){const ae=ov(C),ve=x.current[C.id];if(!y.current){x.current[C.id]=ae,P.delete(C.id);continue}if(C.id===m.current){x.current[C.id]=ae,P.delete(C.id);continue}if(ve===void 0){x.current[C.id]=ae,ae>0&&P.add(C.id);continue}ae>ve&&(x.current[C.id]=ae,P.add(C.id))}return y.current=!0,P})}function V(K,b){if(!K)return;const P=b||i.find(U=>U.id===K);P&&(x.current[K]=ov(P)),f(U=>{if(!U.has(K))return U;const C=new Set(U);return C.delete(K),C})}function T(){if(W){H(W);return}he(),A({type:"pty.open",payload:{kind:"repl",name:ga,singleton:!0,...le()}})}function D(){he(),m.current="",a(""),A({type:"pty.detach"}),A({type:"pty.open",payload:{kind:"shell",name:`shell-${e.name}`,...le()}})}function H(K){K.id&&(he(),m.current=K.id,a(K.id),V(K.id,K),A({type:"pty.attach",payload:{session_id:K.id,...le()}}))}function j(){!l||(Q==null?void 0:Q.kind)==="repl"||A({type:"pty.kill",payload:{session_id:l}})}const G=Q?tu(Q):l,re=(Q==null?void 0:Q.kind)!=="repl"&&(Q==null?void 0:Q.state)==="running",I=Q||W;return _.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[_.jsx(ZP,{status:t,title:G||"Console",actions:_.jsxs(_.Fragment,{children:[_.jsx(va,{label:"New shell PTY",onClick:D,children:_.jsx(Sw,{className:"h-3.5 w-3.5"})}),_.jsx(va,{label:"Refresh sessions",onClick:ge,children:_.jsx(Sv,{className:"h-3.5 w-3.5"})}),_.jsx(va,{label:"Stop active task",onClick:j,disabled:!re,children:_.jsx(Cw,{className:"h-3.5 w-3.5"})}),_.jsx(va,{label:h?"Hide details":"Show details",onClick:()=>g(K=>!K),active:h,children:_.jsx(xv,{className:"h-3.5 w-3.5"})})]})}),_.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col lg:flex-row",children:[_.jsx(XP,{activeID:l,replSession:W,summary:q,taskSessions:z,unreadIDs:c,onAttachRepl:T,onAttach:H}),_.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:_.jsx("div",{ref:L,className:"min-h-0 min-w-0 flex-1 bg-[#060a0d] p-2"})}),h&&_.jsx(GP,{agent:e,session:I,status:t,taskSessions:z,onClose:()=>g(!1)})]})]})}function ZP({actions:e,status:t,title:r}){return _.jsxs("div",{className:"flex h-11 min-w-0 shrink-0 items-center justify-between border-b border-border px-3",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-2",title:r,children:[_.jsx(Cv,{className:"h-4 w-4 shrink-0 text-cyber-400"}),_.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:r}),_.jsx("span",{className:je("shrink-0 rounded px-1.5 py-0.5 text-[10px]",qP(t)),children:t})]}),e&&_.jsx("div",{className:"flex items-center gap-1",children:e})]})}function va({children:e,active:t,disabled:r,label:i,onClick:o}){return _.jsx(hs,{content:i,side:"bottom",children:_.jsx("button",{type:"button","aria-label":i,title:i,disabled:r,onClick:o,className:je("inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40",t&&"bg-cyber-400/10 text-cyber-700 dark:text-cyber-300"),children:e})})}function eR({open:e,onClose:t}){const{agents:r,error:i,loading:o,refresh:l,selected:a,selectedID:c,setSelectedID:f}=tR(e),h=r.length>1;return e?_.jsx("div",{className:"fixed inset-0 z-50 flex justify-end bg-background/70 backdrop-blur-sm",children:_.jsxs("div",{className:"flex h-full w-full max-w-7xl flex-col border-l border-border bg-card shadow-xl",children:[_.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border px-4",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[_.jsx(La,{className:"h-4 w-4 shrink-0 text-cyber-400"}),_.jsxs("div",{className:"min-w-0",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[_.jsx("span",{className:"text-sm font-medium text-foreground",children:"Agent Console"}),_.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r.length})]}),_.jsx("div",{className:"truncate text-xs text-muted-foreground",title:a?Gy(a):void 0,children:a?`${a.name} · ${a.busy?"busy":"idle"}`:"No agent selected"})]})]}),_.jsx("button",{type:"button",onClick:t,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Close agents",children:_.jsx(jo,{className:"h-4 w-4"})})]}),_.jsx("div",{className:"min-h-0 flex-1",children:o?_.jsx("div",{className:"flex h-32 items-center justify-center text-muted-foreground",children:_.jsx(Na,{className:"h-5 w-5 animate-spin"})}):i?_.jsx("div",{className:"m-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:i}):r.length===0?_.jsxs("div",{className:"flex h-32 flex-col items-center justify-center gap-2 text-muted-foreground",children:[_.jsx(La,{className:"h-8 w-8 opacity-20"}),_.jsx("p",{className:"text-sm",children:"No agents connected"})]}):_.jsxs("div",{className:"flex h-full min-h-0 flex-col lg:flex-row",children:[h&&_.jsx(rR,{agents:r,selectedID:c,onRefresh:()=>l(!0),onSelect:f}),_.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:a&&_.jsx(JP,{agent:a})})]})})]})}):null}function tR(e){const[t,r]=te.useState([]),[i,o]=te.useState(!1),[l,a]=te.useState(""),[c,f]=te.useState(""),h=te.useCallback((m=!1)=>(m||(o(!0),a("")),v4().then(x=>{r(x),f(y=>{var S;return x.some(k=>k.id===y)?y:((S=x[0])==null?void 0:S.id)||""})}).catch(x=>{m||a(x.message||"Failed to load agents")}).finally(()=>{m||o(!1)})),[]);te.useEffect(()=>{e&&h()},[e,h]),te.useEffect(()=>{if(!e)return;const m=setInterval(()=>h(!0),5e3);return()=>clearInterval(m)},[e,h]);const g=t.find(m=>m.id===c)||t[0]||null;return{agents:t,error:l,loading:i,refresh:h,selected:g,selectedID:c,setSelectedID:f}}function rR({agents:e,onRefresh:t,onSelect:r,selectedID:i}){return _.jsxs("aside",{className:"flex max-h-52 w-full shrink-0 flex-col border-b border-border lg:max-h-none lg:w-64 lg:border-b-0 lg:border-r",children:[_.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:[_.jsx("span",{className:"text-xs font-medium uppercase text-muted-foreground",children:"Agents"}),_.jsx("button",{type:"button",onClick:t,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Refresh agents",children:_.jsx(Sv,{className:"h-3.5 w-3.5"})})]}),_.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-2",children:e.map(o=>_.jsxs("button",{type:"button",onClick:()=>r(o.id),title:Gy(o),className:je("mb-1 flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors",i===o.id?"bg-cyber-400/10 text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[_.jsx(gv,{className:je("mt-1 h-2.5 w-2.5 shrink-0 fill-current",o.busy?"text-yellow-400":"text-cyber-400")}),_.jsxs("span",{className:"min-w-0 flex-1",children:[_.jsx("span",{className:"block truncate text-sm font-medium",children:o.name}),_.jsxs("span",{className:"mt-0.5 block truncate text-xs",children:[o.busy?"busy":"idle"," · ",iR(o.connected_at)]})]})]},o.id))})]})}function Gy(e){var o,l;const t=e.identity||{},r=e.stats||{};return[`name: ${e.name}`,`id: ${e.id}`,`state: ${e.busy?"busy":"idle"}`,`connected: ${nR(e.connected_at)}`,t.hostname?`host: ${t.hostname}`:"",t.username?`user: ${t.username}`:"",t.working_dir?`cwd: ${t.working_dir}`:"",t.os||t.arch?`runtime: ${[t.os,t.arch].filter(Boolean).join("/")}`:"",t.pid?`pid: ${t.pid}`:"",t.provider||t.model?`llm: ${[t.provider,t.model].filter(Boolean).join(" / ")}`:"",(o=e.commands)!=null&&o.length?`commands: ${e.commands.join(", ")}`:"",(l=t.capabilities)!=null&&l.length?`capabilities: ${t.capabilities.join(", ")}`:"",typeof r.turns=="number"?`turns: ${r.turns}`:"",typeof r.tool_calls=="number"?`tool calls: ${r.tool_calls}`:"",typeof r.total_tokens=="number"?`tokens: ${r.total_tokens}`:""].filter(Boolean).join(` -`)}function nR(e){try{return new Date(e).toLocaleString()}catch{return e}}function iR(e){try{const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}catch{return""}}const Qy="aiscan-theme";function sR(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(Qy);return e==="light"||e==="dark"?e:"dark"}function oR(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}function lR(){const[e,t]=te.useState(sR),r=e==="dark";return te.useEffect(()=>{oR(e),window.localStorage.setItem(Qy,e)},[e]),_.jsx(hs,{content:r?"Switch to light theme":"Switch to dark theme",side:"bottom",children:_.jsx(Jn,{type:"button",variant:"outline",size:"icon","aria-label":r?"Switch to light theme":"Switch to dark theme",onClick:()=>t(r?"light":"dark"),className:"h-10 w-10 shrink-0",children:r?_.jsx(Ew,{className:"h-4 w-4"}):_.jsx(_w,{className:"h-4 w-4"})})})}const Jy="scans";function aR(e){const t=e.split("/").filter(Boolean);if(t.length<2||t[0]!==Jy)return null;try{return decodeURIComponent(t[1])}catch{return t[1]}}function uR(e){return e===""||e==="/"}function cR(e){return`/${Jy}/${encodeURIComponent(e)}`}function hR(e,t){dR(cR(e),t)}function dR(e,t){t==="none"||`${window.location.pathname}${window.location.search}${window.location.hash}`===e||(t==="replace"?window.history.replaceState({},"",e):window.history.pushState({},"",e))}function fR(){const[e,t]=te.useState([]),[r,i]=te.useState(null),[o,l]=te.useState([]),[a,c]=te.useState(""),[f,h]=te.useState(null),[g,m]=te.useState(!1),[x,y]=te.useState(""),[S,k]=te.useState(!1),E=te.useRef(null),L=te.useRef(0),W=te.useCallback(async()=>{try{t(await S4())}catch{}},[]);te.useEffect(()=>{W()},[W]);function z(){E.current&&(E.current(),E.current=null)}async function q(V,T,D){const H=++L.current;y(""),l([]),c(""),h(null),m(!0),k(!1);try{const j=await w4(V,T,D);if(H!==L.current)return;W(),await le(j,"push",H)}catch(j){if(H!==L.current)return;y(j.message||"Failed to submit scan"),m(!1)}}function Q(V){z(),E.current=b4(V,T=>{if(T.type==="progress"&&T.data){l(D=>[...D,T.data]),T.result&&(h(T.result),i(D=>(D==null?void 0:D.id)===V?{...D,result:T.result}:D));return}if(T.type==="status"&&T.status){i(D=>(D==null?void 0:D.id)===V?{...D,status:T.status,updated_at:new Date().toISOString()}:D);return}if(T.type==="complete"){m(!1),k(!0),y(""),T.result&&h(T.result),i(D=>(D==null?void 0:D.id)===V?{...D,status:"completed",result:T.result||D.result,updated_at:new Date().toISOString()}:D),W(),T.result||A(V);return}T.type==="error"&&(m(!1),i(D=>(D==null?void 0:D.id)===V?{...D,status:"failed",error:T.error||"Scan failed",updated_at:new Date().toISOString()}:D),y(T.error||"Scan failed"),W())})}async function A(V,T){try{const D=await Oh(V);if(T&&T!==L.current)return;D.result&&h(D.result),D.report&&c(D.report),i(H=>(H==null?void 0:H.id)===V?{...H,...D}:H)}catch{}}async function le(V,T,D=++L.current){hR(V.id,T),z(),i(V),y(""),l([]),h(V.result||null),c(V.status==="completed"&&V.report?V.report:""),k(!1),m(V.status==="queued"||V.status==="running"),V.status==="completed"?(m(!1),k(!0),V.result||await A(V.id,D)):V.status==="queued"||V.status==="running"?Q(V.id):(m(!1),c(""))}async function he(V,T){const D=++L.current;y("");try{const H=await Oh(V);if(D!==L.current)return;await le(H,T,D)}catch{if(D!==L.current)return;ge(),y(`Scan ${V} was not found`)}}function ge(){L.current+=1,z(),i(null),l([]),c(""),h(null),m(!1),k(!1)}function F(){ge(),y("")}return te.useEffect(()=>{const V=()=>{const T=aR(window.location.pathname);if(T){he(T,"none");return}uR(window.location.pathname)&&F()};return V(),window.addEventListener("popstate",V),()=>{window.removeEventListener("popstate",V),z()}},[]),{scans:e,activeScan:r,progressLines:o,report:a,result:f,scanning:g,error:x,logCollapsed:S,refreshScans:W,submit:q,selectScan:V=>le(V,"push"),clearError:()=>y(""),toggleLog:()=>k(V=>!V)}}const Zy="aiscan-sidebar-open";function pR(){if(typeof window>"u")return!0;if(window.matchMedia("(max-width: 767px)").matches)return!1;const e=window.localStorage.getItem(Zy);return e==="true"||e==="false"?e==="true":window.matchMedia("(min-width: 1024px)").matches}function mR(){var x;const e=fR(),[t,r]=te.useState(!0),[i,o]=te.useState(null),[l,a]=te.useState(!1),[c,f]=te.useState(!1),[h,g]=te.useState(pR),m=te.useCallback(async()=>{try{const y=await _4();o(y),r(y.llm_available)}catch{r(!0)}},[]);return te.useEffect(()=>{m()},[m]),te.useEffect(()=>{window.localStorage.setItem(Zy,String(h))},[h]),_.jsxs("div",{className:"flex min-h-screen bg-background",children:[_.jsx(mS,{open:h,onToggle:()=>g(!h),scans:e.scans,activeId:(x=e.activeScan)==null?void 0:x.id,onSelectScan:e.selectScan}),_.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[_.jsx("div",{className:"sticky top-0 z-20 border-b border-border bg-card/85 p-3 shadow-sm backdrop-blur-sm sm:p-4",children:_.jsx(_S,{onSubmit:e.submit,disabled:e.scanning,analysisAvailable:t,status:_.jsx(_R,{active:t}),actions:_.jsxs(_.Fragment,{children:[_.jsx(gR,{count:(i==null?void 0:i.agents)??0,onClick:()=>f(!0)}),_.jsxs(Jn,{type:"button",variant:"outline",onClick:()=>a(!0),className:"h-10 w-10 shrink-0 px-0 sm:w-auto sm:px-3","aria-label":"Open LLM configuration",children:[_.jsx(kv,{className:"h-4 w-4"}),_.jsx("span",{className:"hidden sm:inline",children:"LLM"})]}),_.jsx(lR,{})]})})}),e.error&&_.jsxs("div",{role:"alert",className:"mx-4 mt-3 flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive animate-fade-in",children:[_.jsx(Pa,{className:"mt-0.5 h-4 w-4 shrink-0"}),_.jsx("span",{className:"min-w-0 flex-1 break-words",children:e.error}),_.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:e.clearError,className:"rounded p-0.5 text-destructive/70 hover:bg-destructive/10 hover:text-destructive",children:_.jsx(jo,{className:"h-4 w-4"})})]}),e.activeScan?_.jsx("div",{className:"flex-1 p-4 overflow-auto",children:_.jsx(m4,{scan:e.activeScan,lines:e.progressLines,report:e.report,result:e.result,logCollapsed:e.logCollapsed,onToggleLog:e.toggleLog})}):_.jsx("div",{className:"flex-1 flex items-center justify-center",children:_.jsxs("div",{className:"text-center space-y-4",children:[_.jsx(ki,{className:"w-16 h-16 mx-auto text-muted-foreground/10",strokeWidth:1}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("p",{className:"text-sm font-medium text-foreground",children:"No active scan"}),_.jsx("p",{className:"text-xs text-muted-foreground",children:"Ready for a target"})]}),_.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[_.jsx(ya,{icon:_.jsx(yv,{className:"h-3.5 w-3.5"}),label:"History",value:e.scans.length}),_.jsx(ya,{icon:_.jsx(La,{className:"h-3.5 w-3.5"}),label:"Agents",value:(i==null?void 0:i.agents)??0,tone:((i==null?void 0:i.agents)??0)>0?"ready":"warning"}),_.jsx(ya,{icon:t?_.jsx(gn,{className:"h-3.5 w-3.5"}):_.jsx(Pa,{className:"h-3.5 w-3.5"}),label:"LLM",value:t?"Ready":"Offline",tone:t?"ready":"warning"}),_.jsx(ya,{icon:_.jsx(gn,{className:"h-3.5 w-3.5"}),label:"Config",value:i!=null&&i.config_loaded?"Loaded":"Default"})]})]})})]}),_.jsx(N4,{open:l,status:i,onClose:()=>a(!1),onSaved:m}),_.jsx(eR,{open:c,onClose:()=>f(!1)})]})}function gR({count:e,onClick:t}){const r=e>0;return _.jsxs("button",{type:"button",onClick:t,title:r?`${e} agent(s) connected`:"No agents connected",className:je("h-10 shrink-0 items-center gap-2 rounded-md border px-3 text-xs font-medium inline-flex cursor-pointer transition-colors hover:opacity-80",r?"border-cyber-400/30 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300":"border-yellow-400/30 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"),children:[_.jsx(La,{className:"h-3.5 w-3.5"}),_.jsx("span",{className:"hidden sm:inline",children:"Agents"}),_.jsx("span",{className:"font-mono",children:e})]})}function _R({active:e}){return _.jsxs("span",{title:e?"LLM Ready":"LLM Offline",className:je("hidden h-10 shrink-0 items-center gap-2 rounded-md border px-3 text-xs font-medium lg:inline-flex",e?"border-cyber-400/30 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300":"border-yellow-400/30 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"),children:[e?_.jsx(gn,{className:"h-3.5 w-3.5"}):_.jsx(Pa,{className:"h-3.5 w-3.5"}),e?"LLM Ready":"LLM Offline"]})}function ya({icon:e,label:t,value:r,tone:i="muted"}){return _.jsxs("div",{className:je("inline-flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-xs",i==="ready"&&"border-cyber-400/25 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300",i==="warning"&&"border-yellow-400/25 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300",i==="muted"&&"border-border bg-card/60 text-muted-foreground"),children:[e,_.jsx("span",{className:"text-muted-foreground",children:t}),_.jsx("span",{className:"font-mono text-foreground",children:r})]})}iw.createRoot(document.getElementById("root")).render(_.jsx(Qx.StrictMode,{children:_.jsx(mR,{})})); +`);break}},V.onerror=()=>r("error"),V.onclose=()=>r(ye=>ye==="error"?ye:"closed"),()=>{V.readyState===WebSocket.OPEN&&V.send(JSON.stringify({type:"pty.detach"})),V.close(),Pe.disconnect(),pe.dispose(),ve.dispose(),b.dispose(),S.current=null,k.current=null,E.current=null}},[e.id]);function T(q){var b;((b=S.current)==null?void 0:b.readyState)===WebSocket.OPEN&&S.current.send(JSON.stringify(q))}function se(){const q=k.current;return q?{cols:q.cols,rows:q.rows}:{cols:80,rows:24}}function he(){var q;(q=k.current)==null||q.reset()}function fe(){T({type:"pty.list"})}function F(q){o(q),f(b=>{const P=new Set(b),V=new Set(q.map(C=>C.id));for(const C of P)V.has(C)||P.delete(C);for(const C of q){const ae=av(C),ve=x.current[C.id];if(!y.current){x.current[C.id]=ae,P.delete(C.id);continue}if(C.id===m.current){x.current[C.id]=ae,P.delete(C.id);continue}if(ve===void 0){x.current[C.id]=ae,ae>0&&P.add(C.id);continue}ae>ve&&(x.current[C.id]=ae,P.add(C.id))}return y.current=!0,P})}function K(q,b){if(!q)return;const P=b||i.find(V=>V.id===q);P&&(x.current[q]=av(P)),f(V=>{if(!V.has(q))return V;const C=new Set(V);return C.delete(q),C})}function A(){if(W){H(W);return}he(),T({type:"pty.open",payload:{kind:"repl",name:ga,singleton:!0,...se()}})}function D(){he(),m.current="",a(""),T({type:"pty.detach"}),T({type:"pty.open",payload:{kind:"shell",name:`shell-${e.name}`,...se()}})}function H(q){q.id&&(he(),m.current=q.id,a(q.id),K(q.id,q),T({type:"pty.attach",payload:{session_id:q.id,...se()}}))}function j(){!l||(U==null?void 0:U.kind)==="repl"||T({type:"pty.kill",payload:{session_id:l}})}const Q=U?tu(U):l,re=(U==null?void 0:U.kind)!=="repl"&&(U==null?void 0:U.state)==="running",I=U||W;return _.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[_.jsx(iR,{status:t,title:Q||"Console",actions:_.jsxs(_.Fragment,{children:[_.jsx(va,{label:"New shell PTY",onClick:D,children:_.jsx(kv,{className:"h-3.5 w-3.5"})}),_.jsx(va,{label:"Refresh sessions",onClick:fe,children:_.jsx(Cv,{className:"h-3.5 w-3.5"})}),_.jsx(va,{label:"Stop active task",onClick:j,disabled:!re,children:_.jsx(Lw,{className:"h-3.5 w-3.5"})}),_.jsx(va,{label:h?"Hide details":"Show details",onClick:()=>g(q=>!q),active:h,children:_.jsx(Sv,{className:"h-3.5 w-3.5"})})]})}),_.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col lg:flex-row",children:[_.jsx(eR,{activeID:l,replSession:W,summary:Y,taskSessions:z,unreadIDs:c,onAttachRepl:A,onAttach:H}),_.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:_.jsx("div",{ref:L,className:"min-h-0 min-w-0 flex-1 bg-[#060a0d] p-2"})}),h&&_.jsx(tR,{agent:e,session:I,status:t,taskSessions:z,onClose:()=>g(!1)})]})]})}function iR({actions:e,status:t,title:r}){return _.jsxs("div",{className:"flex h-11 min-w-0 shrink-0 items-center justify-between border-b border-border px-3",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-2",title:r,children:[_.jsx(Lv,{className:"h-4 w-4 shrink-0 text-cyber-400"}),_.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:r}),_.jsx("span",{className:je("shrink-0 rounded px-1.5 py-0.5 text-[10px]",JP(t)),children:t})]}),e&&_.jsx("div",{className:"flex items-center gap-1",children:e})]})}function va({children:e,active:t,disabled:r,label:i,onClick:o}){return _.jsx(hs,{content:i,side:"bottom",children:_.jsx("button",{type:"button","aria-label":i,title:i,disabled:r,onClick:o,className:je("inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40",t&&"bg-cyber-400/10 text-cyber-700 dark:text-cyber-300"),children:e})})}function sR({open:e,onClose:t}){const{agents:r,error:i,loading:o,refresh:l,selected:a,selectedID:c,setSelectedID:f}=oR(e),h=r.length>1;return e?_.jsx("div",{className:"fixed inset-0 z-50 flex justify-end bg-background/70 backdrop-blur-sm",children:_.jsxs("div",{className:"flex h-full w-full max-w-7xl flex-col border-l border-border bg-card shadow-xl",children:[_.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border px-4",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[_.jsx(La,{className:"h-4 w-4 shrink-0 text-cyber-400"}),_.jsxs("div",{className:"min-w-0",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[_.jsx("span",{className:"text-sm font-medium text-foreground",children:"Agent Console"}),_.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r.length})]}),_.jsx("div",{className:"truncate text-xs text-muted-foreground",title:a?e1(a):void 0,children:a?`${a.name} · ${a.busy?"busy":"idle"}`:"No agent selected"})]})]}),_.jsx("button",{type:"button",onClick:t,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Close agents",children:_.jsx(jo,{className:"h-4 w-4"})})]}),_.jsx("div",{className:"min-h-0 flex-1",children:o?_.jsx("div",{className:"flex h-32 items-center justify-center text-muted-foreground",children:_.jsx(Na,{className:"h-5 w-5 animate-spin"})}):i?_.jsx("div",{className:"m-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:i}):r.length===0?_.jsxs("div",{className:"flex h-32 flex-col items-center justify-center gap-2 text-muted-foreground",children:[_.jsx(La,{className:"h-8 w-8 opacity-20"}),_.jsx("p",{className:"text-sm",children:"No agents connected"})]}):_.jsxs("div",{className:"flex h-full min-h-0 flex-col lg:flex-row",children:[h&&_.jsx(lR,{agents:r,selectedID:c,onRefresh:()=>l(!0),onSelect:f}),_.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:a&&_.jsx(nR,{agent:a})})]})})]})}):null}function oR(e){const[t,r]=te.useState([]),[i,o]=te.useState(!1),[l,a]=te.useState(""),[c,f]=te.useState(""),h=te.useCallback((m=!1)=>(m||(o(!0),a("")),S4().then(x=>{r(x),f(y=>{var S;return x.some(k=>k.id===y)?y:((S=x[0])==null?void 0:S.id)||""})}).catch(x=>{m||a(x.message||"Failed to load agents")}).finally(()=>{m||o(!1)})),[]);te.useEffect(()=>{e&&h()},[e,h]),te.useEffect(()=>{if(!e)return;const m=setInterval(()=>h(!0),5e3);return()=>clearInterval(m)},[e,h]);const g=t.find(m=>m.id===c)||t[0]||null;return{agents:t,error:l,loading:i,refresh:h,selected:g,selectedID:c,setSelectedID:f}}function lR({agents:e,onRefresh:t,onSelect:r,selectedID:i}){return _.jsxs("aside",{className:"flex max-h-52 w-full shrink-0 flex-col border-b border-border lg:max-h-none lg:w-64 lg:border-b-0 lg:border-r",children:[_.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-border px-3",children:[_.jsx("span",{className:"text-xs font-medium uppercase text-muted-foreground",children:"Agents"}),_.jsx("button",{type:"button",onClick:t,className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"Refresh agents",children:_.jsx(Cv,{className:"h-3.5 w-3.5"})})]}),_.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-2",children:e.map(o=>_.jsxs("button",{type:"button",onClick:()=>r(o.id),title:e1(o),className:je("mb-1 flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors",i===o.id?"bg-cyber-400/10 text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[_.jsx(vv,{className:je("mt-1 h-2.5 w-2.5 shrink-0 fill-current",o.busy?"text-yellow-400":"text-cyber-400")}),_.jsxs("span",{className:"min-w-0 flex-1",children:[_.jsx("span",{className:"block truncate text-sm font-medium",children:o.name}),_.jsxs("span",{className:"mt-0.5 block truncate text-xs",children:[o.busy?"busy":"idle"," · ",uR(o.connected_at)]})]})]},o.id))})]})}function e1(e){var o,l;const t=e.identity||{},r=e.stats||{};return[`name: ${e.name}`,`id: ${e.id}`,`state: ${e.busy?"busy":"idle"}`,`connected: ${aR(e.connected_at)}`,t.hostname?`host: ${t.hostname}`:"",t.username?`user: ${t.username}`:"",t.working_dir?`cwd: ${t.working_dir}`:"",t.os||t.arch?`runtime: ${[t.os,t.arch].filter(Boolean).join("/")}`:"",t.pid?`pid: ${t.pid}`:"",t.provider||t.model?`llm: ${[t.provider,t.model].filter(Boolean).join(" / ")}`:"",(o=e.commands)!=null&&o.length?`commands: ${e.commands.join(", ")}`:"",(l=t.capabilities)!=null&&l.length?`capabilities: ${t.capabilities.join(", ")}`:"",typeof r.turns=="number"?`turns: ${r.turns}`:"",typeof r.tool_calls=="number"?`tool calls: ${r.tool_calls}`:"",typeof r.total_tokens=="number"?`tokens: ${r.total_tokens}`:""].filter(Boolean).join(` +`)}function aR(e){try{return new Date(e).toLocaleString()}catch{return e}}function uR(e){try{const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}catch{return""}}const t1="aiscan-theme";function cR(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(t1);return e==="light"||e==="dark"?e:"dark"}function hR(e){document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e}function dR(){const[e,t]=te.useState(cR),r=e==="dark";return te.useEffect(()=>{hR(e),window.localStorage.setItem(t1,e)},[e]),_.jsx(hs,{content:r?"Switch to light theme":"Switch to dark theme",side:"bottom",children:_.jsx(Yr,{type:"button",variant:"outline",size:"icon","aria-label":r?"Switch to light theme":"Switch to dark theme",onClick:()=>t(r?"light":"dark"),className:"h-10 w-10 shrink-0",children:r?_.jsx(Pw,{className:"h-4 w-4"}):_.jsx(ww,{className:"h-4 w-4"})})})}const r1="scans";function fR(e){const t=e.split("/").filter(Boolean);if(t.length<2||t[0]!==r1)return null;try{return decodeURIComponent(t[1])}catch{return t[1]}}function pR(e){return e===""||e==="/"}function mR(e){return`/${r1}/${encodeURIComponent(e)}`}function gR(e,t){_R(mR(e),t)}function _R(e,t){t==="none"||`${window.location.pathname}${window.location.search}${window.location.hash}`===e||(t==="replace"?window.history.replaceState({},"",e):window.history.pushState({},"",e))}function vR(){const[e,t]=te.useState([]),[r,i]=te.useState(null),[o,l]=te.useState([]),[a,c]=te.useState(""),[f,h]=te.useState(null),[g,m]=te.useState(!1),[x,y]=te.useState(""),[S,k]=te.useState(!1),E=te.useRef(null),L=te.useRef(0),W=te.useCallback(async()=>{try{t(await E4())}catch{}},[]);te.useEffect(()=>{W()},[W]);function z(){E.current&&(E.current(),E.current=null)}async function Y(K,A,D){const H=++L.current;y(""),l([]),c(""),h(null),m(!0),k(!1);try{const j=await C4(K,A,D);if(H!==L.current)return;W(),await se(j,"push",H)}catch(j){if(H!==L.current)return;y(j.message||"Failed to submit scan"),m(!1)}}function U(K){z(),E.current=N4(K,A=>{if(A.type==="progress"&&A.data){l(D=>[...D,A.data]),A.result&&(h(A.result),i(D=>(D==null?void 0:D.id)===K?{...D,result:A.result}:D));return}if(A.type==="status"&&A.status){i(D=>(D==null?void 0:D.id)===K?{...D,status:A.status,updated_at:new Date().toISOString()}:D);return}if(A.type==="complete"){m(!1),k(!0),y(""),A.result&&h(A.result),i(D=>(D==null?void 0:D.id)===K?{...D,status:"completed",result:A.result||D.result,updated_at:new Date().toISOString()}:D),W(),A.result||T(K);return}A.type==="error"&&(m(!1),i(D=>(D==null?void 0:D.id)===K?{...D,status:"failed",error:A.error||"Scan failed",updated_at:new Date().toISOString()}:D),y(A.error||"Scan failed"),W())})}async function T(K,A){try{const D=await Oh(K);if(A&&A!==L.current)return;D.result&&h(D.result),D.report&&c(D.report),i(H=>(H==null?void 0:H.id)===K?{...H,...D}:H)}catch{}}async function se(K,A,D=++L.current){gR(K.id,A),z(),i(K),y(""),l([]),h(K.result||null),c(K.status==="completed"&&K.report?K.report:""),k(!1),m(K.status==="queued"||K.status==="running"),K.status==="completed"?(m(!1),k(!0),K.result||await T(K.id,D)):K.status==="queued"||K.status==="running"?U(K.id):(m(!1),c(""))}async function he(K,A){const D=++L.current;y("");try{const H=await Oh(K);if(D!==L.current)return;await se(H,A,D)}catch{if(D!==L.current)return;fe(),y(`Scan ${K} was not found`)}}function fe(){L.current+=1,z(),i(null),l([]),c(""),h(null),m(!1),k(!1)}function F(){fe(),y("")}return te.useEffect(()=>{const K=()=>{const A=fR(window.location.pathname);if(A){he(A,"none");return}pR(window.location.pathname)&&F()};return K(),window.addEventListener("popstate",K),()=>{window.removeEventListener("popstate",K),z()}},[]),{scans:e,activeScan:r,progressLines:o,report:a,result:f,scanning:g,error:x,logCollapsed:S,refreshScans:W,submit:Y,selectScan:K=>se(K,"push"),clearError:()=>y(""),toggleLog:()=>k(K=>!K)}}const n1="aiscan-sidebar-open";function yR(){if(typeof window>"u")return!0;if(window.matchMedia("(max-width: 767px)").matches)return!1;const e=window.localStorage.getItem(n1);return e==="true"||e==="false"?e==="true":window.matchMedia("(min-width: 1024px)").matches}function xR(){var x;const e=vR(),[t,r]=te.useState(!0),[i,o]=te.useState(null),[l,a]=te.useState(!1),[c,f]=te.useState(!1),[h,g]=te.useState(yR),m=te.useCallback(async()=>{try{const y=await w4();o(y),r(y.llm_available)}catch{r(!0)}},[]);return te.useEffect(()=>{m()},[m]),te.useEffect(()=>{window.localStorage.setItem(n1,String(h))},[h]),_.jsxs("div",{className:"flex min-h-screen bg-background",children:[_.jsx(yS,{open:h,onToggle:()=>g(!h),scans:e.scans,activeId:(x=e.activeScan)==null?void 0:x.id,onSelectScan:e.selectScan}),_.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[_.jsx("div",{className:"sticky top-0 z-20 border-b border-border bg-card/85 p-3 shadow-sm backdrop-blur-sm sm:p-4",children:_.jsx(wS,{onSubmit:e.submit,disabled:e.scanning,analysisAvailable:t,status:_.jsx(SR,{active:t}),actions:_.jsxs(_.Fragment,{children:[_.jsx(wR,{count:(i==null?void 0:i.agents)??0,onClick:()=>f(!0)}),_.jsxs(Yr,{type:"button",variant:"outline",onClick:()=>a(!0),className:"h-10 w-10 shrink-0 px-0 sm:w-auto sm:px-3","aria-label":"Open LLM configuration",children:[_.jsx(Nv,{className:"h-4 w-4"}),_.jsx("span",{className:"hidden sm:inline",children:"LLM"})]}),_.jsx(dR,{})]})})}),e.error&&_.jsxs("div",{role:"alert",className:"mx-4 mt-3 flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive animate-fade-in",children:[_.jsx(Pa,{className:"mt-0.5 h-4 w-4 shrink-0"}),_.jsx("span",{className:"min-w-0 flex-1 break-words",children:e.error}),_.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:e.clearError,className:"rounded p-0.5 text-destructive/70 hover:bg-destructive/10 hover:text-destructive",children:_.jsx(jo,{className:"h-4 w-4"})})]}),e.activeScan?_.jsx("div",{className:"flex-1 p-4 overflow-auto",children:_.jsx(y4,{scan:e.activeScan,lines:e.progressLines,report:e.report,result:e.result,logCollapsed:e.logCollapsed,onToggleLog:e.toggleLog})}):_.jsx("div",{className:"flex-1 flex items-center justify-center",children:_.jsxs("div",{className:"text-center space-y-4",children:[_.jsx(ki,{className:"w-16 h-16 mx-auto text-muted-foreground/10",strokeWidth:1}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("p",{className:"text-sm font-medium text-foreground",children:"No active scan"}),_.jsx("p",{className:"text-xs text-muted-foreground",children:"Ready for a target"})]}),_.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[_.jsx(ya,{icon:_.jsx(wv,{className:"h-3.5 w-3.5"}),label:"History",value:e.scans.length}),_.jsx(ya,{icon:_.jsx(La,{className:"h-3.5 w-3.5"}),label:"Agents",value:(i==null?void 0:i.agents)??0,tone:((i==null?void 0:i.agents)??0)>0?"ready":"warning"}),_.jsx(ya,{icon:t?_.jsx(vn,{className:"h-3.5 w-3.5"}):_.jsx(Pa,{className:"h-3.5 w-3.5"}),label:"LLM",value:t?"Ready":"Offline",tone:t?"ready":"warning"}),_.jsx(ya,{icon:_.jsx(vn,{className:"h-3.5 w-3.5"}),label:"Config",value:i!=null&&i.config_loaded?"Loaded":"Default"})]})]})})]}),_.jsx(T4,{open:l,status:i,onClose:()=>a(!1),onSaved:m}),_.jsx(sR,{open:c,onClose:()=>f(!1)})]})}function wR({count:e,onClick:t}){const r=e>0;return _.jsxs("button",{type:"button",onClick:t,title:r?`${e} agent(s) connected`:"No agents connected",className:je("h-10 shrink-0 items-center gap-2 rounded-md border px-3 text-xs font-medium inline-flex cursor-pointer transition-colors hover:opacity-80",r?"border-cyber-400/30 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300":"border-yellow-400/30 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"),children:[_.jsx(La,{className:"h-3.5 w-3.5"}),_.jsx("span",{className:"hidden sm:inline",children:"Agents"}),_.jsx("span",{className:"font-mono",children:e})]})}function SR({active:e}){return _.jsxs("span",{title:e?"LLM Ready":"LLM Offline",className:je("hidden h-10 shrink-0 items-center gap-2 rounded-md border px-3 text-xs font-medium lg:inline-flex",e?"border-cyber-400/30 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300":"border-yellow-400/30 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300"),children:[e?_.jsx(vn,{className:"h-3.5 w-3.5"}):_.jsx(Pa,{className:"h-3.5 w-3.5"}),e?"LLM Ready":"LLM Offline"]})}function ya({icon:e,label:t,value:r,tone:i="muted"}){return _.jsxs("div",{className:je("inline-flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-xs",i==="ready"&&"border-cyber-400/25 bg-cyber-400/10 text-cyber-700 dark:text-cyber-300",i==="warning"&&"border-yellow-400/25 bg-yellow-400/10 text-yellow-700 dark:text-yellow-300",i==="muted"&&"border-border bg-card/60 text-muted-foreground"),children:[e,_.jsx("span",{className:"text-muted-foreground",children:t}),_.jsx("span",{className:"font-mono text-foreground",children:r})]})}aw.createRoot(document.getElementById("root")).render(_.jsx(tw.StrictMode,{children:_.jsx(xR,{})})); diff --git a/web/static/assets/index-39EZdxuW.css b/web/static/assets/index-CiQLPVIi.css similarity index 98% rename from web/static/assets/index-39EZdxuW.css rename to web/static/assets/index-CiQLPVIi.css index 739bcbaf..2902ee80 100644 --- a/web/static/assets/index-39EZdxuW.css +++ b/web/static/assets/index-CiQLPVIi.css @@ -29,4 +29,4 @@ * The original design remains. The terminal itself * has been extended to include xterm CSI codes, among * other features. - */.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::-moz-selection{color:transparent}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:-moz-fit-content;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{color-scheme:light;--background: 210 40% 98%;--foreground: 222 47% 11%;--card: 0 0% 100%;--card-foreground: 222 47% 11%;--primary: 142 72% 32%;--primary-foreground: 0 0% 100%;--secondary: 210 40% 94%;--secondary-foreground: 222 47% 16%;--muted: 210 40% 94%;--muted-foreground: 215 16% 42%;--accent: 142 32% 91%;--accent-foreground: 142 72% 18%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--border: 214 32% 88%;--input: 214 32% 84%;--ring: 142 72% 32%;--radius: .5rem}.dark{color-scheme:dark;--background: 220 14% 4%;--foreground: 210 20% 92%;--card: 220 14% 6%;--card-foreground: 210 20% 92%;--primary: 142 71% 45%;--primary-foreground: 0 0% 100%;--secondary: 215 14% 14%;--secondary-foreground: 210 20% 92%;--muted: 215 14% 14%;--muted-foreground: 215 14% 60%;--accent: 215 14% 14%;--accent-foreground: 210 20% 92%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--border: 215 14% 16%;--input: 215 14% 16%;--ring: 142 71% 45%}*{border-color:hsl(var(--border))}html{background-color:hsl(var(--background))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:Inter,system-ui,-apple-system,sans-serif;min-height:100vh}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:hsl(var(--muted-foreground) / .35);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground) / .55)}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-right-0\.5{right:-.125rem}.-top-0\.5{top:-.125rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-full{left:100%}.right-1\.5{right:.375rem}.right-full{right:100%}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.col-span-full{grid-column:1 / -1}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.m-4{margin:1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.\!hidden{display:none!important}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-52{max-height:13rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-96{max-height:24rem}.min-h-0{min-height:0px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[4\.75rem\]{width:4.75rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-7xl{max-width:80rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.scroll-mt-24{scroll-margin-top:6rem}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[76px_minmax\(0\,1fr\)\]{grid-template-columns:76px minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border\/50>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .5)}.divide-border\/60>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .6)}.divide-border\/70>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .7)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-border{border-color:hsl(var(--border))}.border-border\/70{border-color:hsl(var(--border) / .7)}.border-cyber-400\/25{border-color:#4ade8040}.border-cyber-400\/30{border-color:#4ade804d}.border-cyber-400\/40{border-color:#4ade8066}.border-cyber-500\/40{border-color:#22c55e66}.border-cyber-600\/30{border-color:#16a34a4d}.border-destructive\/30{border-color:hsl(var(--destructive) / .3)}.border-green-500\/30{border-color:#22c55e4d}.border-input{border-color:hsl(var(--input))}.border-orange-500\/30{border-color:#f973164d}.border-red-400\/20{border-color:#f8717133}.border-red-400\/40{border-color:#f8717166}.border-red-500\/30{border-color:#ef44444d}.border-transparent{border-color:transparent}.border-yellow-400\/25{border-color:#facc1540}.border-yellow-400\/30{border-color:#facc154d}.border-yellow-400\/40{border-color:#facc1566}.border-yellow-500\/30{border-color:#eab3084d}.border-l-cyber-400{--tw-border-opacity: 1;border-left-color:rgb(74 222 128 / var(--tw-border-opacity, 1))}.border-l-green-500{--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-l-red-500{--tw-border-opacity: 1;border-left-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-l-yellow-500{--tw-border-opacity: 1;border-left-color:rgb(234 179 8 / var(--tw-border-opacity, 1))}.bg-\[\#060a0d\]{--tw-bg-opacity: 1;background-color:rgb(6 10 13 / var(--tw-bg-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/30{background-color:hsl(var(--background) / .3)}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/60{background-color:hsl(var(--background) / .6)}.bg-background\/70{background-color:hsl(var(--background) / .7)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-400\/10{background-color:#60a5fa1a}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-card{background-color:hsl(var(--card))}.bg-card\/50{background-color:hsl(var(--card) / .5)}.bg-card\/60{background-color:hsl(var(--card) / .6)}.bg-card\/85{background-color:hsl(var(--card) / .85)}.bg-card\/95{background-color:hsl(var(--card) / .95)}.bg-cyber-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-cyber-400\/10{background-color:#4ade801a}.bg-cyber-400\/5{background-color:#4ade800d}.bg-cyber-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-cyber-500\/10{background-color:#22c55e1a}.bg-cyber-500\/15{background-color:#22c55e26}.bg-cyber-500\/5{background-color:#22c55e0d}.bg-cyber-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-gray-400\/10{background-color:#9ca3af1a}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-400\/10{background-color:#4ade801a}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/15{background-color:#22c55e26}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/15{background-color:#f9731626}.bg-primary{background-color:hsl(var(--primary))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-400\/10{background-color:#f871711a}.bg-red-400\/15{background-color:#f8717126}.bg-red-400\/5{background-color:#f871710d}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/20{background-color:#ef444433}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-secondary\/80{background-color:hsl(var(--secondary) / .8)}.bg-transparent{background-color:transparent}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-400\/10{background-color:#facc151a}.bg-yellow-400\/15{background-color:#facc1526}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/15{background-color:#eab30826}.fill-current{fill:currentColor}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-3{padding-bottom:.75rem}.pl-3{padding-left:.75rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[8px\]{font-size:8px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-relaxed{line-height:1.625}.tracking-wider{letter-spacing:.05em}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-cyber-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-cyber-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-cyber-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-destructive\/70{color:hsl(var(--destructive) / .7)}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/10{color:hsl(var(--muted-foreground) / .1)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-\[1px\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}.dark\:prose-invert:is(.dark *){--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\:pt-0:first-child{padding-top:0}.last\:mb-0:last-child{margin-bottom:0}.last\:pb-0:last-child{padding-bottom:0}.hover\:border-cyber-400\/30:hover{border-color:#4ade804d}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-cyber-400\/10:hover{background-color:#4ade801a}.hover\:bg-cyber-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/30:hover{background-color:hsl(var(--secondary) / .3)}.hover\:bg-secondary\/40:hover{background-color:hsl(var(--secondary) / .4)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-cyber-500\/50:focus-visible{--tw-ring-color: rgb(34 197 94 / .5)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group\/service[open] .group-open\/service\:rotate-90,.group[open] .group-open\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-70{opacity:.7}.prose-headings\:my-2 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-headings\:font-semibold :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:600}.prose-headings\:text-cyber-700 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.prose-h1\:border-0 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:0px}.prose-h1\:border-b :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-bottom-width:1px}.prose-h1\:border-l-2 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-left-width:2px}.prose-h1\:border-border :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-h1\:border-l-cyber-500 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.prose-h1\:p-0 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){padding:0}.prose-h1\:pb-2 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){padding-bottom:.5rem}.prose-h1\:pl-3 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem}.prose-h1\:text-lg :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1.125rem;line-height:1.75rem}.prose-h1\:text-sm :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-h2\:mt-6 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:1.5rem}.prose-h2\:border-0 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:0px}.prose-h2\:border-l-2 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){border-left-width:2px}.prose-h2\:border-l-cyber-500\/50 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){border-left-color:#22c55e80}.prose-h2\:p-0 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){padding:0}.prose-h2\:pl-3 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem}.prose-h2\:text-base :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1rem;line-height:1.5rem}.prose-h2\:text-sm :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-h3\:text-sm :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-p\:my-1 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-p\:leading-relaxed :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:1.625}.prose-p\:text-foreground\/85 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground) / .85)}.prose-p\:text-muted-foreground :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--muted-foreground))}.prose-a\:text-cyber-700 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.prose-a\:no-underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:none}.hover\:prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{text-decoration-line:underline}.prose-blockquote\:my-2 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-strong\:text-foreground :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground))}.prose-code\:rounded :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.25rem}.prose-code\:bg-secondary :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:hsl(var(--secondary))}.prose-code\:px-1\.5 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.375rem;padding-right:.375rem}.prose-code\:py-0\.5 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.125rem;padding-bottom:.125rem}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-code\:text-cyber-700 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.prose-code\:before\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):before{--tw-content: none;content:var(--tw-content)}.prose-code\:after\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):after{--tw-content: none;content:var(--tw-content)}.prose-pre\:my-2 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-pre\:rounded-lg :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:var(--radius)}.prose-pre\:border :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:1px}.prose-pre\:border-border :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-pre\:bg-secondary :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:hsl(var(--secondary))}.prose-ol\:my-1 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-ul\:my-1 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-li\:my-0 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-li\:text-foreground\/85 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground) / .85)}.prose-li\:text-muted-foreground :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--muted-foreground))}.prose-table\:my-2 :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-table\:text-xs :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-th\:border-border :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-th\:bg-secondary\/50 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:hsl(var(--secondary) / .5)}.prose-th\:px-3 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem;padding-right:.75rem}.prose-th\:py-2 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.5rem;padding-bottom:.5rem}.prose-th\:text-foreground :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground))}.prose-td\:border-border :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-td\:px-3 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem;padding-right:.75rem}.prose-td\:py-1\.5 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.375rem;padding-bottom:.375rem}.prose-td\:text-muted-foreground :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--muted-foreground))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:bg-blue-900\/50:is(.dark *){background-color:#1e3a8a80}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-cyber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-cyber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:prose-headings\:text-cyber-400 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:prose-a\:text-cyber-400 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:prose-code\:text-cyber-300 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:contents{display:contents}.sm\:w-auto{width:auto}.sm\:min-w-\[16rem\]{min-width:16rem}.sm\:flex-1{flex:1 1 0%}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.sm\:flex-wrap{flex-wrap:wrap}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:p-4{padding:1rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}}@media(min-width:768px){.md\:relative{position:relative}.md\:inset-auto{inset:auto}.md\:z-auto{z-index:auto}.md\:hidden{display:none}.md\:bg-card\/50{background-color:hsl(var(--card) / .5)}.md\:shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media(min-width:1024px){.lg\:inline-flex{display:inline-flex}.lg\:max-h-none{max-height:none}.lg\:w-64{width:16rem}.lg\:w-80{width:20rem}.lg\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:border-b-0{border-bottom-width:0px}.lg\:border-l{border-left-width:1px}.lg\:border-r{border-right-width:1px}.lg\:border-t-0{border-top-width:0px}}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none} + */.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::-moz-selection{color:transparent}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:-moz-fit-content;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{color-scheme:light;--background: 210 40% 98%;--foreground: 222 47% 11%;--card: 0 0% 100%;--card-foreground: 222 47% 11%;--primary: 142 72% 32%;--primary-foreground: 0 0% 100%;--secondary: 210 40% 94%;--secondary-foreground: 222 47% 16%;--muted: 210 40% 94%;--muted-foreground: 215 16% 42%;--accent: 142 32% 91%;--accent-foreground: 142 72% 18%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--border: 214 32% 88%;--input: 214 32% 84%;--ring: 142 72% 32%;--radius: .5rem}.dark{color-scheme:dark;--background: 220 14% 4%;--foreground: 210 20% 92%;--card: 220 14% 6%;--card-foreground: 210 20% 92%;--primary: 142 71% 45%;--primary-foreground: 0 0% 100%;--secondary: 215 14% 14%;--secondary-foreground: 210 20% 92%;--muted: 215 14% 14%;--muted-foreground: 215 14% 60%;--accent: 215 14% 14%;--accent-foreground: 210 20% 92%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--border: 215 14% 16%;--input: 215 14% 16%;--ring: 142 71% 45%}*{border-color:hsl(var(--border))}html{background-color:hsl(var(--background))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:Inter,system-ui,-apple-system,sans-serif;min-height:100vh}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:hsl(var(--muted-foreground) / .35);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:hsl(var(--muted-foreground) / .55)}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-right-0\.5{right:-.125rem}.-top-0\.5{top:-.125rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:.625rem}.left-3{left:.75rem}.left-full{left:100%}.right-1\.5{right:.375rem}.right-full{right:100%}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.col-span-full{grid-column:1 / -1}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.m-4{margin:1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.\!hidden{display:none!important}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.max-h-52{max-height:13rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-96{max-height:24rem}.min-h-0{min-height:0px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[4\.75rem\]{width:4.75rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-7xl{max-width:80rem}.max-w-none{max-width:none}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.scroll-mt-24{scroll-margin-top:6rem}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\[76px_minmax\(0\,1fr\)\]{grid-template-columns:76px minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-border\/50>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .5)}.divide-border\/60>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .6)}.divide-border\/70>:not([hidden])~:not([hidden]){border-color:hsl(var(--border) / .7)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-border{border-color:hsl(var(--border))}.border-border\/70{border-color:hsl(var(--border) / .7)}.border-cyber-400\/25{border-color:#4ade8040}.border-cyber-400\/30{border-color:#4ade804d}.border-cyber-400\/40{border-color:#4ade8066}.border-cyber-500\/40{border-color:#22c55e66}.border-cyber-600\/30{border-color:#16a34a4d}.border-destructive\/30{border-color:hsl(var(--destructive) / .3)}.border-green-500\/30{border-color:#22c55e4d}.border-input{border-color:hsl(var(--input))}.border-orange-500\/30{border-color:#f973164d}.border-red-400\/20{border-color:#f8717133}.border-red-400\/40{border-color:#f8717166}.border-red-500\/30{border-color:#ef44444d}.border-transparent{border-color:transparent}.border-yellow-400\/25{border-color:#facc1540}.border-yellow-400\/30{border-color:#facc154d}.border-yellow-400\/40{border-color:#facc1566}.border-yellow-500\/30{border-color:#eab3084d}.border-l-cyber-400{--tw-border-opacity: 1;border-left-color:rgb(74 222 128 / var(--tw-border-opacity, 1))}.border-l-green-500{--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-l-red-500{--tw-border-opacity: 1;border-left-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-l-yellow-500{--tw-border-opacity: 1;border-left-color:rgb(234 179 8 / var(--tw-border-opacity, 1))}.bg-\[\#060a0d\]{--tw-bg-opacity: 1;background-color:rgb(6 10 13 / var(--tw-bg-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/30{background-color:hsl(var(--background) / .3)}.bg-background\/50{background-color:hsl(var(--background) / .5)}.bg-background\/60{background-color:hsl(var(--background) / .6)}.bg-background\/70{background-color:hsl(var(--background) / .7)}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-400\/10{background-color:#60a5fa1a}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-card{background-color:hsl(var(--card))}.bg-card\/50{background-color:hsl(var(--card) / .5)}.bg-card\/60{background-color:hsl(var(--card) / .6)}.bg-card\/85{background-color:hsl(var(--card) / .85)}.bg-card\/95{background-color:hsl(var(--card) / .95)}.bg-cyber-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-cyber-400\/10{background-color:#4ade801a}.bg-cyber-400\/5{background-color:#4ade800d}.bg-cyber-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-cyber-500\/10{background-color:#22c55e1a}.bg-cyber-500\/15{background-color:#22c55e26}.bg-cyber-500\/5{background-color:#22c55e0d}.bg-cyber-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-gray-400\/10{background-color:#9ca3af1a}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-400\/10{background-color:#4ade801a}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/15{background-color:#22c55e26}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/15{background-color:#f9731626}.bg-primary{background-color:hsl(var(--primary))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-400\/10{background-color:#f871711a}.bg-red-400\/15{background-color:#f8717126}.bg-red-400\/5{background-color:#f871710d}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/20{background-color:#ef444433}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-secondary\/80{background-color:hsl(var(--secondary) / .8)}.bg-transparent{background-color:transparent}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-400\/10{background-color:#facc151a}.bg-yellow-400\/15{background-color:#facc1526}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/15{background-color:#eab30826}.fill-current{fill:currentColor}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-3{padding-bottom:.75rem}.pl-3{padding-left:.75rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[8px\]{font-size:8px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-relaxed{line-height:1.625}.tracking-wider{letter-spacing:.05em}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-cyber-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-cyber-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-cyber-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-destructive\/70{color:hsl(var(--destructive) / .7)}.text-foreground{color:hsl(var(--foreground))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/10{color:hsl(var(--muted-foreground) / .1)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/60{color:hsl(var(--muted-foreground) / .6)}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-\[1px\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}.dark\:prose-invert:is(.dark *){--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\:pt-0:first-child{padding-top:0}.last\:mb-0:last-child{margin-bottom:0}.last\:pb-0:last-child{padding-bottom:0}.hover\:border-cyber-400\/30:hover{border-color:#4ade804d}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-cyber-400\/10:hover{background-color:#4ade801a}.hover\:bg-cyber-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/30:hover{background-color:hsl(var(--secondary) / .3)}.hover\:bg-secondary\/40:hover{background-color:hsl(var(--secondary) / .4)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-cyber-500\/50:focus-visible{--tw-ring-color: rgb(34 197 94 / .5)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group\/service[open] .group-open\/service\:rotate-90,.group[open] .group-open\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:opacity-70{opacity:.7}.prose-headings\:my-2 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-headings\:font-semibold :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:600}.prose-headings\:text-cyber-700 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.prose-h1\:border-0 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:0px}.prose-h1\:border-b :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-bottom-width:1px}.prose-h1\:border-l-2 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-left-width:2px}.prose-h1\:border-border :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-h1\:border-l-cyber-500 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-border-opacity: 1;border-left-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.prose-h1\:p-0 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){padding:0}.prose-h1\:pb-2 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){padding-bottom:.5rem}.prose-h1\:pl-3 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem}.prose-h1\:text-lg :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1.125rem;line-height:1.75rem}.prose-h1\:text-sm :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-h2\:mt-6 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:1.5rem}.prose-h2\:border-0 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:0px}.prose-h2\:border-l-2 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){border-left-width:2px}.prose-h2\:border-l-cyber-500\/50 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){border-left-color:#22c55e80}.prose-h2\:p-0 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){padding:0}.prose-h2\:pl-3 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem}.prose-h2\:text-base :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:1rem;line-height:1.5rem}.prose-h2\:text-sm :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-h3\:text-sm :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.875rem;line-height:1.25rem}.prose-p\:my-1 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-p\:leading-relaxed :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:1.625}.prose-p\:text-foreground\/85 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground) / .85)}.prose-p\:text-muted-foreground :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--muted-foreground))}.prose-a\:text-cyber-700 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.prose-a\:no-underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:none}.hover\:prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{text-decoration-line:underline}.prose-blockquote\:my-2 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-strong\:text-foreground :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground))}.prose-code\:rounded :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.25rem}.prose-code\:bg-secondary :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:hsl(var(--secondary))}.prose-code\:px-1\.5 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.375rem;padding-right:.375rem}.prose-code\:py-0\.5 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.125rem;padding-bottom:.125rem}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-code\:text-cyber-700 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.prose-code\:before\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):before{--tw-content: none;content:var(--tw-content)}.prose-code\:after\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):after{--tw-content: none;content:var(--tw-content)}.prose-pre\:my-2 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-pre\:rounded-lg :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:var(--radius)}.prose-pre\:border :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){border-width:1px}.prose-pre\:border-border :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-pre\:bg-secondary :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:hsl(var(--secondary))}.prose-ol\:my-1 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-ul\:my-1 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.25rem;margin-bottom:.25rem}.prose-li\:my-0 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:0;margin-bottom:0}.prose-li\:text-foreground\/85 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground) / .85)}.prose-li\:text-muted-foreground :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--muted-foreground))}.prose-table\:my-2 :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:.5rem;margin-bottom:.5rem}.prose-table\:text-xs :is(:where(table):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-th\:border-border :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-th\:bg-secondary\/50 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:hsl(var(--secondary) / .5)}.prose-th\:px-3 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem;padding-right:.75rem}.prose-th\:py-2 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.5rem;padding-bottom:.5rem}.prose-th\:text-foreground :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--foreground))}.prose-td\:border-border :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){border-color:hsl(var(--border))}.prose-td\:px-3 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.75rem;padding-right:.75rem}.prose-td\:py-1\.5 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.375rem;padding-bottom:.375rem}.prose-td\:text-muted-foreground :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){color:hsl(var(--muted-foreground))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:bg-blue-900\/50:is(.dark *){background-color:#1e3a8a80}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-cyber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-cyber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-cyber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-orange-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:prose-headings\:text-cyber-400 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:prose-a\:text-cyber-400 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:prose-code\:text-cyber-300 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}@media(min-width:640px){.sm\:col-span-2{grid-column:span 2 / span 2}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:contents{display:contents}.sm\:w-auto{width:auto}.sm\:min-w-\[16rem\]{min-width:16rem}.sm\:flex-1{flex:1 1 0%}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.sm\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1\.4fr\)_2\.25rem\]{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) 2.25rem}.sm\:flex-wrap{flex-wrap:wrap}.sm\:justify-end{justify-content:flex-end}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:p-4{padding:1rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}}@media(min-width:768px){.md\:relative{position:relative}.md\:inset-auto{inset:auto}.md\:z-auto{z-index:auto}.md\:hidden{display:none}.md\:bg-card\/50{background-color:hsl(var(--card) / .5)}.md\:shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media(min-width:1024px){.lg\:inline-flex{display:inline-flex}.lg\:max-h-none{max-height:none}.lg\:w-64{width:16rem}.lg\:w-80{width:20rem}.lg\:grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:border-b-0{border-bottom-width:0px}.lg\:border-l{border-left-width:1px}.lg\:border-r{border-right-width:1px}.lg\:border-t-0{border-top-width:0px}}.\[\&\:\:-webkit-details-marker\]\:hidden::-webkit-details-marker{display:none} diff --git a/web/static/index.html b/web/static/index.html index 6cf156ff..f387a31b 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -18,8 +18,8 @@ } })() - - + +